UBC-Solar / sunlink

UBC Solar's radio and cellular-based telemetry system
MIT License
3 stars 1 forks source link

Fixed IMU parse fails using chunking #78

Closed AarjavJain101 closed 5 months ago

AarjavJain101 commented 5 months ago

Previously we had IMU parse fails due to sunlink unable to keep up with messages coming in. We confirmed this by checking the raw UART stream coming to my comuter's port and noticed that all messages were indeed sent and sunlink could not get all the messages because it was too slow.

To fix this, I implemented a simple chunking method where we read 512 bytes from the stream at a time (variable and can be adjusted. See next steps). Once the chunk is received, it is extracted for the messages inside it which are then sent to the parser.

To verify this algorithm I ran it with a load of 1926 bytes per second (78 imu messages and 3 GPS messages ran in their respect tasks instead of the normal 13 and 1) and it got all the data except the last 13 or so messages which could have still been in the 512 byte chunk (cannot access this until the full amount is read). Quantitatively, 614/623 lines were received where all lines before line 616 matched the SD log.

Downside:

Specific Changes:

Next Steps: