I updated my LoPy to the latest firmware and go the latest nano gateway sources from Pycom from github.
The issue is still there. Gateway is connected well but node is not able to connect to TNN. The join accept messages shown in the TTN console are received but PyMakr console still shows "Not joined".
Can you please fix this issue?
Ah... I think my machine.SOFT_RESET might have had something to do with it. When I hit the reset button on the unit it reloaded and reconnected to my wifi correctly I believe, because I started ntp_sync()ing correctly. Thanks.
I use a WiPy 2. I use Atom on windows. Various firmware revisions in the WiPy.
I found that simple code examples for scanning BLE advertisements crashed after a few minutes to a few hours. Fiddling with gc made a difference, not always good, but did not fix it. The thing locks up.
The cure I found was to scan for 10 seconds. Then when it stops scanning, you can detect that, de-init the module then start it scanning again. That worked very well for 6+ days.
Yours is a different module and a different application etc... worth a try. Stop the BLE then restart it. Just a guess. Hope it works.
I did (with some rearrangements) and it works. I suppose what is important is to specify adr and device_class when defining the LoRa object. Also, when calling the join method, I had not specified dev_eui in the auth parameter which can be (but it should not matter very much).
Thanks @raxy by the way (-;
It's quite off topic but now I have to figure out how to properly use machine.deepsleep() along with LoRaWAN. As waking up from deep sleep resets the board, one has to re-join the LoRaWAN network after every deep sleep interval... Unless there is a way to "keep" the LoRaWAN session active despite a board reset?
I think this may be an error associated with an accumulating number of open sockets.
I got the same OSerror: 23 after running the MQTT example for the 8th time and beyond. A soft reset does not clear this, but powering on/off does clear it - and it works again, at least for the first 7 times.
I fixed this problem by adding one line at the very end of the MQTT example.
@mkbenon You're welcome, I just gave you some hints, glad that you manage yourself (best learning method). :o)
Also please note that MQTT example script changes WLAN antenna mode for external (WLAN.EXT_ANT). If your LoPy setup has the external antenna - that's OK, but if not you should use default internal antenna (WLAN.INT_ANT).