@jmarcelino thanks for the clear explanation.
It would be really useful if you could put this small section of code on the Getting Started section of Pycom's LoPy documentation for those who are connecting to TTN; the most popular LoRa network in Australia/New Zealand region. I will try and post something in The Things Network Australia Community page too.
If you would prefer, I can raise it through GitHub, but I suspect your ability to change the Pycom documentation is much quicker!
thanks again for your help Jose.
Also, I really enjoyed your talk on The Things Network conference