Closed TMRh20 closed 1 month ago
I prefer option 2 since it is consistent with using RF24Network::begin()
. There's also a deprecated RF24Network::begin(uint8_t _channel, uint16_t _node_address)
which I neglected to remove when releasing v2.0. So, I think we're a bit overdue for some breaking changes.
I seem to remember a rejected PR (#210) about this that instigated changing RF24::begin()
so that the PA level was not altered every time it was called. Looking at RF24::_init_radio()
, I see https://github.com/nRF24/RF24/commit/8ad2886b846375fca5cfcda74da784d3452d9148 in the git blame.
Hmm, I had a feeling you'd prefer option 2 :laughing:
I didn't realize this was fixed at the RF24 level. I guess the change isn't really required then?
I guess the change isn't really required then?
At a glance, no. Did you recently have some troubling experience that you attributed to this?
Heh, the troubling experience was always adjusting my code to set the PALevel AFTER starting the mesh and again if mesh.begin() was called, which I see is not necessary anymore.
I was suspecting an ebyte module; they don't seem to respect the user-specified PA level.
So this one has been bugging me for a while, the problem is that
begin()
functionradio.begin()
in that function which resets the PA Level toRF24_PA_MAX
https://github.com/nRF24/RF24Mesh/blob/7827e87a01c2de1d63db5f040a981f681b2eada1/RF24Mesh.cpp#L26-L36In the examples for example, the PA Level is set prior to calling
mesh.begin()
, but this will just be undone by the call toradio.begin()
withinmesh.begin()
https://github.com/nRF24/RF24Mesh/blob/7827e87a01c2de1d63db5f040a981f681b2eada1/examples/RF24Mesh_Example/RF24Mesh_Example.ino#L49-L69I see one of 3 scenarios:
begin()
function, so it can set the PA Level after callingradio.begin()
radio.begin()
from RF24Mesh. This adds a some more complications, as it essentially changes the API, requiring users to callradio.begin()
prior to everymesh.begin()
call.mesh.begin()
I kind of prefer option 1, but would prefer option 2 if it wasn't breaking existing code.
If we choose option one, should the default be PA_MIN or PA_MAX ?