frame

data part missing

Hi,

I have a problem with the basic utilization of the platform.


but when i run the python code in the  Flip&Click  board in the console window i receive the messages: 

joining....
denied :(

In the web page of thethingsnetwork.org i receive a message with: time, frequency, modulation,... ecc BUT without the data part!

how i can solve it?

whats wrong?

Thank you in advance for any help you can provide!
Fabio L.

Comments

  • anbaanba Member
    Hi Fabio,
    welcome to Zerynth community!

    The activation events do not contain any payload, the uplink events do and are marked with a blue up-pointing triangle icon on TTN console (you can see it in the last screenshot here ).

    The Zerynth console window output suggests that something went wrong during the join phase.
    Are you using the same code posted on the blog? After the  print("denied :(")  line, an exception is raised and since there is no try-except block, the instructions that follow that line are not executed.

    However, on TTN console an activation event appear. Maybe it is related to another attempt or maybe your node did not receive the confirmation back from the gateway (this may happen). How far are you from the gateway? Which antenna are you using?
     
    To solve this issue you can put the rn2483.init command in a loop that stops when the device succeeds to connect

    i = 0
    while True:
    i+=1
    res = False

    print("join TTN attempt",i,"...")

    try:
    res = rn2483.init(ser_LORA, appeui, appkey, rst_LORA)
    except Exception as e:
    print(e)

    if not res:
    print("... failed :(")
    sleep(5000)
    else:
    print("... succeded !")
    break

    Let me know if this can help you!

    Andrea Baù
    Zerynth Support Team
  • Hi Andrea,

    thanks for you suggestion but seems the problem continues!

    I tried your code:
    # Created at 2017-11-08 12:55:09.878654
    import streams
    from microchip.rn2483 import rn2483
    rst_LORA = D16 # reset pin 
    appeui = "<my_appeui>"
    appkey =  "<my_appkey>"
    streams.serial()
    print("START")
    i = 0
    while True:
        i+=1
        res = False 
        print("join TTN attempt",i,"...")
        
        try:
            res = rn2483.init(SERIAL1, appeui, appkey, rst_LORA)
        except Exception as e:
            print(e)
        
        if not res:
            print("... failed :(")
            sleep(5000)
        else:
            print("... succeded !")
            break
    The output is:
    START
    join TTN attempt 1 ...
    ... failed :(
    join TTN attempt 2 ...
    ... failed :(
    join TTN attempt 3 ...
    ... failed :(
    join TTN attempt 4 ...
    ... failed :(
    join TTN attempt 5 ...
    ... failed :(
    join TTN attempt 6 ...
    ... failed :(


    because my reply is too long i have to split in 2...

  • My gateway is: 

    Gateway xB99C

    {
        "SX1301_conf": {
            "lorawan_public": true,
            "clksrc": 1, /* radio_1 provides clock to concentrator */
            "radio_0": {
                "enable": true,
                "type": "SX1257",
                "freq": 867500000,
                "rssi_offset": -166.0,
                "tx_enable": true
            },
            "radio_1": {
                "enable": true,
                "type": "SX1257",
                "freq": 868500000,
                "rssi_offset": -166.0,
                "tx_enable": false
            },
            "chan_multiSF_0": {
                /* Lora MAC channel, 125kHz, all SF, 868.1 MHz */
                "enable": true,
                "radio": 1,
                "if": -400000
            },
       .....
            "tx_lut_0": {
                /* TX gain table, index 0 */
                "pa_gain": 0,
                "mix_gain": 8,
                "rf_power": -6,
                "dig_gain": 0
            },
            "tx_lut_1": {
                /* TX gain table, index 1 */
                "pa_gain": 0,
                "mix_gain": 10,
                "rf_power": -3,
                "dig_gain": 0
            },
      .....
        },
        "gateway_conf": {
            "gateway_ID": "<GATEWAY_CODE>",
            /* change with default server address/ports, or overwrite in local_conf.json */
            "server_address": "router.eu.thethings.network",
            "serv_port_up": 1700,
            "serv_port_down": 1700,
            /* adjust the following parameters for your network */
            /* "keepalive_interval": 10, */
            /* "stat_interval": 30, */
            /* "push_timeout_ms": 100, */
            /* forward only valid packets */
            "forward_crc_valid": true,
            "forward_crc_error": false,
            "forward_crc_disabled": false
        }
    }

    The log of gateway is (/var/log/pkt_fwd.log):
    ##### 2017-11-08 13:11:05 GMT #####
    ### [UPSTREAM] ###
    # RF packets received by concentrator: 0
    # CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
    # RF packets forwarded: 0 (0 bytes)
    # PUSH_DATA datagrams sent: 0 (0 bytes)
    # PUSH_DATA acknowledged: 0.00%
    ### [DOWNSTREAM] ###
    # PULL_DATA sent: 6 (100.00% acknowledged)
    # PULL_RESP(onse) datagrams received: 0 (0 bytes)
    # RF packets sent to concentrator: 0 (0 bytes)
    # TX errors: 0
    ##### END #####
    INFO: [down] PULL_ACK received in 190 ms
    INFO: [down] PULL_ACK received in 259 ms
    INFO: [down] PULL_ACK received in 163 ms
    INFO: [down] PULL_ACK received in 254 ms
    INFO: [down] PULL_ACK received in 170 ms
    INFO: [down] PULL_ACK received in 199 ms
    ##### 2017-11-08 13:11:35 GMT #####
    ### [UPSTREAM] ###
    # RF packets received by concentrator: 0
    # CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
    # RF packets forwarded: 0 (0 bytes)
    # PUSH_DATA datagrams sent: 0 (0 bytes)
    # PUSH_DATA acknowledged: 0.00%
    ### [DOWNSTREAM] ###
    # PULL_DATA sent: 6 (100.00% acknowledged)
    # PULL_RESP(onse) datagrams received: 0 (0 bytes)
    # RF packets sent to concentrator: 0 (0 bytes)
    # TX errors: 0
    ##### END #####
    On the the things network (metadata) that i received (activation pkt) are:
    {
      "time": "2017-11-08T13:05:05.534618497Z",
      "frequency": 868.5,
      "modulation": "LORA",
      "data_rate": "SF12BW125",
      "coding_rate": "4/5",
      "gateways": [
        {
          "gtw_id": "eui-<GATEWAY_ID>",
          "timestamp": 122946828,
          "time": "2017-11-08T13:05:05.267372Z",
          "channel": 2,
          "rssi": -35,
          "snr": 9.2,
          "rf_chain": 1
        }
      ]
    }
    Thank Andrea in advance for any help you can provide!

    Fabio L.
  • anbaanba Member
    So let's see what the lora module receive when trying to join TTN.

    Under your user folder, in zerynth2\dist\r2.0.10\libs\official\microchip\rn2483 edit "rn2483.py" file as follow

    in the _send function definition add a print in the last line (line 72):
    def _send(cmd, discard_resp = False):
        _ser.write(cmd + '\r\n')
        if discard_resp:
            print("dres:",_read())

    in the init function add another print (line 225):
        ...
        for _ in range(3):
            _send('mac join otaa', discard_resp = True)
            res = _read(timeout = 30000)
    print("res:",res)
            if res != RESP_TIMEOUT:
    ...
    Then uplink the project again and post here the console output, maybe we get some clue :)
    Andrea Baù
    Zerynth Support Team
  • Hi Andrea,

    sorry for the delay in the reply!
    I was out office up to this morning so i don't had the possibility todo the test up to now.

    I have done the modification in the file (rn2483.py) as you had suggest, the output from zerynth studio console is:

    START
    join TTN attempt 1 ...
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    dres: ok
    res: denied
    ... failed :(
    join TTN attempt 2 ...
    dres: ok [...]

    hope this new information can help you to identify the problem!

    Thanks again for your quick help!

    Fabio L.

  • anbaanba Member
    Hi,
    on the device side, the lora module configuration seems successful but the fact remains that it does not receive a join confirm. After the "mac join otaa" command, is up to the rn2483 modem and to the gateway to manage the process.

    Have you already used the gateway with that specific packet forwarder build before?
    Andrea Baù
    Zerynth Support Team
  • Hi,

    NO! It's my first test with this kind of device! 
    We have to build a LORA very huge network and this is the first test.

    Some suggestion? 

    I'm pretty sure that the problem is in the configuration of the GW but i don't have idea where... 

    In case is not possible to solve it we have to looking for a different GW.

     
  • anbaanba Member
    Hi Fabio,
    double check that the packet forwarder you are using is updated to the last version. Then you can try reporting your issue on the TTN community or asking the gateway provider.
    Andrea Baù
    Zerynth Support Team
Sign In or Register to comment.

ZERYNTH Community

@ 2016 Zerynth.com, all rights reserved.