The things network



  • Are all TTN gateways public access? I'm trying to join a device to the TTN here in Windsor NSW Australia. The only gateway in the district belongs to Sydney Water. I can see activity for my device on the TTN webpage each time it tries to join but it never happens & I'm wondering if that's because the gateway is for Sydney Water only?



  • @jcaron I tried another lopy4 & got some metadata
    ttnmeta.jpg
    it doesn't indicate if a join accept was sent but seems to show 3 gateways?

    The really weird thing is I terminated the program

    from network import LoRa
    import time, binascii, pycom
    pycom.heartbeat(False)
    pycom.rgbled(0x7f0000) #red
    app_eui = binascii.unhexlify('70B3D57ED00363A8')
    app_key = binascii.unhexlify('757CC90FE2A05ACA33C6FE8376F8DBD2')
    lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AS923, public=1,  adr=0, tx_retries=0)
    lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
    while not lora.has_joined():
        pycom.rgbled(0x7f7f00) #yellow
        time.sleep(5)
        print('Trying to join TTN Network!')
    print('Network joined!')
    pycom.rgbled(0x007f00) #green
    
    

    or at least I thought I did (it was no longer printing 'Trying to join TTN Network!' but weirdly join requests kept appearing on the console every 37s. Code like that, beavering away in the background transmitting RF with no indication of what it is up to, terrifies me!



  • @kjm Ah, sorry, it looks like on TTN you only see the details in the gateway logs rather than the device logs, which doesn’t help you much here (don’t have a setup on TTN to confirm this at this time, though).

    But the fact the activation is associated with the device should mean an accept is sent back. So back to square one, either the settings of the node are off, or it’s just a bit too far to receive it.



  • @jcaron Join request in the logs but nothing else, no rssi, no hint if a join accept was sent. None of the buttons do anything (except 'activation' which sends the screen blank), so opaque!
    ttn.jpg



  • @kjm in the TTN console, you should be able to lookup packets received from/sent to your device, including join requests and accepts. IIRC packets received from your device, including join requests, should show at least the RSSI.

    If the join accepts or requests do not show up in the logs then you probably have an issue with EUIs.



  • @kjm Looks like the bandplan in AU is AS1
    Uplink:
    923.2 - SF7BW125 to SF12BW125
    923.4 - SF7BW125 to SF12BW125
    922.2 - SF7BW125 to SF12BW125
    922.4 - SF7BW125 to SF12BW125
    922.6 - SF7BW125 to SF12BW125
    922.8 - SF7BW125 to SF12BW125
    923.0 - SF7BW125 to SF12BW125
    922.0 - SF7BW125 to SF12BW125
    922.1 - SF7BW250
    921.8 - FSK
    Downlink:
    Uplink channels 1-10 (RX1)
    923.2 - SF10BW125 (RX2)

    Is there a way I can find out if

    region=LoRa.AS923
    

    is, in fact, implementing those frequencies?



  • @kjm Still can't figure out how to get a join accept from this

    “eui-00800000a0004dc1”:{“id”:“eui-00800000a0004dc1”,“description”:“SydneyWater - Meshed - South Windsor - AS923”,“owner”:“maj”,“owners”:[“maj”], “location”:“latitude”:-33.62514114379883, “longitude”:150.80197143554688, “altitude”:66},“country_code”:“au”,“attributes”:{“brand”:“MultiTech”, “frequency_plan”:“AS_920_923”,“model”:“Conduit”,“placement”:“outdoor”},“last_seen”:“2020-10-12T22:12:54Z”

    gateway here in Australia. The join requests are making it to TTN server but the lopy4 never gets an accept. According to https://www.thethingsnetwork.org/docs/lorawan/frequency-plans.html AS_920_923 is actually 2 plans 'AS1' & 'AS2'. My working hypothesis is that the gateway is sending the join accept but the lopy4 (release='1.18.2.r1') is listening on the wrong frequency or group of frequencies to receive it.

    I'm a bit unsure how to proceed. Is there some change I could make to the lopy code

    from network import LoRa
    import time, binascii, pycom
    pycom.heartbeat(False) 
    pycom.rgbled(0x7f0000) #red
    app_eui = binascii.unhexlify('70B3D57ED00363A8')
    app_key = binascii.unhexlify('C77C32E59D88FC0222169AB62F4D74D7')
    lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AS923, public=1,  adr=0, tx_retries=0)
    lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
    while not lora.has_joined():
        pycom.rgbled(0x7f7f00) #yellow
        time.sleep(5)
        print('Trying to join TTN Network!')
    print('Network joined!')
    pycom.rgbled(0x007f00) #green
    

    to increase my chances of getting a join accept?



  • @jcaron I'm not sure how to get RSSI for a join request. I've only ever seen lora.stats used after an s.receive(64), which is further down in the program after a successful join request & some data has been sent.

    I don't see any hint of a join accept being sent in the logs. Every time the lopy4 tries to join all I get on the console is a time, dev addr, app eui & dev eui



  • @kjm what RSSI and SNR levels do you see on the join request? Do you see the join accept being sent in the logs?

    Remember that RF links are not necessarily symmetric, especially when you have different equipment at both ends, due to variations in TX power, sensitivity, noise, etc. If you are close to the edge, it could very well work in one direction and not the other.

    There are several possible reasons for the join to fail in this case (as we know the gateway receives the request):

    • The network does not send an accept at all;
    • The node is not listening for the accept with the right settings (not the right time, not the right frequency, not the right data rate);
    • The node cannot receive the accept because the link budget is exceeded (the signal is too weak).

    The last one is probably the easiest to debug, so I would start by taking the node and moving it to a location where I know for sure it can receive the accept (I.e. with line of sight to the gateway). If you succeed, then it’s definitely an RF problem at the original location. If you don’t, you can start looking into the other ones.

    Alternatively, screenshots of the TTN logs may be helpful to try to find other issues.



  • I've got the lopy4 set to the AS923 the gateway is using with a decent 5dB external antenna. I've got a hunch the problem is not RF related because the activation shows on the TTN console the instant the lopy4 sends. I've doubled checked the app_eui & app_key are correct for OTAA but no lora.has_joined() for this little black duck.



  • @kjm normally all gateways on TTN are open to all, that’s the whole goal of TTN.

    Have you checked that your device settings match the TTN frequency plan for your region? Are you trying indoors or outdoors? How far away is the gateway? Do you have line of sight? What kind of antenna do you have? What details do TTN give about the gateway (indoors/outdoors, antenna...)?

    It is perfectly possible that the gateway “hears” your device but not the other way around. Try to bring your node to a place where you have direct line of sight to the gateway to be sure the settings are correct, after that it’s just a matter of link budget.


Log in to reply
 

Pycom on Twitter