-
Notifications
You must be signed in to change notification settings - Fork 164
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
Fragmentation problem between RPi and Arduino #88
Comments
I think this may be related to the same issue that I am currently facing. I have a raspberry pi (address 00) interfacing with an Arduino Mega 2560 (address 01). I am able to send a message from the pi to the arduino once without problems, however, subsequent transmissions result in fragments out of order. Any messages sent from the Arduino to the Pi are sent without issue. See debug outputs below: First message received without problems
Subsequent messages:
|
Per #88 When receiving fragmented payloads, padding was not being added to the frame on non-linux devices, but subtracted during reads. - Remove padding altogether from AVR devices (#defined ARDUINO_ARCH_AVR) - Add padding to received, fragmented payloads on non-AVR, non-Linux devices (for 32-bit devices like ESP8266) May have affected nRF24/RF24Mesh#71
@adarazs @dan8551 Thanks for the code example and info. Can you please update on Arduino and test with the latest update Padding was being added for compatibility with 32-bit devices, but with fragmented payloads that don't work out evenly it was not padded. I removed that altogether for AVR devices, and fixed it for others. |
@TMRh20 So far so good. It looks like everything works with fragmented payloads now. Thank you for the quick response and fix! \o/ |
Hi @TMRh20,
I'm using your libraries (RF24+RF24Network+RF24Mesh) since about 1.5 years heavily in my home automation project and it worked flawlessly. Awesome work, thank you! I used a checkout from 2015-07-01 from all libs (Development branch from RF24Network - c88ccdc) until now, but I recently pulled the new commits and my system developed a bad issue.
The problem occurs when I'm sending more than 1 package worth of data from my RPi2 to an Arduino node. When package fragmentation occurs, the client crashes/prints gibberish on the serial console, etc. Completely unpredictable behavior.
I'm quite unfamiliar still with the library to debug the problem myself, but I found a way to reproduce it by slightly modifying the examples in the repo:
The Arduino rx side needs the same changes, adding
char msg[50];
to the struct and printing it out after receiving.If I change
msg[50]
tomsg[2]
, everything works perfectly and I can send as much package as I want without trouble. Withmsg[50]
(or anything above 1 package worth) results in the Arduino (receiver node) freezing/restarting.Here's a serial output from the Arduino: https://gist.github.com/adarazs/b8dc782c9dd5e5077873518b4e3e0e06#file-gistfile1-txt-L47
You can see that it badly identifies the length, then the sketch restarts after line 48 and then it completely freeze up after the last line in the log. But the way it dies differs every time.
I tried with multiple Arduinos and multiple radios (I use the black small ones from ebay).
Please let me know how I can help to debug the issue some more.
The text was updated successfully, but these errors were encountered: