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

    How to decode the data in the Nanogateway example?

    Scheduled Pinned Locked Moved LoPy
    lopy nanogatewadata lopy
    3 Posts 2 Posters 1.2k Views 2 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.
    • R Offline
      rvandam
      last edited by

      I have setup a nanogateway to TTN like the example. Everything seems to work well and the data is processed by TTN. The next step is of course to modify the code for my own needs. I am trying to figure were and which data is send/received in the code.

      A basic output from the gateway is this:
      [ 896.973] Received packet: {"rxpk": [{"data": "QCkuASYAWAACa/U72jXPDrOglQ==", "time": "2017-11-26T13:06:00.63490Z", "chan": 0, "tmst": 882754716, "stat": 1, "modu": "LORA", "lsnr": 6.0, "rssi": -54, "rfch": 0, "codr": "4/5", "freq": 868.1, "datr": "SF7BW125", "size": 19}]}

      How do I manually decode the data part?
      QCkuASYAWAACa/U72jXPDrOglQ==

      Is this base64 encoded? I tried to decode the data in base64 which results in:
      base64.b64decode(data)
      '@).\x01&\x00X\x00\x02k\xf5;\xda5\xcf\x0e\xb3\xa0\x95'

      Trying to unhexlify results in error like:
      TypeError: Odd-length string

      Sorry if this is a basic question.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @rvandam
        last edited by

        @rvandam
        Paste it in the LoRaWAN decoder https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/?data=

        1 Reply Last reply Reply Quote 0
        • R Offline
          rvandam
          last edited by

          Thank you, that was really helpful. The online decoder works perfectly.

          When I searched for Lorawan decoder I got also some really useful links.

          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