Add SLCAN ACK/NACK auto-detection support#87
Open
Bwooce wants to merge 3 commits intodronecan:masterfrom
Open
Conversation
Author
|
Hmm, let me test this more. I appear to be flooding the bus in dronecan_gui, so something has changed in a negative way. |
Author
|
Right, #88 is a pre-requisite to avoid flooding the bus. |
0db9c0f to
2a1f5cf
Compare
Author
|
Tested and working well for me on a DSDTECH SH-C30A on macOS using DroneCAN GUI. I've tried to avoid any AI slop appearing in here, and I've manually tested quite a bit against ArduPilot. |
There was a problem where CANable (canable.io) adaptors do not support ACK/NACK responses. This has been a known issue since 2019 (normaldotcom/canable-fw#8) and remains unresolved and unavailable in the prebuilt firmwares. This change: - Auto-detects if adapter supports ACK/NACK responses using invalid 'X' command on init. No response = not supported, NACK = supported. - Implements length-based message parsing for adapters without ACK/NACK. This probably should apply regardless as all messages have a known size, but let's not upset the applecart. - Maintains backward compatibility with existing adapters - Adds robust message framing that handles concatenated messages properly - Stores ACK/NACK support state in memory for device lifetime This resolves the issue of dronecan gui not working with off-the-shelf canable.io adapters, especially the combination of non-linux use where candlelight firmware (gs_usb) is not supported under macos and the only alternative is canable firmware, which...doesn't support ACK/NACK. tested with: - Single messages with/without data - Multiple concatenated messages - Partial messages (incomplete reads) - Messages with timestamps - Extended CAN frames - CAN-FD frames
- Remove artificial delays, rely on natural serial backpressure - Improve RetrySerial to preserve ACK/NACK detection state - Add cleaner debug logging controls - Compatible with adapters that don't support ACK/NACK confirmations
The periodic scheduler was referencing callback_running but never defining it, causing NameError when GUI tries to spin the node. Added missing variable initialization to prevent callback overlap.
e6b77fa to
03f209a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Technical Details