Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payload length error when calling NAV ATT message #29

Open
bnlerner opened this issue Dec 11, 2024 · 0 comments
Open

payload length error when calling NAV ATT message #29

bnlerner opened this issue Dec 11, 2024 · 0 comments

Comments

@bnlerner
Copy link

Im seeing a ValueError raised in the ublox_gps module UbloxGps for "The payload length does not match the length implied by the message fields. Expected 32 actual 28". Any idea why this might be?

code

port = serial.Serial("/dev/ttyACM0", baudrate=38400, timeout=1)
gps = UbloxGps(port)


def run() -> None:
    try:
        while True:
            try:
                # Vehicle attitude
                if veh_att := gps.veh_attitude():
                    att_msg = messages.UbloxATTMessage.from_ublox_message(veh_att)
                    print(f"{att_msg=}\n")
                time.sleep(2)
            except (ValueError, IOError) as err:
                print(err)
    finally:
        port.close()


if __name__ == "__main__":
    run()

issue

Dec 11 10:02:13 beachbot-1 python3[6792]:   File "/home/brianlerner/.local/lib/python3.12/site-packages/ublox_gps/ublox_gps.py", line 501, in veh_attitude
Dec 11 10:02:13 beachbot-1 python3[6792]:     return self.request_standard_packet('NAV', 'ATT', wait_time = wait_time)
Dec 11 10:02:13 beachbot-1 python3[6792]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 11 10:02:13 beachbot-1 python3[6792]:   File "/home/brianlerner/.local/lib/python3.12/site-packages/ublox_gps/ublox_gps.py", line 324, in request_standard_packet
Dec 11 10:02:13 beachbot-1 python3[6792]:     raise err[1].with_traceback(err[2])
Dec 11 10:02:13 beachbot-1 python3[6792]:   File "/home/brianlerner/.local/lib/python3.12/site-packages/ublox_gps/ublox_gps.py", line 229, in run_packet_reader
Dec 11 10:02:13 beachbot-1 python3[6792]:     cls_name, msg_name, payload = self.parse_tool.receive_from(self.hard_port, True, True)
Dec 11 10:02:13 beachbot-1 python3[6792]:                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 11 10:02:13 beachbot-1 python3[6792]:   File "/home/brianlerner/.local/lib/python3.12/site-packages/ublox_gps/core.py", line 449, in receive_from
Dec 11 10:02:13 beachbot-1 python3[6792]:     return self.classes[msg_cls].parse(msg_id, buff[4:])
Dec 11 10:02:13 beachbot-1 python3[6792]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 11 10:02:13 beachbot-1 python3[6792]:   File "/home/brianlerner/.local/lib/python3.12/site-packages/ublox_gps/core.py", line 363, in parse
Dec 11 10:02:13 beachbot-1 python3[6792]:     name, nt = self._messages[msg_id].parse(payload)
Dec 11 10:02:13 beachbot-1 python3[6792]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 11 10:02:13 beachbot-1 python3[6792]:   File "/home/brianlerner/.local/lib/python3.12/site-packages/ublox_gps/core.py", line 294, in parse
Dec 11 10:02:13 beachbot-1 python3[6792]:     raise ValueError('The payload length does not match the length implied by the message fields. ' +
Dec 11 10:02:13 beachbot-1 python3[6792]: ValueError: The payload length does not match the length implied by the message fields. Expected 32 actual 28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant