Skip to content

CFG-VALSET exception for X-types #204

Description

@krisgry

CFG-VALSET exception for X-types

Describe the bug
In the ubx config window, I'm trying to set type X* values (at least X2 and X8), but I get the following error in the terminal. I have tried to valget and simply valset the same value, but it still fails.

Version 1.6.9

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
    return self.func(*args)
  File "/home/krisgry/.local/pipx/venvs/pygpsclient/lib/python3.10/site-packages/pygpsclient/ubx_cfgval_frame.py", line 312, in _on_send_config
    self._do_valset()
  File "/home/krisgry/.local/pipx/venvs/pygpsclient/lib/python3.10/site-packages/pygpsclient/ubx_cfgval_frame.py", line 375, in _do_valset
    msg = UBXMessage.config_set(layers, transaction, cfgData)
  File "/home/krisgry/.local/pipx/venvs/pygpsclient/lib/python3.10/site-packages/pyubx2/ubxmessage.py", line 758, in config_set
    valb = val2bytes(val, att)
  File "/home/krisgry/.local/pipx/venvs/pygpsclient/lib/python3.10/site-packages/pyubx2/ubxhelpers.py", line 610, in val2bytes
    raise TypeError(
TypeError: Attribute type X002 value bytearray(b'\x00\x00') must be <class 'bytes'>, not <class 'bytearray'>

Another side-bug is that the checkmark in the window, that should indicate successful set of the variable, persists from the get command, so from the GUI it seems like the command succeeded. Perhaps you could clear the checkmark when the arrow is clicked?

To Reproduce

One example:
In the ubx config menu

  1. find CFG_SBAS_ACCEPT_NOT_IN_PRNMASK, hit CFG-VALGET and the arrow. This returns 0000 in the text field.
  2. click CFG-VALSET (keeping the 0000 in the text box), and the arrow.
  3. the above error message is displayed in the terminal where I launched pygpsclient

Expected Behaviour

  1. ability to set binary/hex values using VALSET
  2. the "success" checkmark next to the arrow should be cleared when the arrow is clicked, so that

Desktop (please complete the following information):

ubuntu 22.04. USB connection.

GNSS/GPS Device (please complete the following information as best you can):

  • Device Model/Generation: ublox x20p
  • Firmware Version: [e.g. HPG 2.00]
  • Protocol: [e.g. 50.02]

Additional context

Side question: to set a hex value with CFG-VALSET, I need to convert the values in the ubx interface description to little endian, right? E.g. if I want to set the LSB of CFG-SBAS-PRNSCANMASK (type X8), I would enter 0x0100000000000000, not 0x0000000000000001 as shown in the interface description. Right?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions