Merging gnuradio generated python code into the Python web serverCan I send samples from the device made by myself to GNU radio?SDR GnuRadio gr-dsd decode D-STAR voiceChoose the right dongle for NOAA images visualization with GnuRadioI want to know the bandwidth of this signal; problems using “QT GUI Frequency sink” to show itGNU Radio code and data type conversionI want to know how QT GUI Entry is implemented in gnuradio. I am puzzled how the code is like?Using Satnogs' *.ogg files in GnuRadio flowgraphsHow to record fixed number of samples in gnuradioGnuRadio RF transmission, legal and safety issuesSimple Gnuradio TX/RX loopback example/tutorial
Shortest hex dumping program
Integer Lists of Noah
How to drill holes in 3/8" thick steel plates?
Indesign - how to change the style of the page numbers?
What specific instant in time in the MCU has been depicted the most times?
What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?
How do you move up one folder in Finder?
Astronaut distance from Earth?
Are there any medieval light sources without fire?
Why would non-kinetic weapons be used for orbital bombardment?
Optimization terminology: "Exact" v. "Approximate"
Is there any reason why MCU changed the Snap to Blip
Using `PlotLegends` with a `ColorFunction`
Are there any sports for which the world's best player is female?
Is there any word for "disobedience to God"?
Graduate student with abysmal English writing skills, how to help
What is a "shilicashe?"
How are mathematicians paid to do research?
Why do we need common sense in AI?
Confirming the Identity of a (Friendly) Reviewer After the Reviews
How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?
Great Unsolved Problems in O.R
What to do with a rabbit in a survival situation?
Can you cast a blanket Invisibility and let the targets see each other?
Merging gnuradio generated python code into the Python web server
Can I send samples from the device made by myself to GNU radio?SDR GnuRadio gr-dsd decode D-STAR voiceChoose the right dongle for NOAA images visualization with GnuRadioI want to know the bandwidth of this signal; problems using “QT GUI Frequency sink” to show itGNU Radio code and data type conversionI want to know how QT GUI Entry is implemented in gnuradio. I am puzzled how the code is like?Using Satnogs' *.ogg files in GnuRadio flowgraphsHow to record fixed number of samples in gnuradioGnuRadio RF transmission, legal and safety issuesSimple Gnuradio TX/RX loopback example/tutorial
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I am trying to figure out how I control a Software Defined Radio over a network, and stream the received baseband samples from my remote hardware back to the gnuradio.
What I'm trying to do here is, this Python code should be able to output a user selectable waveform which can be a CW tone, Broadband Noise, or an arbitrary waveform read from a file containing I/Q values.
So I searched on the internet and the closest thing that I found was the BorIP and unfortunately couldn't get it set-up on my machine because the instructions I found were not helpful (at least for a beginner like me).
I created the Python web server using this script (which I found online):
import http.server
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
But didn't know how to merge the generated gnuradio python code into the Python web server.
software-defined-radio gnuradio
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I am trying to figure out how I control a Software Defined Radio over a network, and stream the received baseband samples from my remote hardware back to the gnuradio.
What I'm trying to do here is, this Python code should be able to output a user selectable waveform which can be a CW tone, Broadband Noise, or an arbitrary waveform read from a file containing I/Q values.
So I searched on the internet and the closest thing that I found was the BorIP and unfortunately couldn't get it set-up on my machine because the instructions I found were not helpful (at least for a beginner like me).
I created the Python web server using this script (which I found online):
import http.server
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
But didn't know how to merge the generated gnuradio python code into the Python web server.
software-defined-radio gnuradio
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I am trying to figure out how I control a Software Defined Radio over a network, and stream the received baseband samples from my remote hardware back to the gnuradio.
What I'm trying to do here is, this Python code should be able to output a user selectable waveform which can be a CW tone, Broadband Noise, or an arbitrary waveform read from a file containing I/Q values.
So I searched on the internet and the closest thing that I found was the BorIP and unfortunately couldn't get it set-up on my machine because the instructions I found were not helpful (at least for a beginner like me).
I created the Python web server using this script (which I found online):
import http.server
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
But didn't know how to merge the generated gnuradio python code into the Python web server.
software-defined-radio gnuradio
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I am trying to figure out how I control a Software Defined Radio over a network, and stream the received baseband samples from my remote hardware back to the gnuradio.
What I'm trying to do here is, this Python code should be able to output a user selectable waveform which can be a CW tone, Broadband Noise, or an arbitrary waveform read from a file containing I/Q values.
So I searched on the internet and the closest thing that I found was the BorIP and unfortunately couldn't get it set-up on my machine because the instructions I found were not helpful (at least for a beginner like me).
I created the Python web server using this script (which I found online):
import http.server
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
But didn't know how to merge the generated gnuradio python code into the Python web server.
software-defined-radio gnuradio
software-defined-radio gnuradio
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 8 hours ago
Kevin Reid AG6YO♦
17.4k4 gold badges35 silver badges76 bronze badges
17.4k4 gold badges35 silver badges76 bronze badges
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
HadadHadad
334 bronze badges
334 bronze badges
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hadad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
GNU Radio Companion (GRC) generates Python code that is something like this (not exact text). (Make sure you chose the "No GUI" option in GRC.)
class my_block(gr.top_block):
# ...
def main():
tb = my_block()
tb.run()
if __name__ == '__main__':
main()
You can just import
this as a module in your Python program (the if __name__
check will skip running the code that wouldn't be appropriate). Once you've done that, the way you use it is to just create the top block and call tb.start()
. This will start the flow graph without also waiting for it to finish, which is exactly what you want when you have a separate main loop like a web server.
import my_block
tb = my_block.my_block()
tb.start()
When you're shutting down, do this to stop the GNU Radio threads:
tb.stop()
tb.wait()
Then you can also use the generated methods (a getter and setter per GRC "variable") to change parameters while the flow graph is running.
There's a lot more that can be said about how to go beyond what GRC generates for you (which would best be asked as separate questions), but this is how you get started with integrating a GNU Radio flow graph into a larger program.
I would recommend expecting to eventually stop using GRC's code generation and write your own Python code. This is because GRC has quite a few limitations in what you can do with it — for example, if you want to decide at runtime which type of signal source block to create, you can't do that in GRC but it's easy when you write your own Python. You can always use GRC to generate examples to copy from, when you're unsure how to configure a block.
$endgroup$
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "520"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Hadad is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fham.stackexchange.com%2fquestions%2f14883%2fmerging-gnuradio-generated-python-code-into-the-python-web-server%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
GNU Radio Companion (GRC) generates Python code that is something like this (not exact text). (Make sure you chose the "No GUI" option in GRC.)
class my_block(gr.top_block):
# ...
def main():
tb = my_block()
tb.run()
if __name__ == '__main__':
main()
You can just import
this as a module in your Python program (the if __name__
check will skip running the code that wouldn't be appropriate). Once you've done that, the way you use it is to just create the top block and call tb.start()
. This will start the flow graph without also waiting for it to finish, which is exactly what you want when you have a separate main loop like a web server.
import my_block
tb = my_block.my_block()
tb.start()
When you're shutting down, do this to stop the GNU Radio threads:
tb.stop()
tb.wait()
Then you can also use the generated methods (a getter and setter per GRC "variable") to change parameters while the flow graph is running.
There's a lot more that can be said about how to go beyond what GRC generates for you (which would best be asked as separate questions), but this is how you get started with integrating a GNU Radio flow graph into a larger program.
I would recommend expecting to eventually stop using GRC's code generation and write your own Python code. This is because GRC has quite a few limitations in what you can do with it — for example, if you want to decide at runtime which type of signal source block to create, you can't do that in GRC but it's easy when you write your own Python. You can always use GRC to generate examples to copy from, when you're unsure how to configure a block.
$endgroup$
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
add a comment |
$begingroup$
GNU Radio Companion (GRC) generates Python code that is something like this (not exact text). (Make sure you chose the "No GUI" option in GRC.)
class my_block(gr.top_block):
# ...
def main():
tb = my_block()
tb.run()
if __name__ == '__main__':
main()
You can just import
this as a module in your Python program (the if __name__
check will skip running the code that wouldn't be appropriate). Once you've done that, the way you use it is to just create the top block and call tb.start()
. This will start the flow graph without also waiting for it to finish, which is exactly what you want when you have a separate main loop like a web server.
import my_block
tb = my_block.my_block()
tb.start()
When you're shutting down, do this to stop the GNU Radio threads:
tb.stop()
tb.wait()
Then you can also use the generated methods (a getter and setter per GRC "variable") to change parameters while the flow graph is running.
There's a lot more that can be said about how to go beyond what GRC generates for you (which would best be asked as separate questions), but this is how you get started with integrating a GNU Radio flow graph into a larger program.
I would recommend expecting to eventually stop using GRC's code generation and write your own Python code. This is because GRC has quite a few limitations in what you can do with it — for example, if you want to decide at runtime which type of signal source block to create, you can't do that in GRC but it's easy when you write your own Python. You can always use GRC to generate examples to copy from, when you're unsure how to configure a block.
$endgroup$
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
add a comment |
$begingroup$
GNU Radio Companion (GRC) generates Python code that is something like this (not exact text). (Make sure you chose the "No GUI" option in GRC.)
class my_block(gr.top_block):
# ...
def main():
tb = my_block()
tb.run()
if __name__ == '__main__':
main()
You can just import
this as a module in your Python program (the if __name__
check will skip running the code that wouldn't be appropriate). Once you've done that, the way you use it is to just create the top block and call tb.start()
. This will start the flow graph without also waiting for it to finish, which is exactly what you want when you have a separate main loop like a web server.
import my_block
tb = my_block.my_block()
tb.start()
When you're shutting down, do this to stop the GNU Radio threads:
tb.stop()
tb.wait()
Then you can also use the generated methods (a getter and setter per GRC "variable") to change parameters while the flow graph is running.
There's a lot more that can be said about how to go beyond what GRC generates for you (which would best be asked as separate questions), but this is how you get started with integrating a GNU Radio flow graph into a larger program.
I would recommend expecting to eventually stop using GRC's code generation and write your own Python code. This is because GRC has quite a few limitations in what you can do with it — for example, if you want to decide at runtime which type of signal source block to create, you can't do that in GRC but it's easy when you write your own Python. You can always use GRC to generate examples to copy from, when you're unsure how to configure a block.
$endgroup$
GNU Radio Companion (GRC) generates Python code that is something like this (not exact text). (Make sure you chose the "No GUI" option in GRC.)
class my_block(gr.top_block):
# ...
def main():
tb = my_block()
tb.run()
if __name__ == '__main__':
main()
You can just import
this as a module in your Python program (the if __name__
check will skip running the code that wouldn't be appropriate). Once you've done that, the way you use it is to just create the top block and call tb.start()
. This will start the flow graph without also waiting for it to finish, which is exactly what you want when you have a separate main loop like a web server.
import my_block
tb = my_block.my_block()
tb.start()
When you're shutting down, do this to stop the GNU Radio threads:
tb.stop()
tb.wait()
Then you can also use the generated methods (a getter and setter per GRC "variable") to change parameters while the flow graph is running.
There's a lot more that can be said about how to go beyond what GRC generates for you (which would best be asked as separate questions), but this is how you get started with integrating a GNU Radio flow graph into a larger program.
I would recommend expecting to eventually stop using GRC's code generation and write your own Python code. This is because GRC has quite a few limitations in what you can do with it — for example, if you want to decide at runtime which type of signal source block to create, you can't do that in GRC but it's easy when you write your own Python. You can always use GRC to generate examples to copy from, when you're unsure how to configure a block.
answered 8 hours ago
Kevin Reid AG6YO♦Kevin Reid AG6YO
17.4k4 gold badges35 silver badges76 bronze badges
17.4k4 gold badges35 silver badges76 bronze badges
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
add a comment |
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
$begingroup$
Thank you so much Kevin for taking time and answering my question. Again, I am a real begginer when it comes to python or programming, but definitely I will do my best to figure this out and what I can do.
$endgroup$
– Hadad
7 hours ago
add a comment |
Hadad is a new contributor. Be nice, and check out our Code of Conduct.
Hadad is a new contributor. Be nice, and check out our Code of Conduct.
Hadad is a new contributor. Be nice, and check out our Code of Conduct.
Hadad is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Amateur Radio Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fham.stackexchange.com%2fquestions%2f14883%2fmerging-gnuradio-generated-python-code-into-the-python-web-server%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown