I tried to register two listening-nodes with openReadingPipe().
This raised an "Invalid Address Lenght"-error, even though registering multiple listening-nodes should be possible.
The error is raised in line 625 of the nrf24.py:
def openReadingPipe(self, pipe, address):
if pipe >= 6:
raise RuntimeError("Invalid pipe number")
if (pipe >= 2 and len(address) > 1) or len(address) > 5:
raise RuntimeError("Invalid adress length") # -> Error occurs here
The if-condition here prevents any openReadingPipe(2, ..) till openReadinPipe(5, ...).
But why? In maniacbugs original NRF24-library there is no such restriction
void RF24::openReadingPipe(uint8_t child, uint64_t address)
{
if (child == 0){
memcpy(pipe0_reading_address,&address,addr_width);
}
if (child <= 6)
{
if ( child < 2 )
write_register(pgm_read_byte(&child_pipe[child]), reinterpret_cast<const uint8_t*>(&address), addr_width);
//--------------- Here is the Relevant Line:
else
write_register(pgm_read_byte(&child_pipe[child]), reinterpret_cast<const uint8_t*>(&address), 1);
write_register(pgm_read_byte(&child_payload_size[child]),payload_size);
write_register(EN_RXADDR,read_register(EN_RXADDR) | _BV(pgm_read_byte(&child_pipe_enable[child])));
}
}
Hi,
I tried to register two listening-nodes with openReadingPipe(). This raised an "Invalid Address Lenght"-error, even though registering multiple listening-nodes should be possible.
The error is raised in line 625 of the nrf24.py:
The if-condition here prevents any openReadingPipe(2, ..) till openReadinPipe(5, ...). But why? In maniacbugs original NRF24-library there is no such restriction
Is there a reason for your restriction?