CircuitPython_nRF24L01 icon indicating copy to clipboard operation
CircuitPython_nRF24L01 copied to clipboard

Network improvements

Open 2bndy5 opened this issue 1 year ago • 2 comments

This ports changes from the following recent PRs to the pure python codebase:

  • nRF24/RF24Network#227
  • nRF24/RF24Mesh#238
  • nRF24/RF24Mesh#240
  • nRF24/RF24Mesh#244
  • nRF24/RF24#955
  • nRF24/RF24Mesh#250

2bndy5 avatar Jun 08 '24 15:06 2bndy5

Codecov Report

Attention: Patch coverage is 25.49020% with 38 lines in your changes missing coverage. Please review.

Project coverage is 86.27%. Comparing base (fc69216) to head (065dd07). Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
circuitpython_nrf24l01/rf24_mesh.py 18.18% 36 Missing :warning:
circuitpython_nrf24l01/rf24.py 0.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage   86.68%   86.27%   -0.42%     
==========================================
  Files          16       16              
  Lines        2463     2484      +21     
==========================================
+ Hits         2135     2143       +8     
- Misses        328      341      +13     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 08 '24 15:06 codecov[bot]

I think the bug fixed in nRF24/RF24Network#229 is specific to the C++ implementation. Looking at the _write_to_pipe(), I forgot how much code gulf I played to speed things up.

There is no RF24Network.networkFlags here because

  • message fragmentation is done directly in _write_to_pipe() (making FLAG_FAST_FRAG obsolete)
  • FLAG_NO_PULL is implemented as _parenthood, even though there is no RF24Gateway/Ethernet implementation in this CirPy port

Furthermore, the network layers here don''t use a writefast() equivalent. Instead, I use a regular blocking write() (RF24.send()) and call RF24Network._tx_standby() which uses RF24.resend() similarly to how C++ RF24::txStandBy() uses RF24::reUseTx() but in a blocking manner.

2bndy5 avatar Jun 17 '24 20:06 2bndy5