Cannot make join OTAA timely with pygate and lopy4



  • Hello,
    I have pygate configured for US915 SF7 BW125Khz using TTN
    trying to connect with lopy4 with OTAA. While all the packages from join request sent successfully to TTN but somehow cannot join because pygate kept telling to ignore the packages :

    "Ignore : not rejected, push ack out of sync"

    any idea how to fix this ?

    thanks


  • Global Moderator

    Another addition I want to make:
    I have been working on different frequency plans and found this: https://github.com/TheThingsNetwork/gateway-conf. I believe the frequency plan you want to use for the Pygate is in here as well. You can copy it directly and add the following items at the bottom:

    		"gateway_ID": "XXXX",
    		"keepalive_interval": 10,
    		"stat_interval": 30,
    		"push_timeout_ms": 100,
    		"forward_crc_valid": true,
    		"forward_crc_error": false,
    		"forward_crc_disabled": false
    

    Let me know if that works better for you!
    Gijs


  • Global Moderator

    Hi,
    I did some further testing, and when I set the gateway: (still using your config.json)
    Screenshot 2020-08-06 at 10.54.33.png
    And the node lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AS923)
    I still get this in the gateway logs:

    [3271253746] lorapf: INFO_ jitqueue: Current concentrator tv_sec=312 time_us=312437126, pkt_type=0, packet->count_us=313388266, (c-t)=951140/951140 us = 0/0 s
    [3271253749] lorapf: WARN_ jitqueue: IGNORED: not REJECTED, already too late to send it (current=312437126, packet=313388266, type=0)
    

    But it does work for me:
    Screenshot 2020-08-06 at 10.55.55.png

    And in the node:

    Not yet joined...
    Not yet joined...
    Not yet joined...
    Joined
    b''
    

    Screenshot 2020-08-06 at 10.58.11.png
    (sorry for the time difference, I lost the data of the first tries)

    To further clarify my setup
    Gateway + Fipy (or Lopy 4, I tried both) at 1.20.2.rc10 [pygate]
    Expansion board + Lopy 1 (or 4, I tried both) at 1.20.2.rc10 [pybytes]

    It does still send at 923.2 and 923.4, and I cannot get it to work reliably (eg. gateway not receiving my packets) at 922 MHz on US915, sorry about that..



  • @Gijs you got it right !
    Although on my side the configuration is rather AS923 for gateway and US915 for nodes (lopy4) the same thing happened.

    Actually the reason I did that configuration because I want to be able to comply my country's regulation regarding LPWAN, our allocated frequency is 920-923.

    If I use AS923 on gateway it can map to 922 center frequency but node configuration AS923 cannot goto 922Mhz always run into 923 even if I customize channel for it. So I changed node frequency plan to US915 and successfully got center frequency 922Mhz.

    The final result as you've replicated is gateway always out of sync and BW comes to 500 instead of 125Khz !

    Can we ask for help on fixing this ?


  • Global Moderator

    Hi,
    Finally after some testing I am able to reproduce the issue! I marked my steps:

    • Set your config.json file and upload
    • In TTN, set the settings as such:
      Screenshot 2020-08-05 at 15.11.03.png
    • On your Lopy4, use the following join setting
      lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.AS923)

    Then, the Gateway console will look like so:
    Screenshot 2020-08-05 at 15.12.22.png
    And the Pygate output as following

    ##### END #####
    [3200146439] lorapf: WARN_ [up  ] ignored out-of sync PUSH_ACK packet buff_ack[0:14] != token[0:15]
    [3200146489] lorapf: WARN_ [up  ] PUSH_ACK recieve timeout 1
    [3200161694] lorapf: INFO_ [up  ] received pkt from mote: D00128D2 (fcnt=46037/B3D5), RSSI -71.0
    [3200161749] lorapf: WARN_ [up  ] PUSH_ACK recieve timeout 0
    [3200161799] lorapf: WARN_ [up  ] PUSH_ACK recieve timeout 1
    [3200168431] lorapf: INFO_ jitqueue: Current concentrator tv_sec=265 time_us=265167165, pkt_type=0, packet->count_us=264389241, (c-t)=4294189372/-777924 us = 4294/4294 s
    [3200168435] lorapf: WARN_ jitqueue: IGNORED: not REJECTED, already too late to send it (current=265167165, packet=264389241, type=0)
    [3200176391] lorapf: INFO_ [main] report
    ##### 2020-08-05 13:10:43 GMT #####
    ### [UPSTREAM] ###
    # RF packets received by concentrator: 1
    # CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
    # RF packets forwarded: 1 (23 bytes)
    # PUSH_DATA datagrams sent: 2 (318 bytes)
    # PUSH_DATA acknowledged: 0.00%
    ### [DOWNSTREAM] ###
    # PULL_DATA sent: 3 (100.00% acknowledged)
    # PULL_RESP(onse) datagrams received: 1 (190 bytes)
    # RF packets sent to concentrator: 0 (17 bytes)
    # TX errors: 0
    # TX rejected (collision packet): 0.00% (req:4, rej:0)
    # TX rejected (collision beacon): 0.00% (req:4, rej:0)
    # TX rejected (too late): 0.00% (req:4, rej:0)
    # TX rejected (too early): 0.00% (req:4, rej:0)
    ### [JIT] ###
    [jit] queue contains 3 packets:
    [jit] queue contains 0 beacons:
     - node[0]: count_us=94441308 - type=0
     - node[1]: count_us=227248233 - type=0
     - node[2]: count_us=264389241 - type=0
    ### [GPS] ###
    # GPS sync is disabled
    ##### END #####
    

    Now I cannot wrap my head around why it works like this, but I guess your setup is quite unique and not completely according to standards :)
    (Also I am not completely sure of the other settings, it just did not work for me using different settings but we've been having some WiFi problems today, so that could be it as well)

    Let me know if I am correct here...



  • @peterp after sometimes I just set frequency plan to AS923 on lopy4 node without changing any channel and add maximum to 923.4 for gateway (pygate) then it can join.

    The problem arises when I tried to change channel for node to only limit below 923 because here our frequency plan is 920-923

    thanks,
    terry



  • @peterp
    from pygate:

    {
    	"SX1301_conf": {
    		"lorawan_public": true,
    		"clksrc": 1,
    		"antenna_gain": 3,
    		"radio_0": {
    			"enable": true,
    			"type": "SX1257",
    			"freq": 923000000,
    			"rssi_offset": -164.0,
    			"tx_enable": true,
    			"tx_freq_min": 922200000,
    			"tx_freq_max": 923400000
    		},
    		"radio_1": {
    			"enable": true,
    			"type": "SX1257",
    			"freq": 922000000,
    			"rssi_offset": -164.0,
    			"tx_enable": false
    		},
    		"chan_multiSF_0": {
    			"enable": true,
    			"radio": 0,
    			"if": 0
    		},
    		"chan_multiSF_1": {
    			"enable": true,
    			"radio": 0,
    			"if": -200000
    		},
    		"chan_multiSF_2": {
    			"enable": true,
    			"radio": 0,
    			"if": -400000
    		},
    		"chan_multiSF_3": {
    			"enable": true,
    			"radio": 0,
    			"if": 200000
    		},
    		"chan_multiSF_4": {
    			"enable": true,
    			"radio": 0,
    			"if": 400000
    		},
    		"chan_multiSF_5": {
    			"enable": true,
    			"radio": 1,
    			"if": 200000
    		},
    		"chan_multiSF_6": {
    			"enable": true,
    			"radio": 1,
    			"if": 400000
    		},
    		"chan_multiSF_7": {
    			"enable": true,
    			"radio": 1,
    			"if": -200000
    		},
    		"chan_Lora_std": {
    			"enable": true,
    			"radio": 1,
    			"if": 200000,
    			"bandwidth": 125000,
    			"spread_factor": 7
    		},
    		"chan_FSK": {
    			"enable": true,
    			"radio": 1,
    			"if": 400000,
    			"bandwidth": 125000,
    			"datarate": 50000
    		},
    		"tx_lut_0": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_1": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_2": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_3": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_4": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_5": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_6": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 9,
    			"dig_gain": 3
    		},
    		"tx_lut_7": {
    			"pa_gain": 0,
    			"mix_gain": 6,
    			"rf_power": 11,
    			"dig_gain": 3
    		},
    		"tx_lut_8": {
    			"pa_gain": 0,
    			"mix_gain": 5,
    			"rf_power": 13,
    			"dig_gain": 2
    		},
    		"tx_lut_9": {
    			"pa_gain": 0,
    			"mix_gain": 8,
    			"rf_power": 14,
    			"dig_gain": 3
    		},
    		"tx_lut_10": {
    			"pa_gain": 0,
    			"mix_gain": 6,
    			"rf_power": 15,
    			"dig_gain": 2
    		},
    		"tx_lut_11": {
    			"pa_gain": 0,
    			"mix_gain": 6,
    			"rf_power": 16,
    			"dig_gain": 1
    		},
    		"tx_lut_12": {
    			"pa_gain": 0,
    			"mix_gain": 9,
    			"rf_power": 17,
    			"dig_gain": 3
    		},
    		"tx_lut_13": {
    			"pa_gain": 0,
    			"mix_gain": 10,
    			"rf_power": 18,
    			"dig_gain": 3
    		},
    		"tx_lut_14": {
    			"pa_gain": 0,
    			"mix_gain": 11,
    			"rf_power": 19,
    			"dig_gain": 3
    		},
    		"tx_lut_15": {
    			"pa_gain": 0,
    			"mix_gain": 12,
    			"rf_power": 20,
    			"dig_gain": 3
    		}
    	},
    
    	"gateway_conf": {
    		"gateway_ID": "somegwid",
    		"server_address": "ttn.opennetworkinfrastructure.org",
    		"serv_port_up": 1700,
    		"serv_port_down": 1700,
    		"keepalive_interval": 10,
    		"stat_interval": 30,
    		"push_timeout_ms": 100,
    		"forward_crc_valid": true,
    		"forward_crc_error": true,
    		"forward_crc_disabled": true
    	}
    }
    
    

    thanks


  • Global Moderator

    @terrymulijana Can you share your json file (without your gateway_ID)?



  • @Gijs I use switch-router from TTN which is ttn.opennetworkinfrastructure.org, already tried asia-se.thethings.network as well.
    The join request is passed to server but code from the node always saying not joined yet. I wonder what is the cause because on pygate I saw out of sync push ack.

    thanks,
    terry


  • Global Moderator

    Hi,
    We are currently testing your setup!
    By any chance, did you specify the closest TTN Router? (by default, we used the eu.router.thethingsnetwork.org) I am not sure, but if you are not located in Europe, the packets may be delayed, and I believe it also has to do something with the frequency settings allowed.

    Let me know!
    Gijs



  • @Gijs thanks for responding

    as you can see its being forwarded however the time seems between 4sec only
    I'm using US915 to get 922 because when using AS923 always got locked to 923 while my country frequency is AS923-2

    and this is the reply one of the join request from TTN :

    join request :
    {
      "gw_id": "eui-somegateway ID",
      "payload": "some payload",
      "dev_eui": "some eui",
      "lora": {
        "spreading_factor": 10,
        "bandwidth": 125,
        "air_time": 370688000
      },
      "coding_rate": "4/5",
      "timestamp": "2020-08-03T15:21:03.875Z",
      "rssi": 3,
      "snr": 9.8,
      "app_eui": "some app eui",
      "frequency": 922400000
    }
    
    join accept :
    {
      "gw_id": "eui-some gatewayid",
      "payload": "some payload",
      "lora": {
        "spreading_factor": 10,
        "bandwidth": 125,
        "air_time": 452608000
      },
      "coding_rate": "4/5",
      "timestamp": "2020-08-03T15:21:07.878Z",
      "frequency": 922400000
    }
    
    

    as in pygate console looks like this :
    test_1.png

    thanks for helping !
    terry


  • Global Moderator

    @terrymulijana said in Cannot make join OTAA timely with pygate and lopy4:

    rying to connect with lopy4 with OTAA. While all the pack

    Hi,
    I cannot seem to reproduce the error by default. Can you tell me a little more about your configuration?

    Let me know!



  • hi Peter,

    thanks for confirming this problem. In anyway how can we make support request for pygate ?

    regards,
    terry



  • Hi @terrymulijana,
    I can confirm your problem. I've tested this today morning.
    I've got two TTN gateways. 1 RPI/IC880a and 1 Pygate.
    I've switched off the RPI and tried to join TTN via OTAA via PyGate
    Within the TTN console I can see the Join-Requests and the Accept messages.
    Unfortunately these messages seems not to to reach the Device trying to join.

    After that, I switched off the PyGate and turned the RPI/IC880a Gateway on.
    Join requests via OTAA are accepted within 5 seconds by the device.

    So yes, there seems to be an issue with Pygate.

    HTH, best regards
    Peter

    P.S.: I'm using EU868. The Pygate is hooked up with an WiPy3.0 with 1.20.2.rc10 [v1.11-a159dee]


Log in to reply
 

Pycom on Twitter