bokehgui_for_cortexlab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bokehgui_for_cortexlab [2022/02/22 10:21] – aparis | bokehgui_for_cortexlab [2025/05/16 16:59] (current) – cmorin | ||
---|---|---|---|
Line 1: | Line 1: | ||
# Eyes and ears inside CorteXlab | # Eyes and ears inside CorteXlab | ||
- | In this tutorial we will use the gr-bokehgui module to have a time, frequency and spectrogram visualization of the signal transmitted in the platform in real time. We will not try to demodulate the signal, this is just a visualization tool. | + | In this tutorial we will use the gr-bokehgui module to have a time, frequency and spectrogram visualization of the signal transmitted in the platform in real time. |
- | Here, we will transmit an OFDM signal using the docker image you used for the previous tutorial. However you can replace it by any project of your own, we just need a signal to visualize. | + | For that, we will modify not only the scenario file as before, but also the running GNU Radio flowgraphs |
- | ## Update your scenario | + | ## Opening remarks/ |
- | A running docker image with the gr-bokehgui | + | Since we will modify GNU Radio flowgraphs, graphically, |
+ | For that, you can either: | ||
- | As previously stated, we will use the OFDM transmission used in the first tutorial | + | * Have a running X11 server on your computer. On Linux/ |
- | Therefore | + | * [Install GNU Radio 3.10](https:// |
+ | This is the recommended way to properly work on actual experiments because | ||
+ | * Have docker running on your computer, run a container based on the '' | ||
+ | ## Preliminary steps | ||
- | < | + | We will be starting |
- | # Example scenario description file | + | |
- | # | + | |
- | # All lines starting | + | |
+ | So first, ensure that you are connected to airlock, as seen before. | ||
+ | And ensure you have booked the platform, with the nodes 14 and 16 as we will be using them. | ||
- | # Scenario textual description | ||
- | # | ||
- | description: | ||
- | # Experiment maximum duration | + | In the previously made ' |
- | # Time after which the experiment is forced to stop | + | |
- | # | + | |
- | duration: 300 | + | |
- | # Node list | + | < |
- | # | + | you@srvairlock:~$ cd Tutorials |
- | # | + | you@srvairlock:~/Tutorials cp -r Tuto_2 Tuto_3 |
- | # | + | you@srvairlock:~/Tutorials cd Tuto_3/ |
- | # nodes: | + | </ |
- | # | + | |
- | # | + | |
- | nodes: | + | ## The scenario |
- | node14: | + | |
- | container: | + | |
- | - image: [YOUR DOCKER USERNAME]/ | + | |
- | command: / | + | |
- | node16: | + | Let's open the existing scenario file: |
- | container: | + | |
- | - image: [YOUR DOCKER USERNAME]/ | + | |
- | command: / | + | |
- | node17: | + | < |
- | | + | you@srvairlock:~/Tutorials/Tuto_3/examples nano ofdm_benchmark/scenario.yaml |
- | - image: amauryparis/cxlb_bokehgui | + | |
- | command: | + | |
</ | </ | ||
- | You should directly modify | + | And simply increase |
+ | |||
+ | and now we can create and submit | ||
< | < | ||
- | you@yourpc:~$ ssh -X -v [-i path/to/the/key] username@gw.cortexlab.fr | + | you@srvairlock:~/Tutorials/Tuto_3/examples minus task create ofdm_benchmark |
+ | you@srvairlock: | ||
+ | 2542 | ||
</ | </ | ||
- | You can now create and submit you task using '' | ||
- | If you are unclear on how to do it and on the purpose of the scenario file, we recommend going back to the first tutorial. | ||
## Connect to the Bokehgui node | ## Connect to the Bokehgui node | ||
- | Once the task is running, we connect to the node with the bokehgui image directly from you local computer, not from the airlock server as for the OFDM node. This is because we need to forward the bokehgui data-stream directly from the node to your local computer. This command, to be run in another terminal, will connect you to the node and set up the jump through Airlock | + | Once the task is running, we connect to the node with the bokehgui image directly from you local computer. This is because we need to forward the bokehgui data-stream directly from the node to your local computer. This command, to be run in another terminal, will connect you to the node and set up the jump through Airlock |
< | < | ||
- | you@yourpc: | + | you@yourpc: |
</ | </ | ||
- | On the node, you will find two files, the GRC flowgraph | + | We have introduces a few new options to the '' |
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
- | {{ : | + | We also need to connect to node 14 that we will use as transmitter without modification and without visualisation. |
+ | Let's open a new (third) terminal, and connect to it: | ||
- | You can ran the python executable with the following command | + | < |
+ | you@yourpc: | ||
+ | </ | ||
+ | |||
+ | On node 16 (or on your own computer if you don't have an X server running), let's open GNU Radio Companion: | ||
< | < | ||
- | root@mnode17:~# ./ | + | root@mnode16:~$ gnuradio-companion |
</ | </ | ||
- | **Remarq** | + | This should open a window that look like this: |
+ | {{ : | ||
+ | |||
+ | |||
+ | And we can open the '' | ||
+ | |||
+ | |||
+ | {{ : | ||
+ | |||
+ | As we are opening this file from our home folder on the gateway, when we save it, it will be recorded even after the task finishes. | ||
+ | |||
+ | And now we can see the full reception flowgraph with all its blocks. | ||
+ | You can resize the window, and pan/ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Feel free to take some time to look at the graph to see what it does. | ||
+ | |||
+ | |||
+ | ## Add the gr-bokehgui blocks | ||
+ | |||
+ | We will now add the elements to visualise. | ||
+ | |||
+ | We will add a couple of things: | ||
+ | * A Waterfall to look at the received frequency spectrum | ||
+ | * A Time Sink to look at the received bit sequence | ||
+ | |||
+ | And we will add a couple of widgets to control the receiver' | ||
+ | * A Slider for center frequency | ||
+ | * A slider for gain | ||
+ | |||
+ | You will find the blocks to add in the right side panel containing the block library, in the '' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | You can also type '' | ||
+ | |||
+ | So first, add a Waterfall Sink right at the beginning of the flowgraph, connected to UHD USRP Source block, and fill in its parameters by double clicking on it. The main one to change here is the '' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Now add a '' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | That's it for the plots | ||
+ | |||
+ | We can now add the '' | ||
+ | These can be placed anywhere in the canvas. | ||
+ | Before opening the block' | ||
+ | |||
+ | Now fill in the parameters as follow: | ||
+ | |||
+ | {{ : | ||
+ | {{ : | ||
+ | |||
+ | The very last step before execution is to set the flowgraph' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | You can now press play to run the modified flowgraph. | ||
+ | You will probably encounter this warning window, just ignore it and hit OK: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |||
+ | If you had done these modifications on your own computer, simply hit the '' | ||
+ | And execute it, just like we did in previous tutorial. | ||
+ | |||
+ | |||
+ | ## Visualize your signal | ||
Now that the bokehgui flowgraph is running, you can access the visualization tool available at the following address on your local computer internet browser : | Now that the bokehgui flowgraph is running, you can access the visualization tool available at the following address on your local computer internet browser : | ||
< | < | ||
- | http:// | + | http:// |
</ | </ | ||
- | All time, frequency | + | You should see our two sliders, Waterfall, and an empty Time plot. |
+ | That one is empty because there are no decoded bits as we haven' | ||
- | ## Start the OFDM transmission | + | {{ : |
- | To start the OFDM transmission, | + | You can play with the gain silder to see what that changes. |
+ | |||
+ | Let's now start the transmitter: | ||
< | < | ||
- | username@srvairlock:~$ ssh -p 2222 root@mnode16 | + | # From node 14 |
+ | root@mnode14:~/ / | ||
</ | </ | ||
- | Then you can run the following command | + | You now should see something displayed in the Time Sink, and prints in the console resembling what we had in previous tutorials. If not, make sure you haven' |
+ | |||
+ | {{ : | ||
+ | |||
+ | You may not see much difference in the waterfall display (maybe a line once in a while) because packets are not transmitted very often and there is a high chance the Waterfall display misses them. | ||
+ | To ensure you can see it, you can change | ||
< | < | ||
- | root@mnode16:~# ./examples/my_task/benchmark_tx.py --antenna=" | + | # From node 14 |
+ | root@mnode14:~/ / | ||
</ | </ | ||
- | ## Visualize | + | Note that this will probably flood your console and cause GNU Radio Companion to stop responding. |
- | + | To remedy that, simply stop the transmitter ('' | |
- | You can go back to your browser | + | |
- | {{ :signal_vis.png?600 |}} | + | Feel free to play with the sliders and displays. |
- | ## What's next ? | + | ## Conclusion |
Congratulations, | Congratulations, |
bokehgui_for_cortexlab.1645521708.txt.gz · Last modified: 2022/02/22 10:21 by aparis