Coder Social home page Coder Social logo

gnuradio / gr-bokehgui Goto Github PK

View Code? Open in Web Editor NEW
77.0 7.0 24.0 760 KB

Web based display for GNU Radio applications

License: GNU General Public License v3.0

CMake 6.78% C 26.72% Python 32.12% C++ 33.20% Shell 0.14% TypeScript 1.04%
gnuradio bokeh hacktoberfest

gr-bokehgui's Introduction

How to run the Qt version of GRC

  • Make sure PyQt5 (including QtSvg and QtWebEngine) is installed.
  • pip install QDarkStyle qtpy
  • pip install pytest-qt pyautogui (only required for testing)
  • build and install as usual
  • Run gnuradio-companion --qt

Make Test Version AUR Docs Packaging status

GNU Radio is a free & open-source software development toolkit that provides signal processing blocks to implement software radios. It can be used with readily-available, low-cost external RF hardware to create software-defined radios, or without hardware in a simulation-like environment. It is widely used in hobbyist, academic, and commercial environments to support both wireless communications research and real-world radio systems.

Please visit the GNU Radio website at https://www.gnuradio.org/ and the wiki at https://wiki.gnuradio.org/. Bugs and feature requests are tracked on GitHub's Issue Tracker. If you have questions about GNU Radio, please search the discuss-gnuradio mailing list archive, as many questions have already been asked and answered. Please also subscribe to the mailing list and post your new questions there.

How to Install GNU Radio

Prebuilt Binaries

The recommended way to install GNU Radio on most platforms is using available binary package distributions.

The following command is for Debian, Ubuntu, and derivatives. Consult your distribution information to obtain the version of GNU Radio which is included.

sudo apt install gnuradio

For other operating systems and versions, see Quick Start

Ubuntu PPA Installation

For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs (Personal Package Archives) on launchpad.net. Be sure to uninstall any previously installed versions of gnuradio first. See UnInstallGR.

Other Installation Methods

Platform-specific guides and Cross-platform guides are described in Other Installation Methods.

From Source

Complete instructions for building GNU Radio from source code are detailed in Installing From Source.

PyBOMBS

We are no longer recommending PyBOMBS to install modern versions of GNU Radio.

Legal Matters

Some files have been changed many times throughout the years. Copyright notices at the top of source files list which years changes have been made. For some files, changes have occurred in many consecutive years. These files may often have the format of a year range (e.g., "2006 - 2011"), which indicates that these files have had copyrightable changes made during each year in the range, inclusive.

gr-bokehgui's People

Contributors

777arc avatar gvardakis avatar kkpatel1 avatar mimbert avatar notou avatar nowinnovation avatar quentinmit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gr-bokehgui's Issues

Choppy waterfall display

There appears to be a ~1px chop in the waterfall chunks being displayed.

Versions:
python: 3.10
node: 14.19.3-deb-1nodesource1
bokeh: 2.4.3
tornado: 6.1
gr-bokehgui: master (2be3889)
gnuradio: 3.10.1.1-2

Please note: This issue was present in 3.8 and the maint-3.8 branch as well

image

Changing the center frequency in waterfall does not work

When changing the center frequency in the waterfall plot (e.g. by using a bokeh_slider) the plot does not update to reflect the correct frequency scale on x-axis. When doing the same with the frequency sink this works fine.

why did not work but I did everything. it will be good if he had a good setup guide but

Generating: '/home/hp/gr-bokehgui/examples/tutorial.py'

Executing: /usr/bin/python2 -u /home/hp/gr-bokehgui/examples/tutorial.py

