Wednesday, September 1, 2021

Trouble Creating a PMT Vector of Bytes Variable in GRC

Hi, everyone.

I started looking into message passing. I wanted to create a variable of bytes using a PMT. I can create a variable z using:

pmt.init_u8vector(6, [0x00, 0x01, 0x02, 0x03,0x04,0x05])

And my message strobe:

pmt.cons(pmt.PMT_NIL, z)

Which seems to work with my flow graph, giving an output of:

* MESSAGE DEBUG PRINT PDU VERBOSE *
()
pdu_length = 6
contents =
0000: 00 01 02 03 04 05

The problem I am having is when I try something as a variable such as:

pmt.init_u8vector(6, [0xFF, 0x01, 0x02, 0x03,0x04,0x05])

It really messes thing up with GNU Radio Companion (v3.8.2.0, Python 3.6.9) and gives error messages that seem to relate to Unicode characters (below). Is there a way to define a byte array (u8vector) without getting into Unicode character issues?

Thanks.
Jeff

GRC Errors follow:
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 140, in _apply_change
self._update_gui()
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 110, in _update_gui
self.set_tooltip_text(self.param.format_tooltip_text())
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 172, in set_tooltip_text
self._input.set_tooltip_text(text)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 30: surrogates not allowed
Traceback (most recent call last):
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/Application.py", line 557, in _handle_action
flow_graph_update()
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/Application.py", line 133, in flow_graph_update
fg.update()
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/flowgraph.py", line 205, in update
self.create_labels()
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/flowgraph.py", line 508, in create_labels
element.create_labels(cr)
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/block.py", line 174, in create_labels
for param in self.params.values() if (param.hide not in ('all', 'part') or (param.dtype == 'id' and force_show_id))]
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/block.py", line 174, in <listcomp>
for param in self.params.values() if (param.hide not in ('all', 'part') or (param.dtype == 'id' and force_show_id))]
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/canvas/param.py", line 161, in format_block_surface_markup
label=Utils.encode(self.name), value=Utils.encode(self.pretty_print().replace('\n', ' '))
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/Utils.py", line 118, in encode
return GLib.markup_escape_text(valid_utf8)
File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 489, in markup_escape_text
return GLib.markup_escape_text(text, length)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 2: surrogates not allowed
Traceback (most recent call last):
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/VariableEditor.py", line 198, in set_value
self.set_tooltip_text(evaluated)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 2: surrogates not allowed
Traceback (most recent call last):
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/VariableEditor.py", line 198, in set_value
self.set_tooltip_text(evaluated)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 2: surrogates not allowed
Traceback (most recent call last):
File "/usr/local/lib/python3/dist-packages/gnuradio/grc/gui/VariableEditor.py", line 198, in set_value
self.set_tooltip_text(evaluated)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 2: surrogates not allowed

No comments:

Post a Comment