computenodes / dragino

LoRaWAN implementation in python
GNU Affero General Public License v3.0
27 stars 11 forks source link

dio_mapping needs to be reset in join() #16

Closed BNNorman closed 3 years ago

BNNorman commented 3 years ago

on_tx_done() sets the dio_mapping to [0, 0, 0, 0, 0,0]

When the join() function is called a second time the dio_mapping is not setup and the tx_done interrupt does not happen hence the radio isn't put into RXCONT mode.

When I add the following line before the switch to transmit mode the tx_done interrupt works just fine.

self.set_dio_mapping([1, 0, 0, 0, 0 , 0])

With my dev RasPi I have to retry joins at different SFs and frequencies because I'm 11km away from a gateway and my device isn't always seen by the gateway using SF7. Often it is SF8 or 9 and it varies from test to test.

I'm still not getting the join_accept reply but that's another issue relating to RX1 and RX2 windows, which I'm working to resolve.

pjb304 commented 3 years ago

Unfortunately I can't test your situation easily because I get the join accept replies easily, but I've made the requested change to the main code.