Replies: 1 comment 1 reply
-
This is because MAVLINK_MSG_ID_RADIO_STATUS has uint8_t as type for rssi, but rssi is signed. So need to convert it to unsigned value with sign bit set. So unsigned 128 is equal to -128 import struct
>>> struct.unpack('bbbb', bytes([128, 129, 130, 200]))
(-128, -127, -126, -56) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
When I start my drone, without starting the ground station I wan see the mavlink Message RADIO_STATUS
As you can see the rssi values are set to 128.
I think the problem comes from the line 293 of file wfb-ng/wfb_ng
/server.py
mav_rssi = (max(card_rssi_l) if card_rssi_l else -128) % 256
If I set WFB in debug, I got those 2 lines :
mavlink rx rssi N/A tx#0 {'all': (0, 0), 'all_bytes': (0, 0), 'dec_ok': (0, 0), 'fec_rec': (0, 0), 'lost': (0, 0), 'dec_err': (0, 0), 'bad': (0, 0), 'out': (0, 0), 'out_bytes': (0, 0)} {}
tunnel tx {'fec_timeouts': (0, 0), 'incoming': (0, 8), 'incoming_bytes': (0, 200), 'injected': (0, 23), 'injected_bytes': (0, 1464), 'dropped': (0, 0), 'truncated': (0, 0)} {}
And (-)128 modulo 256 equals 128.
In this case the RSSI should be 0, or a very low value. Putting -256 instead of -128 and we should get 0
mav_rssi = (max(card_rssi_l) if card_rssi_l else -256) % 256
What do you think about ?
Beta Was this translation helpful? Give feedback.
All reactions