2018-06-27 17:46:42,699 Starting Bokeh server version 0.13.0 (running on Tornado 5.0.2)
2018-06-27 17:46:42,699 Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly
2018-06-27 17:46:42,701 Bokeh app running at: http://localhost:5007/bokehgui
2018-06-27 17:46:42,701 Starting Bokeh server with process id: 4025
2018-06-27 17:46:43,526 101 GET /bokehgui/ws?bokeh-protocol-version=1.0&bokeh-session-id=tutorial (127.0.0.1) 0.30ms
2018-06-27 17:46:43,526 WebSocket connection opened
2018-06-27 17:46:43,527 ServerConnection created
Traceback (most recent call last):
File "/home/hp/gr-bokehgui/examples/tutorial.py", line 268, in
main()
File "/home/hp/gr-bokehgui/examples/tutorial.py", line 253, in main
tb = top_block_cls(doc)
File "/home/hp/gr-bokehgui/examples/tutorial.py", line 106, in init
legend_list = legend_list)
File "/usr/local/lib/python2.7/dist-packages/bokehgui/time_sink_f.py", line 65, in initialize
x_axis_type = x_axis_type)
File "/home/hp/.local/lib/python2.7/site-packages/bokeh/plotting/figure.py", line 964, in figure
return Figure(**kwargs)
File "/home/hp/.local/lib/python2.7/site-packages/bokeh/plotting/figure.py", line 156, in init
tool_objs, tool_map = _process_tools_arg(self, opts.tools, opts.tooltips)
File "/home/hp/.local/lib/python2.7/site-packages/bokeh/plotting/helpers.py", line 529, in _process_tools_arg
tool_obj = _tool_from_string(tool)
File "/home/hp/.local/lib/python2.7/site-packages/bokeh/plotting/helpers.py", line 472, in _tool_from_string
raise ValueError("unexpected tool name '%s', %s tools are %s" % (name, text, nice_join(matches)))
ValueError: unexpected tool name 'resize', similar tools are reset

Done (return code 1)

Update period does not update

The update period in the different sinks does not update when this parameter is updated during runtime. It does not seem like this parameter has a callback in .grc. Would be nice for networks with long delays etc.

Frequency sink plot can't show in mobile web client

I run my simple bokehgui frequency sink without widget. It appears on desktop web client but failed to appear on mobile web client. I have added allow_websocket_origin=['*'] to Server in bokehgui/utils.py.

I have tried to modify bokehgui/utils.py by added an example from bokeh repository in make_doc(doc) function, and it can appears on mobile web cilent.

So what can I do to make bokehgui frequency sink appears on mobile web client?

Thanks in advance.

Refreshing page causes endless loop and crashes

I have tried multiple versions of this library, and they all have a problem when multiple windows are open (or a page is refreshed).
This makes it impossible to serve a gnuradio for multiple clients which was a big use case for us.

Versions:
python: 3.10
node: 14.19.3-deb-1nodesource1
bokeh: 2.4.3
tornado: 6.1
gr-bokehgui: master (2be3889)
gnuradio: 3.10.1.1-2

Please note: This issue was present in 3.8 and the maint-3.8 branch as well

Error Message:

ERROR:bokeh.util.tornado:Error thrown from periodic callback:
ERROR:bokeh.util.tornado:Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 526, in callback
    result_list.append(f.result())
  File "/usr/local/lib/python3.10/dist-packages/bokeh/server/session.py", line 95, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/server/session.py", line 229, in with_document_locked
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 450, in wrapper
    return invoke_with_curdoc(doc, invoke)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 449, in invoke
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bokehgui/waterfall_sink_c.py", line 89, in callback
    self.update( )
  File "/usr/local/lib/python3.10/dist-packages/bokehgui/waterfall_sink_c.py", line 105, in update
    self.waterfall_renderer[i].latest = list(output_items[i])
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/has_props.py", line 230, in __setattr__
    return super().__setattr__(name, value)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/property/descriptors.py", line 285, in __set__
    self._set(obj, old, value, setter=setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/property/descriptors.py", line 559, in _set
    self._trigger(obj, old, value, hint=hint, setter=setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/property/descriptors.py", line 637, in _trigger
    obj.trigger(self.name, old, value, hint, setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/model/model.py", line 567, in trigger
    super().trigger(descriptor.name, old, new, hint=hint, setter=setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/util/callback_manager.py", line 194, in trigger
    self.document.callbacks.notify_change(cast(Model, self), attr, old, new, hint, setter, invoke)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 236, in notify_change
    self.trigger_on_change(event)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 378, in trigger_on_change
    invoke_with_curdoc(doc, invoke_callbacks)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 377, in invoke_callbacks
    cb(event)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 263, in <lambda>
    self._change_callbacks[receiver] = lambda event: event.dispatch(receiver)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/events.py", line 400, in dispatch
    super().dispatch(receiver)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/events.py", line 223, in dispatch
    cast(DocumentPatchedMixin, receiver)._document_patched(self)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/server/session.py", line 247, in _document_patched
    raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes")
RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

ERROR:bokeh.util.tornado:Error thrown from periodic callback:
ERROR:bokeh.util.tornado:Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 526, in callback
    result_list.append(f.result())
  File "/usr/local/lib/python3.10/dist-packages/bokeh/server/session.py", line 95, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/server/session.py", line 229, in with_document_locked
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 450, in wrapper
    return invoke_with_curdoc(doc, invoke)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 449, in invoke
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bokehgui/waterfall_sink_c.py", line 89, in callback
    self.update( )
  File "/usr/local/lib/python3.10/dist-packages/bokehgui/waterfall_sink_c.py", line 105, in update
    self.waterfall_renderer[i].latest = list(output_items[i])
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/has_props.py", line 230, in __setattr__
    return super().__setattr__(name, value)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/property/descriptors.py", line 285, in __set__
    self._set(obj, old, value, setter=setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/property/descriptors.py", line 559, in _set
    self._trigger(obj, old, value, hint=hint, setter=setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/core/property/descriptors.py", line 637, in _trigger
    obj.trigger(self.name, old, value, hint, setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/model/model.py", line 567, in trigger
    super().trigger(descriptor.name, old, new, hint=hint, setter=setter)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/util/callback_manager.py", line 194, in trigger
    self.document.callbacks.notify_change(cast(Model, self), attr, old, new, hint, setter, invoke)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 236, in notify_change
    self.trigger_on_change(event)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 378, in trigger_on_change
    invoke_with_curdoc(doc, invoke_callbacks)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 377, in invoke_callbacks
    cb(event)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/callbacks.py", line 263, in <lambda>
    self._change_callbacks[receiver] = lambda event: event.dispatch(receiver)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/events.py", line 400, in dispatch
    super().dispatch(receiver)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/document/events.py", line 223, in dispatch
    cast(DocumentPatchedMixin, receiver)._document_patched(self)
  File "/usr/local/lib/python3.10/dist-packages/bokeh/server/session.py", line 247, in _document_patched
    raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes")
RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

Windows port

Dear Kartik,
My windows gnu radio distribution (3.7.12.0) has Bokeh GUI enabled. Unfortunately I can not install the Bokeh blocks from gr-bokeh. Can you please add compiled windows binaries to your distribution.

Attribute Error

Hi, I installed the gr-bokehgui from the source code in the branch maint-3.8 and followed all the instructions, but when I run the flowgraph I have this error in the console
Traceback (most recent call last):
File "/home/gnuradio/gr-bokehgui/examples/tutorial.py", line 245, in
main()
File "/home/gnuradio/gr-bokehgui/examples/tutorial.py", line 213, in main
serverProc, port = bokehgui.utils.create_server()
AttributeError: module 'bokehgui.utils' has no attribute 'create_server'

Also, the make test fails at the fourth test, the qa_freq_sink_c test with error 8

possible dependency issues between bokeh 1.4->nodejs->python3?

Hi,
Could you please provide guidance on the dependency versions for bokeh to support GNURadio maint-3.8?
Since the project has been pinned at bokeh v1.4 for a while (which seems old) i think it would be nice to have some documentation that supports the install process for bokeh and it's dependencies, especially on a newer build like Ubuntu18.04LTS with GNURadio 3.8.
I'd be happy to write up the install docs for you once i get it working.
I've had this working in the past on GNURadio 3.7.14.0 with python 2.7 and i remember quite a few issues finding the right nodejs version.
so far I've installed the following:
gr-bokehgui from source (git branch maint-3.8)
bokeh 1.4 (via pip3)
nodejs - i've tried the current Ubuntu apt repo version which is 8.x, removed that, and now i'm on v6.10.1 per STDOUT errors when no version of nodejs is installed. This should match the bokeh 1.4 dependencies.

The server starts when i run the examples, however the issue i'm facing is when i conect to the server from my web browser i get this error:
Executing: /usr/bin/python3.6 -u /home/muaddib/prefix/gr38/src/gr-bokehgui/examples/test_bokehgui.py

2021-03-07 11:59:55,213 Starting Bokeh server version 1.4.0 (running on Tornado 6.1)
2021-03-07 11:59:55,213 Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly
2021-03-07 11:59:55,214 User authentication hooks NOT provided (default user enabled)
2021-03-07 11:59:55,216 Bokeh app running at: http://localhost:5006/bokehgui
2021-03-07 11:59:55,216 Starting Bokeh server with process id: 10335
2021-03-07 11:59:55,960 WebSocket connection opened
2021-03-07 11:59:55,962 ServerConnection created
BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead
BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead
BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead
BokehDeprecationWarning: ClientSession.loop_until_closed is deprecated, and will be removed in an eventual 2.0 release. Run Bokeh applications directly on a Bokeh server instead. See:

https//docs.bokeh.org/en/latest/docs/user_guide/server.html

2021-03-07 12:00:00,307 Uncaught exception GET /bokehgui (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:5006', method='GET', uri='/bokehgui', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/muaddib/.local/lib/python3.6/site-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/home/muaddib/.local/lib/python3.6/site-packages/tornado/gen.py", line 775, in run
yielded = self.gen.send(value)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/server/views/doc_handler.py", line 61, in get
template_variables=session.document.template_variables)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/embed/server.py", line 227, in server_html_page_for_session
bundle = bundle_for_objs_and_resources(None, resources)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/embed/bundle.py", line 184, in bundle_for_objs_and_resources
ext = bundle_models(models)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/util/compiler.py", line 338, in bundle_models
_bundle_cache[key] = bundle = _bundle_models(custom_models)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/util/compiler.py", line 551, in _bundle_models
custom_impls = _compile_models(custom_models)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/util/compiler.py", line 528, in _compile_models
compiled = nodejs_compile(impl.code, lang=impl.lang, file=impl.file)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/util/compiler.py", line 111, in nodejs_compile
output = _run_nodejs([compilejs_script], dict(code=code, lang=lang, file=file, bokehjs_dir=bokehjs_dir))
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/util/compiler.py", line 475, in _run_nodejs
return _run(_nodejs_path(), argv, input)
File "/home/muaddib/.local/lib/python3.6/site-packages/bokeh/util/compiler.py", line 470, in _run
raise RuntimeError(errout.decode('utf-8'))
RuntimeError: /home/muaddib/.local/lib/python3.6/site-packages/bokeh/server/static/js/compiler.js:271423
async remove(item) {
^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)

2021-03-07 12:00:00,309 500 GET /bokehgui (127.0.0.1) 480.29ms

Any help would be much appreciated!

GrSwig missing in during cmake

I am new to the cmake thing, so this may be a silly question. when I run the cmake, it shows the error below

CMake Error at swig/CMakeLists.txt:37 (include):
  include could not find load file:

    GrSwig


CMake Error at swig/CMakeLists.txt:51 (GR_SWIG_MAKE):
  Unknown CMake command "GR_SWIG_MAKE".

-- Configuring incomplete, errors occurred!

after googling it, it appears that the cmake/Modules/GrSwig.cmake is missing. but what can I do?
thank you

scripts/start-server.sh missing?

I'm getting an error at bokehgui.utils.create_server() and it looks like it's trying to run /scripts/start-server.sh which I don't see in the scripts directory (I only see check-port.sh).

ss is replacing netstat

On newer linux distro's the netstat command is being replaced with the ss command. This breaks the check-port.sh script currently used.

Recommend doing something like this to support both netstat and ss commands for bokeh port discovery.

# Use netstat if available, else try ss command
if ! command -v netstat &> /dev/null
then
	ss -netul | awk '{ print $5 }' | awk -F':' '{ print $NF }' | tail -n +3 > temp_netstat
else
	netstat -netul | awk '{ print $4 }' | awk -F':' '{ print $NF }' | tail -n +3 > temp_netstat
fi

Add "GUI Tab Widget"

It will be amazing to add "GUI Tab Widget" (compared to QT GUI Tab Widget) to this packet to simplify control more complicated systems.

AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no attribute 'plot_lst'

Hello,

I get the AttributeError with bokehgui when I run the following flowgraph in gnuradio-3.10 in a docker container from the m1mbert/cxlb-gnuradio-3.10.

Screenshot from 2022-10-12 06-13-05

The complete console output is

<<< Welcome to GNU Radio Companion 3.10.3.0 >>>

Block paths:
	/cortexlab/toolchains/current/share/gnuradio/grc/blocks

Generating: '/root/testing_bokehgui.py'

Executing: /usr/bin/python3 -u /root/testing_bokehgui.py

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Traceback (most recent call last):
  File "/root/testing_bokehgui.py", line 207, in <module>
    main()
  File "/root/testing_bokehgui.py", line 185, in main
    tb = top_block_cls()
  File "/root/testing_bokehgui.py", line 90, in __init__
    self.bokehgui_waterfall_sink_x_0_plot = bokehgui.waterfall_sink_c(self.plot_lst, self.bokehgui_waterfall_sink_x_0, update_time = 100,
  File "/cortexlab/toolchains/current/lib/python3.9/site-packages/gnuradio/gr/hier_block2.py", line 88, in __getattr__
    return getattr(self._impl, name)
AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no attribute 'plot_lst'

>>> Done (return code 1)

Operation relies on deprecated event loop

The updating of the plots uses a bokeh client event loop, in the form of the session.loop_until_closed() function.
But this function is deprecated in bokeh 1.x and removed in 2.x, so we will need to find a way to stop using it if we want to use up to date dependencies.

This is a change with a lot of implication but that is necessary to continue going forward.

Current operation:

  1. The bokeh server is started in command line in a external server with an empty document (blank page)
  2. The top block initialisation fills up a separate document with all the wanted plots, widgets, layouts and callbacks.
  3. A session is created programatically by connecting to the running server and set to use the previously created document.
  4. session.loop_until_closed() is used to serve the callbacks (mainly updates to the plots data)

This means that, currently, the proper document is shown for just one named session, that it why, if you connect to a running server and use the wrong id in ?bokeh-session-id= or forget it entirely, you get a blank page without errors.

An event loop is needed to handle callbacks to update the plots and react to user input on the widgets; session.loop_until_closed() was the only way to run one outside of the bokeh server and I don't want to have to run the graph running bokeh serve, so we will have to run the bokeh server inside our top block process.

Proper bokeh operation is actually quite far from what is done right now so we will need substantial changes in the way documents are created and handled.
Documents consist mainly of a layout (a list of gui elements) and a callback list. The documents cannot be directly copied, the layout can only be transferred between documents but cannot be in more than one at once and the callback list does not move.
We need a function that will be able to create a new document when called and be called multiple times (so it cannot be the init() of the top block). It will also probably need to create new widget and plot objects every time (not possible to store a list).

All the changes should not impact the user much but it should allow for a simpler connection to the server. But they will necessitate a lot of changes on the gnuradio side of things. I would like to try a keep these modifications as small as possible.

Gui config

Hello.
Can't find bokhe gui in dropdown menu
Screenshot 2023-01-11 at 21 12 19

Fails to compile on Mac OS X, can't find a numpy header file

When building on Mac OS X, the build system fails to find a numpy header:

[ 73%] Building CXX object swig/CMakeFiles/_bokehgui_swig.dir/bokehgui_swigPYTHON_wrap.cxx.o
/Users/mettus/gr-bokehgui/build/swig/bokehgui_swigPYTHON_wrap.cxx:4421:10: fatal error:
'numpy/arrayobject.h' file not found
#include <numpy/arrayobject.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [swig/CMakeFiles/_bokehgui_swig.dir/bokehgui_swigPYTHON_wrap.cxx.o] Error 1
make[1]: *** [swig/CMakeFiles/_bokehgui_swig.dir/all] Error 2
make: *** [all] Error 2

The actual location is /usr/local/lib/python2.7/site-packages/numpy/core/include but cmake isn't adding that to the compiler search path for some reason.

Need maint-3.8 branch

Since the API on master has diverged (and will continue to do so), a separate branch for maint-3.8 needs to be maintained

AttributeError: 'test_bokehgui' object has no attribute 'widget_lst'

i got some error due to running gr-bokehgui,

here is the errors
Traceback (most recent call last):
File "/home/brawijaya/Documents/Documents-Thinkpad/Project/Research/GRC/plugins/gr-bokehgui/examples/./test_bokehgui.py", line 578, in
main()
File "/home/brawijaya/Documents/Documents-Thinkpad/Project/Research/GRC/plugins/gr-bokehgui/examples/./test_bokehgui.py", line 556, in main
tb = top_block_cls()
^^^^^^^^^^^^^^^
File "/home/brawijaya/Documents/Documents-Thinkpad/Project/Research/GRC/plugins/gr-bokehgui/examples/./test_bokehgui.py", line 82, in init
self.signal_amp_slider = bokehgui.slider(self.widget_lst, 'Signal Amplitude' +":", 0, 10, 0.01, 10, 10.0)
^^^^^^^^^^^^^^^
AttributeError: 'test_bokehgui' object has no attribute 'widget_lst'

any suggestion for fixing this problem? thank you

Gui freezing in supplied example

The gui randomly stops working when executing examples/test_bokehgui.grc.

Error message is:
2017-10-27 10:51:27,108 error handling message Message 'PATCH-DOC' (revision 1): KeyError('references',) 2017-10-27 10:51:27,175 Bad header with no msgtype was: {u'references': [], u'events': [{u'new': u'5.82', u'model': {u'type': u'TextInput', u'id': u'06003215-eba3-4186-b43f-5785170b4e23'}, u'kind': u'ModelChanged', u'attr': u'value'}]} 2017-10-27 10:51:27,176 Bokeh Server protocol error: No 'msgtype' in header, closing connection

This happens after a few seconds and only when using the sliders.

It seems this has to do with the function_probe block and the Bokeh Gui Label block. Changing a slider that does not affect the Gui Label does not trigger the crash.

AttributeError: module 'bokehgui' has no attribute 'BokehLayout'

I see the following behavior on both the maint-3.8 and master branches from running bokehgui example

dragon@dragon:~/Desktop/myoot/gr-bokehgui/examples$ python3 tutorial.py
2021-05-12 22:31:19,153 Starting Bokeh server version 1.4.0 (running on Tornado 4.5.1)
2021-05-12 22:31:19,154 Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly
2021-05-12 22:31:19,154 User authentication hooks NOT provided (default user enabled)
2021-05-12 22:31:19,155 Bokeh app running at: http://localhost:5006/bokehgui
2021-05-12 22:31:19,156 Starting Bokeh server with process id: 4484
2021-05-12 22:31:19,857 WebSocket connection opened
2021-05-12 22:31:19,858 ServerConnection created
BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead
BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead
Traceback (most recent call last):
File "tutorial.py", line 241, in
main()
File "tutorial.py", line 226, in main
tb = top_block_cls(doc)
File "tutorial.py", line 157, in init
input_t = bokehgui.BokehLayout.widgetbox(self.widget_lst)
AttributeError: module 'bokehgui' has no attribute 'BokehLayout'
swig/python detected a memory leak of type 'gr::fft::window::win_type *', no destructor found.

Not run on Gnuradio

Hello,
I have get this message cold you help please..

Loading: "/home/hp/Desktop/gr-bokehgui-develop_PR/examples/test_time_sink.grc"

Done

Generating: '/home/hp/Desktop/gr-bokehgui-develop_PR/examples/test_time_sink.py'

Executing: /usr/bin/python -u /home/hp/Desktop/gr-bokehgui-develop_PR/examples/test_time_sink.py

Traceback (most recent call last):
File "/home/hp/Desktop/gr-bokehgui-develop_PR/examples/test_time_sink.py", line 247, in
main()
File "/home/hp/Desktop/gr-bokehgui-develop_PR/examples/test_time_sink.py", line 235, in main
tb = top_block_cls()
File "/home/hp/Desktop/gr-bokehgui-develop_PR/examples/test_time_sink.py", line 71, in init
self.bokehgui_time_sink_x_1_plot = bokehgui.time_sink_f(
AttributeError: 'module' object has no attribute 'time_sink_f'

The url to see the visualisation is not obvious

Some people get confused and don't know what to type in their address bar.
When working with multiple graphs, thing can get confusing with the mix of various URLs.

At least we need to clearly document what to type related to the id of the graph and if possible, directly print the full address at startup.

Will not build on master due to latest changes affecting OOTs

/share/gnuradio/grdev/src/gr-bokehgui/lib/time_sink_c_proc_impl.cc: In static member function ‘static gr::bokehgui::time_sink_c_proc::sptr gr::bokehgui::time_sink_c_proc::make(int, double, const string&, int)’:
/share/gnuradio/grdev/src/gr-bokehgui/lib/time_sink_c_proc_impl.cc:38:9: error: could not convert ‘gnuradio::get_initial_sptr(T*) [with T = gr::bokehgui::time_sink_c_proc_impl]()’ from ‘std::shared_ptr<gr::bokehgui::time_sink_c_proc_impl>’ to ‘gr::bokehgui::time_sink_c_proc::sptr’ {aka ‘boost::shared_ptr<gr::bokehgui::time_sink_c_proc>’}
   37 |       return gnuradio::get_initial_sptr
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~
   38 |         (new time_sink_c_proc_impl(size, samp_rate, name, nconnections));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         |
      |         std::shared_ptr<gr::bokehgui::time_sink_c_proc_impl>

Changes to get OOT compatible with 3.9 (current master) should be documented here:
https://wiki.gnuradio.org/index.php/GNU_Radio_3.9_OOT_Module_Porting_Guide

AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no attribute 'doc'

GNU Radio version 3.9.5.0, Python 3.8.10. gr-bokehgui from main. Everything appears to build just fine but none of the bokehgui modules will run. I tried to short circuit this in hier_block2.py but then get an error about not calling __init__ in a derived class. I'm going to try to downgrade to GR 3.8 but it's so incredibly old, and I already downgraded from GR 3.10 to try to find compatibility.

Bokeh-Gui Flowgraph without bokeh elements crash

Pretty low priority bug:

If u have any "Generate Options: Bokeh GUI" flowgraph with no remaining bokeh gui elements (eg. all disabled), the whole flowgraph will not run anymore:

NameError: global name 'bokehgui' is not defined

Unable to serve bokeh document

I see the following behavior on both the maint-3.8 and master branches from running test_bokehgui example

Are there steps that I am missing?

josh@josh-clean1910:/share/gnuradio/gr38/src/gr-bokehgui$ /usr/bin/python3 /home/josh/.vscode/extensions/ms-python.python-2020.3.71659/pythonFiles/lib/python/debugpy/wheels/debugpy/launcher /share/gnuradio/gr38/src/gr-bokehgui/examples/test_bokehgui.py 
2020-06-01 10:55:32,217 Starting Bokeh server version 1.4.0 (running on Tornado 5.1.1)
2020-06-01 10:55:32,218 Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly
2020-06-01 10:55:32,218 User authentication hooks NOT provided (default user enabled)
2020-06-01 10:55:32,219 Bokeh app running at: http://localhost:5007/bokehgui
2020-06-01 10:55:32,219 Starting Bokeh server with process id: 28275
2020-06-01 10:55:46,541 WebSocket connection opened
2020-06-01 10:55:46,541 Uncaught exception GET /bokehgui/ws (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:5007', method='GET', uri='/bokehgui/ws', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tornado/websocket.py", line 546, in _run_callback
    result = callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/bokeh/server/views/ws.py", line 122, in open
    raise ProtocolError("No bokeh-protocol-version specified")
ProtocolError: No bokeh-protocol-version specified
2020-06-01 10:55:46,542 WebSocket connection closed: code=None, reason=None
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/josh/.vscode/extensions/ms-python.python-2020.3.71659/pythonFiles/lib/python/debugpy/wheels/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/home/josh/.vscode/extensions/ms-python.python-2020.3.71659/pythonFiles/lib/python/debugpy/wheels/debugpy/../debugpy/server/cli.py", line 429, in main
    run()
  File "/home/josh/.vscode/extensions/ms-python.python-2020.3.71659/pythonFiles/lib/python/debugpy/wheels/debugpy/../debugpy/server/cli.py", line 266, in run_file
    runpy.run_path(options.target, run_name=compat.force_str("__main__"))
  File "/usr/lib/python3.7/runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/share/gnuradio/gr38/src/gr-bokehgui/examples/test_bokehgui.py", line 251, in <module>
    main()
  File "/share/gnuradio/gr38/src/gr-bokehgui/examples/test_bokehgui.py", line 232, in main
    url = "http://localhost:" + port + "/bokehgui")
  File "/usr/local/lib/python3.7/dist-packages/bokeh/client/session.py", line 163, in push_session
    session.push(document)
  File "/usr/local/lib/python3.7/dist-packages/bokeh/client/session.py", line 386, in push
    raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)")
OSError: Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)

Assertion len placement failed

I got this when inserting bokeeh gui sinks block on gnuradio

Assertion "len(placement) == 4 or len(placement) == 2" failed.

Running with gr-bokehgui branch maint 3.8 and gnuradio 3.8 from ppa (gnuradio 3.8.2.0)

Thanks for any help!

Does not support Bokeh 3

I recommend updating the Readme to clarify that Bokeh 3 is not supported.

Running it with Bokeh 2.4.3 works. It prints the following:

BokehDeprecationWarning: 'WidgetBox' is deprecated and will be removed in Bokeh 3.0, use 'bokeh.models.Column' instead

tutorial.grc displayed unsuccessfully on the web page ("SyntaxError: Unexpected identifier")

When I run the tutorial.grc file in example, it can't run successfully and it shows : "500: Internal Server Error" on the web page

Here is log :

RuntimeError: /home/csygnu/.local/lib/python3.6/site-packages/bokeh/server/static/js/compiler.js:271423
async remove(item) {
^^^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

2020-10-18 16:11:29,555 500 GET /bokehgui?bokeh-session-id=tutorial (127.0.0.1) 633.53ms
2020-10-18 16:11:29,660 404 GET /favicon.ico (127.0.0.1) 0.37ms
Exiting the simulation. Stopping Bokeh Server

Done

Bokeh GUI Widgets haven't "placement" field.

Environment:

  • GNU Radio Companion version 3.10.4.0 (Python 3.8.10)

All "Bokeh GUI Sinks" (at GNU Radio Companion) have field "placement" for set position of this component on website. Unfortunately, all "Bokeh GUI Widgets" (like button or textbox), haven't this field so it's impossible to correct locate it on webpage. They are all located in placement (1,0) is sequence of added it to flowgraph. Is there any way to control position of this Widgets?

installing gr-bokehgui from pybombs fails

when trying to install gr-bokehgui by pybombs i encountered two problems, both were easily hand-fixed locally:

  • in gr-recipes within your gr-bokehgui.lwr recipe the repository is given as https://github.com/gnuradio/gr-bokehgui but that does not exist => I cloned directly from here, then things continued
  • the Gui does not start with the bokeh version installed by default by the recipe => explicitly replacing them by the bokeh version 0.12.6 made things work

Widget value does not update

It seems that for instance GUI Label does not update its field when changed during runtime. I have a variable from one my blocks that I pull with function probe and I would like to display it in the browser, for instance with GUI Label.

Add a BER sink

To be equal in features with QtGui, we are missing a BER plot.

The new vector sink could be a good starting point for that.
I might even allow for a hierarchical block to do the job.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.