Failed to connect to gateway - fault finding steps?
I have a LoPy 1.0 and have, by using Atom 1.21.1 running PyMakr 1.5.1, obtained the LoPy's EUI.
I have set up my LoPy as a device on TheThingsNetwork and obtained the Application Key.
At this point, I have then attempted to connect to a local gateway using OTAA.
using the sample code provided . I have changed EUI and application key to my values.
The Python code runs fine on the LoPy but the device fails to connect to a local gateway (which I know is in range, and resitered on TTN). I get no errors returned, just simply the LoPy fails to connect.
Can anyone recommend a prioritised list of things to check to fault find this issue?
OK I managed to spend a little time this weekend tackling the LORA issue @jmarcelino .
After a bit of travel and lots of outdoor testing I can confirm the issue was gateway related...!
The code you recommended worked fine.
As @jcaron mentioned, if the gateway is indoors you have to be really, really close to get a connection.
As I can't get a connection near my home, I need to either persuade the local gateways to put up an external antenna, or go and buy myself a gateway!!
Many thanks @jmarcelino and @jcaron for your advice.
jcaron last edited by
@philwilkinson How far away are you from the gateway? Are you (and the gateway) indoors or outdoors? What kind of antenna are you using?
I have seen situations where a node next to an open window would be seen by several gateways several kilometres away, but just closing the window would make communication impossible. And the same node would not be seen by another gateway in the same building.
Set simplified AU ISM 915 channel plan for TTN Australia
for index in range(0, 7):
lora.add_channel(index, frequency=916800000+index*200000, dr_min=0, dr_max=3)
Thanks for the advice Jose however this still made no contact with the gateway. I contacted the gateway owner and they confirmed the channels were as per TTN requirements AU915 ttn channels (8-15).
I will try a few more locations that I know have (different) gateway access and see if that resolves anything.
I can start to see why so many people on this forum have purchased single channel gateways! At least you can get them to communicate!
I will keep you up to date with any developments,
jmarcelino last edited by jmarcelino
Ok, it'd be good to get confirmation from the gateway owner. Unfortunately the AU915 plan is still a bit new and not all gateways support it so some owners still use the American US915.
To add to confusion - as in the US - almost all gateways only support listening on 8 channels out of the possible 72.
Can you try a simplified version of his code:
lora = LoRa(mode=LoRa.LORAWAN) # Remove default channels for index in range(0, 72): lora.remove_channel(index) # Set simplified AU ISM 915 channel plan for TTN Australia for index in range(0, 7): lora.add_channel(index, frequency=916800000+index*200000, dr_min=0, dr_max=3) #Join TTN Network via OTAA lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
of course adding your keys before this code and the
while not lora.has_joined()after it.
With this code running check the TTN console under your application data to see if you get any activation requests.
Thanks for responding @jmarcelino. I am not sure of how to confirm the gateway's frequencies but I have just contacted the closest gateway owner directly to confirm.
In any case, in addition to the standard US out of the box frequencies, I have tried to run some code suggested to reconfigure the frequencies for Australian networks however this still does not allow me to connect to a local gateway.
I think you may have helped Leo in Adelaide, Australia tackle the same issue before! Please can you have a quick review of his published Python code and see if you think it is suitable.
jmarcelino last edited by jmarcelino
I see you’re in Australia, do you know which frequencies your gateway is configured to?
You’ll probably need to remove the frequencies configured by default on the LoPy and use LoRa.add_channel to set the ones you actually use.