User Tools

Site Tools


bokehgui_for_cortexlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
bokehgui_for_cortexlab [2025/05/16 16:39] cmorinbokehgui_for_cortexlab [2025/05/16 16:59] (current) cmorin
Line 115: Line 115:
 You can also type ''Ctrl+F'' and type to search a block name You can also type ''Ctrl+F'' and type to search a block name
  
-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 ''placement'' param to specify where the plot will appear in the browser.+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 ''placement'' param to specify where the plot will appear in the browser. 
  
 {{ :remote_grc_waterfall_params.png?600 |}} {{ :remote_grc_waterfall_params.png?600 |}}
  
-Now add a Time Sink at the end, +Now add a ''Time Sink'' at the end, following a ''Char to float'' to convert the sample types to one that can be displayed.
  
 {{ :remote_grc_time_sink_params.png?600 |}} {{ :remote_grc_time_sink_params.png?600 |}}
  
 +That's it for the plots
  
 +We can now add the ''Sliders'' to play with some of the parameters during execution
 +These can be placed anywhere in the canvas.
 +Before opening the block's parameters, make sure to disable the ''freq'' and ''gain'' Parameter blocks at the top by right clicking on them and selecting Disable.
  
 +Now fill in the parameters as follow:
  
 {{ :remote_grc_freq_slider.png?600 |}} {{ :remote_grc_freq_slider.png?600 |}}
 {{ :remote_grc_gain_slider_params.png?600 |}} {{ :remote_grc_gain_slider_params.png?600 |}}
 +
 +The very last step before execution is to set the flowgraph's option to use Bokeh GUI, for that open the ''Options'' block at the top left corner, and select ''Bokeh GUI'':
  
 {{ :remote_grc_options.png?300 |}} {{ :remote_grc_options.png?300 |}}
 +
 +You can now press play to run the modified flowgraph. 
 +You will probably encounter this warning window, just ignore it and hit OK:
  
 {{ :xterm_warning.png?200 |}} {{ :xterm_warning.png?200 |}}
  
  
 +If you had done these modifications on your own computer, simply hit the ''Generate'' button, just left to the Play button to generate a python script to execute and [copy it with scp](https://www.cortexlab.fr/doku.php?id=exp_upload) on airlock. 
 +And execute it, just like we did in previous tutorial.
  
-{{ :bokeh_browser_no_signal.png?600 |}} 
  
 +## Visualize your signal 
  
-<code> +Now that the bokehgui flowgraph is running, you can access the visualization tool available at the following address on your local computer internet browser :
-# From node 14 +
-root@mnode14:~/ /cortexlab/homes/[username]/Tutorials/Tuto_3/examples/ofdm_benchmark/ofdm_tx_example.py -g 15 -b 4 -r 1000000 -f 1350000000 +
-</code> +
-{{ :bokeh_browser_w_signal.png?600 |}}+
  
 <code> <code>
-# From node 14 +http://localhost:5006/bokehgui
-root@mnode14:~/ /cortexlab/homes/[username]/Tutorials/Tuto_3/examples/ofdm_benchmark/ofdm_tx_example.py -g 15 -b 4 -r 1000000 -f 1350000000 -t 0.001+
 </code> </code>
  
 +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't started the transmitter.
  
-On the node, you will find two files, the GRC flowgraph and the python executable of the project+{{ :bokeh_browser_no_signal.png?600 |}}
  
-{{ :grc_flowgraph_bokehgui.png?600 |}}  +You can play with the gain silder to see what that changes.
  
-You can ran the python executable with the following command +Let's now start the transmitter:
  
 <code> <code>
-root@mnode17:~# ./cxlb_bokehgui.py+# From node 14 
 +root@mnode14:~/ /cortexlab/homes/[username]/Tutorials/Tuto_3/examples/ofdm_benchmark/ofdm_tx_example.py -g 15 -b 4 -r 1000000 -f 1350000000
 </code> </code>
  
-**Remarq** : The sample rate is set at 35kHz by default but can be modified by updating the python file using ''apt''. The same procedure can be used to change the default frequency and gain +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't changed the frequency slider.
  
 +{{ :bokeh_browser_w_signal.png?600 |}}
  
-Now that the bokehgui flowgraph is running, you can access the visualization tool available at the following address on your local computer internet browser :+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 the transmission period to something like 1ms using the ''-t'' option:
  
 <code> <code>
-http://localhost:5006/bokehgui?bokeh-session-id=cxlb_bokehgui+# From node 14 
 +root@mnode14:~/ /cortexlab/homes/[username]/Tutorials/Tuto_3/examples/ofdm_benchmark/ofdm_tx_example.py -g 15 -b 4 -r 1000000 -f 1350000000 -t 0.001
 </code> </code>
  
-All time, frequency and waterfall visualization tool are now up and runningHowever, they are just displaying noise at this time.  +Note that this will probably flood your console and cause GNU Radio Companion to stop responding
- +To remedy thatsimply stop the transmitter (''Ctrl+C''and wait bit for prints to stop.
-## Start the OFDM transmission  +
- +
-To start the OFDM transmissionyou can access the OFDM node from airlock as follow : +
- +
-<code> +
-username@srvairlock:~$ ssh -p 2222 root@mnode16 +
-</code> +
- +
-Then you can run the following command to start the OFDM transmitter flowgraph :  +
- +
-<code> +
-root@mnode16:~#  ./examples/my_task/benchmark_tx.py --antenna="TX/RX" --tx-amplitude=0.2 -v -W 2M -f 2.49G +
-</code> +
- +
-## Visualize your signal  +
- +
-You can go back to your browser and have look at your signal.+
  
-{{ :signal_vis.png?600 |}}+Feel free to play with the sliders and displays.
  
-## What's next ?+## Conclusion
  
 Congratulations, you can now visualize any signal transmitted within the CorteXlab platform ! Feel free to replace the OFDM transmission with your project... Congratulations, you can now visualize any signal transmitted within the CorteXlab platform ! Feel free to replace the OFDM transmission with your project...
bokehgui_for_cortexlab.1747406343.txt.gz · Last modified: 2025/05/16 16:39 by cmorin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki