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

simplebgc/gimbal.py 'unpack requires a buffer of 6 bytes' Error #50

Open
goktughamdi opened this issue Sep 14, 2022 · 1 comment
Open

Comments

@goktughamdi
Copy link

Hello, I'm getting this 'unpack requires a buffer of 6 bytes' error while running under Windows for 2.71 Firmware with 3.0 Board Version.

Error;

DEBUG:main:send control cmd: ControlOutCmd(roll_mode=1, pitch_mode=2, yaw_mode=2, roll_speed=0, roll_angle=0, pitch_speed=98, pitch_angle=0, yaw_speed=491,
yaw_angle=0)
DEBUG:main:send message: Message(start_character=62, command_id=67, payload_size=15, header_checksum=82, payload=b'\x01\x02\x02\x00\x00\x00\x00b\x00\x00\x00\xeb\x01\x00\x00', payload_checksum=83)

Traceback (most recent call last):
File "c:\Users\Goktug\Desktop\robot-cameraman-master\simplebgc\gimbal.py", line 102, in
_main()
File "c:\Users\Goktug\Desktop\robot-cameraman-master\simplebgc\gimbal.py", line 88, in _main
gimbal.control(
File "c:\Users\Goktug\Desktop\robot-cameraman-master\simplebgc\gimbal.py", line 64, in control
confirmation: Message = read_message(self._connection, 1)
File "c:\Users\Goktug\Desktop\robot-cameraman-master\simplebgc\serial_example.py", line 55, in read_message
return unpack_message(response_data, payload_size)
File "c:\Users\Goktug\Desktop\robot-cameraman-master\simplebgc\serial_example.py", line 47, in unpack_message
return Message._make(struct.unpack(message_format, data))
struct.error: unpack requires a buffer of 6 bytes

Thank you for sharing your work and library.

@maiermic
Copy link
Owner

Thanks for reporting this error. It should be a duplicate of #26. I have reproduced this error once. Do you get this error consistently? Which gimbal are you using?

Please uncomment line 54 of serial_example.py. I expect a confirmation command after sending a message, but I guess you received a different command that isn't handled properly yet by the library.

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

2 participants