Skip to content

Implement "reliable Datagram mode" #42

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

Merged
merged 8 commits into from
May 1, 2020
Merged

Implement "reliable Datagram mode" #42

merged 8 commits into from
May 1, 2020

Conversation

jerryneedell
Copy link
Contributor

Implemented compatibility with the RadioHead library "Reliable DataGram" mode. see #34 .
Received packets ar "ACKed" and Transmitted packets wait for ACK response.

It has been difficult to make this work reliably. Packets will still be missed occasionally but now they will be reported. There are attributes that can be "tweaked" to help

rfm9x.ack_delay -- set a delay before the ACK packet is sent - this is necessary when the receive unit an MCU communication to a Raspberry Pi . The MCU can send it's ACK packet before the Raspberry Pi has resumed "listening". The default setting is "None" but setting it to .1 seconds may be necessary. The Arduino RadioHead library does not allow for this "ack_delay" and it it may be difficult to get this to work, especially with a Raspberry Pi.

rfm9x.retries -- set the number of ack retries

All of the existing examples will still execute without change.

There are "breaking changes" for anyone that had been setting the RadioHead headers directly.
There are now attributes for setting the header parameters and the rx_filter parameter for the receive function has been removed.

There are examples for using this mode in rfm9x_node1_ack.py and rfm9x_node2_ack.py

other new examples
rfm9x_header.py -- receive packets and display the header and packet contents
rfm9x_node1.py -- uses adresses without ACK
rfm9x_node2.py -- companion to rfm9x_node1.py
rfm9x_rpi_simpletest.py - no LED and set pins for RaspBerry Pi
rfm9x_node1_bonnet.py -- similar to rfm9x_node1.py but for use with RPi and bonnet -- uses buttons to sent packets

the changes are very similar to adafruit/Adafruit_CircuitPython_RFM69#24 and hopefully many lessons learned were applied

@jerryneedell jerryneedell requested review from brentru and a team April 13, 2020 13:36
Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jerryneedell looks good!

@FoamyGuy
Copy link
Contributor

FoamyGuy commented Apr 22, 2020

I've got a pair of RFM95 Featherwings ordered from Digikey on the way. I can test this PR with them once they arrive if it's helpful, hopefully within the next few days.

@jerryneedell
Copy link
Contributor Author

I've got a pair of RFM95 Featherwings ordered from Digikey on the way. I can test this PR with them once they arrive if it's helpful, hopefully within the next few days.

Great! I’ll wait for your testing before merging. No rush.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully with 2x RFM9x Featherwing using the node1 / node2 example scripts and their ack variants.

@jerryneedell jerryneedell merged commit 6485df1 into adafruit:master May 1, 2020
@jerryneedell jerryneedell deleted the jerryn_ack branch May 1, 2020 09:34
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants