Skip to content
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

port RF24Mesh #29

Closed
2bndy5 opened this issue Jul 1, 2021 · 5 comments · Fixed by #33
Closed

port RF24Mesh #29

2bndy5 opened this issue Jul 1, 2021 · 5 comments · Fixed by #33
Labels
enhancement New feature or request

Comments

@2bndy5
Copy link
Member

2bndy5 commented Jul 1, 2021

Work is being done on the rf24-network branch to port the Arduino/Linux library RF24Mesh for CircuitPython. testing this module will also satisfy some of the testing objectives set fourth in #28

I do plan on using CircuitPython's nvm module to store the addresses assigned by the master node... This is because write-access to the CircuitPython filesystem is prohibited by default.

@2bndy5 2bndy5 changed the title port Rf24Mesh port RF24Mesh Jul 1, 2021
@2bndy5
Copy link
Member Author

2bndy5 commented Jul 10, 2021

@TMRh20 I'm having trouble getting this lib's mesh node receiving the address response message (type 128) from your lib's mesh master. I believe its because Circuitpython is so much slower than your C++ lib; I suspect the radio (with CirPy) isn't switching from TX to RX mode fast enough (& the message type 128 doesn't take advantage of the radio's auto-retries).

I noticed you recently commented out a pre-existing delay(2) in this commit. I was wondering if you'd be open to adding it back in conditionally with a macro like SLOW_ADDRESS_RESPONSE (or maybe PATIENCE_FOR_RETARD_CHILD_NODES 😆 ).

@TMRh20
Copy link
Member

TMRh20 commented Jul 10, 2021 via email

@2bndy5 2bndy5 added the enhancement New feature or request label Jul 13, 2021
@2bndy5
Copy link
Member Author

2bndy5 commented Jul 18, 2021

I just confirmed the RF24Mesh master node's code works (no saving/loading DHCP dict to/from NVM as yet).

I have been able to get RF24Mesh child nodes (running on RP2040 MCU) to connect to C++ RF24Mesh master node (running on RPi), but it seems unreliable... I think printing all the debug stuff to stdout significantly slows everything down (and CirPy is already the slowest). RF24Mesh on RPi (using this lib not the C++ lib) works much better as a child node when most debug output is removed, but that's using SpiDev python C-extension for faster SPI transactions (which is also faster than CirPy on my RP2040 board).

@2bndy5
Copy link
Member Author

2bndy5 commented Jul 27, 2021

@TMRh20 I added a commit that introduces the new macro SLOW_ADDR_POLL_RESPONSE in RF24Network (& subsequently used in RF24Mesh). It seems to help when the macro is set to add a 12 millisecond delay on responses to ADDR_REQUEST and NETWORK_POLL to MULTICAST_ADDR scenarios. By default, this macro doesn't affect normal builds; it needs to be defined by the user in RF24Network_config.h:

#define SLOW_ADDR_POLL_RESPONSE 12

I am still looking for ways to improve the speed of my lib here, but I'm running out of ideas. I even use the mandatory 130 us delay time to write RX pipe0 address when entering RX mode (CE pin is set HIGH).

@TMRh20
Copy link
Member

TMRh20 commented Jul 28, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants