-
Notifications
You must be signed in to change notification settings - Fork 26
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
CRSF frame parsing timeout repeatedly expires thus dropping all frames #108
Comments
While I'm here, is it necessary to run the rc channels callback upon parsing a frame with a different frame type such as a telemetry frame? Likewise for link statistics. |
Increasing the timeout here may fix the issue but is the timeout necessary? |
Oh gods, you have my intrusive thoughts in a nutshell, here. 😆 The time-out is calculated based on the number of possible size of CRSF packets (which is 64 bytes), the number of packets that are expected to be received, and the baud rate. Removing the time-out altogether may fix your Issue. However, without the timeout, CRSF for Arduino will have no way of knowing the time difference between each byte received. This could create more issues than what your issue is trying to solve, here. It's more likely that my implementation of the time-out could do with a re-factor, as it was derived from Betaflight's implementation, and it's more likely that calling it in the context of the main
If you expand that function, you will see the calculation I am using: timePerFrame = ((1000000 * packetCount) / (baudRate / (CRSF_FRAME_SIZE_MAX - 1))) Punch that into your calculator with If you set the
What do you mean by this? Could you elaborate on this a little more? |
Each invocation of
If the received frame is If this change is made, the failsafe flag may need to be moved as it only relies on link statistics data. |
Interesting. 🤔 |
Is there an existing issue for this bug?
What development environment are you using?
PlatformIO
What board are you using?
Raspberry Pi Pico RP2040
What part of CRSF for Arduino is this bug related to?
RC Channels
Current behaviour
When I set up the library to get rc channel data, the callback will run but the channel data never changes.
I only encounter this issue when my Pi Pico is connected to the Adafruit PiCowbell CAN Bus.
Expected behaviour
The rc data should update as normal.
Steps to reproduce
I'm unsure how to reproduce this issue without the mentioned hardware.
Additional information
Removing the following lines fixes the issue.
CRSFforArduino/src/SerialReceiver/CRSF/CRSF.cpp
Lines 78 to 87 in 26952d5
framePosition
to be reset to 0 mid-way through parsing a frame and thus the CRC check will fail.The text was updated successfully, but these errors were encountered: