Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Fipy with OTAA node - Nano Gateway - TTN (not join)

    Scheduled Pinned Locked Moved FiPy
    fipyloraotaa
    19 Posts 3 Posters 4.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robert-hhR Offline
      robert-hh @apiwize
      last edited by

      @apiwize That's strange. I'm using a lopy as gateway.
      Can you show the part of the gateway's log when it gets and sends the OTAA join messages, like you did above.

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        apiwize @robert-hh
        last edited by

        @robert-hh Here it is :
        [ 1.731] Starting LoRaWAN nano gateway with id: b'30AEA4FFFE2D00B0'
        [ 6.103] WiFi connected to: xxx
        [ 6.108] Syncing time with pool.ntp.org ...
        [ 6.213] RTC NTP sync complete
        [ 6.228] Opening UDP socket to router.eu.thethings.network (52.169.76.203) port 1700...
        [ 6.240] Setting up the LoRa radio at 868.1 Mhz using SF7BW125
        [ 6.248] LoRaWAN nano gateway online
        [ 6.252] You may now press ENTER to enter the REPL
        [ 6.295] Push ack
        [ 31.286] Pull ack
        [ 46.132] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3CYfmhRlw8=", "time": "2018-04-02T07:01:43.918247Z", "chan": 0, "tmst": 46124070, "stat": 1, "modu": "LORA", "lsnr": 8.0, "rssi": -37, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
        [ 46.199] Push ack
        [ 50.209] Downlink timestamp error!, t_us: -1955412445
        [ 50.216] Pull rsp

        //////////////////////////////////////////////////
        On the TTN side :

        {
        "time": "2018-04-02T07:05:03.966259338Z",
        "frequency": 868.1,
        "modulation": "LORA",
        "data_rate": "SF7BW125",
        "coding_rate": "4/5",
        "gateways": [
        {
        "gtw_id": "eui-30aea4fffe2d00b0",
        "timestamp": 241458720,
        "time": "2018-04-02T07:05:03.908999Z",
        "channel": 0,
        "rssi": -37,
        "snr": 6
        }
        ]
        }

        robert-hhR 1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @apiwize
          last edited by

          [ 46.132] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3CYfmhRlw8=", "time": "2018-04-02T07:01:43.918247Z", "chan": 0, "tmst": 46124070, "stat": 1, "modu": "LORA", "lsnr": 8.0, "rssi": -37, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
          [ 46.199] Push ack
          [ 50.209] Downlink timestamp error!, t_us: -1955412445
          [ 50.216] Pull rsp
          After this line the should be a starting with "Sent downlink packet". Could you include that too in your log?

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            apiwize @robert-hh
            last edited by

            @robert-hh Well... I don't receive any "sent downlink" notification. My router should be ok, with port forwarding (1700) on gateway, I am to check in deep if there is no tric on firewall...
            /////////////
            Serial port COM6 opened
            [ 3356.303] Pull ack
            [ 3362.082] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3As4NAlkvU=", "time": "2018-04-02T07:56:59.867743Z", "chan": 0, "tmst": 3244603296, "stat": 1, "modu": "LORA", "lsnr": 6.0, "rssi": -60, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
            [ 3362.138] Push ack
            [ 3366.168] Downlink timestamp error!, t_us: 1748657865
            [ 3366.175] Pull rsp
            [ 3366.323] Push ack
            [ 3381.325] Pull ack
            [ 3392.077] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3BWv1/hxjA=", "time": "2018-04-02T07:57:29.863851Z", "chan": 0, "tmst": 3273498056, "stat": 1, "modu": "LORA", "lsnr": 6.0, "rssi": -60, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
            [ 3392.144] Push ack
            [ 3396.158] Downlink timestamp error!, t_us: 577930084
            [ 3396.165] Pull rsp
            [ 3406.303] Pull ack
            [ 3422.076] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3ASxvFISZM=", "time": "2018-04-02T07:57:59.862767Z", "chan": 0, "tmst": 3302392157, "stat": 1, "modu": "LORA", "lsnr": 6.0, "rssi": -61, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
            [ 3422.134] Push ack
            [ 3426.177] Downlink timestamp error!, t_us: -593913532
            [ 3426.184] Pull rsp
            [ 3426.330] Push ack
            [ 3431.322] Pull ack

            robert-hhR 1 Reply Last reply Reply Quote 0
            • robert-hhR Offline
              robert-hh @apiwize
              last edited by robert-hh

              @apiwize I see. Are you sure that you updated the firmware of the gateway to v1.17.3.b1? Other wise the driver for the sx127x chip and the nanogateway script use different timers.

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                apiwize @robert-hh
                last edited by

                @robert-hh : Firmware should be OK, I apdate again. I had 1 "result" (but no "join) on the currnt config by turning ther self window compensation (line 189) to 10 000. But just once, see enclosed : 0_1522658173794_7b1d45ff-9118-4aea-a74c-889b355ee097-image.png

                robert-hhR 1 Reply Last reply Reply Quote 0
                • robert-hhR Offline
                  robert-hh @apiwize
                  last edited by

                  @apiwize The timestamps in you log message are inconsistent. Please check again in your gateway:

                  import uos
                  uos.uname()

                  Remark: the window compensation values should be negative, since the gateway is normally a little bit too late.

                  A 1 Reply Last reply Reply Quote 0
                  • A Offline
                    apiwize @robert-hh
                    last edited by

                    @robert-hh Hi Robert, here is the result :
                    (sysname='FiPy', nodename='FiPy', release='1.17.3.b1', version='v1.8.6-849-83e2f7f on 2018-03-19', machine='FiPy with ESP32', lorawan='1.0.2', sigfox='1.0.1')

                    Additionnally, after firmware update + back to 6000 ms windows compensation, I obtained, with no payload sent to TTN :
                    [ 441.622] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3AHN+Adc+8=", "time": "2018-04-02T08:43:10.304316Z", "chan": 0, "tmst": 168393914, "stat": 1, "modu": "LORA", "lsnr": 6.0, "rssi": -61, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
                    [ 441.691] Push ack
                    [ 445.707] Pull rsp
                    [ 446.714] Sent downlink packet scheduled on 173.387, at 868,100,000 Hz using SF7BW125: b' ^\xac\xf3\x93\x91\xec\xcc\x97o\xcf\xe7\x07\x8a\xb4AG#\x81\xef\x0b\x9e\xc3\x7f\xac\xef\xf2`.\xe3\xdc\x95g'
                    [ 455.324] Pull ack
                    [ 460.337] Push ack
                    [ 471.644] Received packet: {"rxpk": [{"data": "AOGzANB+1bNwtK98lknVs3C3/zKOlqs=", "time": "2018-04-02T08:43:40.326154Z", "chan": 0, "tmst": 198392668, "stat": 1, "modu": "LORA", "lsnr": 6.0, "rssi": -62, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 23}]}
                    [ 471.704] Push ack
                    [ 475.747] Pull rsp
                    [ 476.707] Sent downlink packet scheduled on 203.386, at 868,100,000 Hz using SF7BW125: b' \x9a\x81\x82\x95#\xac\x91\x081H^\xe4\xfb\xa6\xdf\x08ML\x81*1\xd3\x82|T_U[\x1a\xcb1!'
                    [ 480.352] Pull ack
                    [ 505.342] Pull ack
                    [ 520.331] Push ack

                    robert-hhR 2 Replies Last reply Reply Quote 0
                    • robert-hhR Offline
                      robert-hh @apiwize
                      last edited by

                      @apiwize The timestamps look ok now for a join message. The differences is 4994 ms (5 seconds - 6 ms compensation). in the rx message, microseconds are shown, in the TX message it's seconds. Could be aligned better. You could vary the window_compensation a little bit, like setting it to 0 or -3000. The steps do not have to be too fine.

                      A 1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @apiwize
                        last edited by

                        @apiwize In the initial post, you were using 923MHz frequencies. Now you are at 868.1. Which region are you in?

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          apiwize @robert-hh
                          last edited by

                          @robert-hh Hi Robert, sounds to work fine now. I'll try to improve the time windows (I lose about 2 message / 3 for the moment). Anyway, many thanks for your help !

                          robert-hhR 1 Reply Last reply Reply Quote 0
                          • robert-hhR Offline
                            robert-hh @apiwize
                            last edited by

                            @apiwize after the join worked, the TTN server will send a list of frequencies to use. The node will uses these in a random matter. Unfortunately the nanogateway can listen only to one of these three frequencies, meaning that you will miss 2 of 3 messages. That is not related to timing.
                            The best option then is to switch to abp mode, copying over from the TTN console the values for device address, network session key and app session key.
                            See the discussion at this thread about 10 days ago.
                            https://forum.pycom.io/topic/2728/lopy-and-nanogateway-example-inaccurate-timing-prevent-otaa-join

                            1 Reply Last reply Reply Quote 0

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            • 1 / 1
                            • First post
                              Last post

                            Pycom on Twitter

                            Pycom