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

    LoRaWAN low level debug messages

    Scheduled Pinned Locked Moved LoPy
    lorawandebuglopy4
    10 Posts 4 Posters 758 Views 4 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.
    • W Offline
      woodpecker
      last edited by

      I’m trying to debug LoRaWAN join / send operations to a commercial provider but don’t have any feedback on what’s happening. I was able to join the network exactly once (as reported by the server) but not repeat this.

      Is there any way to turn on low-level debug messages to see when join attempts are made, raw received packets / errors, etc? Not sure how to proceed without feedback.

      Thanks,
      Adam

      1 Reply Last reply Reply Quote 1
      • M Offline
        mk
        last edited by

        I second this!

        I've just spent all day trying to connect to a commercial LoraWAN in New Zealand, apparently the join is successful (lora.has_joined() is True), but the lora.stats() almost all seem to be zero

        rx_timestamp=0, rssi=0, snr=0.0, sfrx=0, sftx=0, tx_trials=0, tx_power=0, tx_time_on_air=1647, tx_counter=0, tx_frequency=0
        

        I've gone through post after post looking for a way to scan for available LoraWAN's and see their signal strength (is this not possible? I've found nothing) or any other way to confirm what is actually happening.

        mfalkviddM 1 Reply Last reply Reply Quote 0
        • mfalkviddM Offline
          mfalkvidd @mk
          last edited by

          @mk there is no way to scan for available LoRaWANs. LoRaWAN gateways do not broadcast anything, so there is nothing to scan for.

          W 1 Reply Last reply Reply Quote 1
          • W Offline
            woodpecker @mfalkvidd
            last edited by woodpecker

            @mfalkvidd
            What about logging or status of my own LoPy4’s behavior, such as join attempts, raw tx packets, tx parameters (channel, dr), and raw / partial rx packets?

            When I was testing in LoRa raw mode, I saw frames that weren’t mine so I know there is traffic “out there”.

            I’m basically trying to understand if there is way to query low level status or if I would need to try to add debug messages (e.g., to modules such as https://github.com/pycom/pycom-micropython-sigfox/blob/master/esp32/mods/modlora.c)

            Thanks,
            Adam

            J mfalkviddM 2 Replies Last reply Reply Quote 0
            • J Offline
              jcaron @woodpecker
              last edited by

              @woodpecker it’s been a while, but IIRC I ended up adding my own log messages in the source to get the info I wanted.

              Be careful not to add them in parts of the code that are called in interrupt handlers, though, that ends up pretty badly (there may be safe calls for that, though, but definitely not a regular printf).

              1 Reply Last reply Reply Quote 0
              • mfalkviddM Offline
                mfalkvidd @woodpecker
                last edited by

                @woodpecker sorry, I don’t know

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mk
                  last edited by

                  @woodpecker after getting past my first problem (poor coverage in my area for the LoraWAN network, solved by simply taking the device to a new location - not actually diagnosed from code), I was seeing the same thing as you - one packet received, others not working properly.

                  I got this reply from the LoraWAN provider (which I haven't yet figured out what I need to do about it) but it might be the same thing that's happening for you:

                  Your device is not incrementing uplink sequence numbers for every data transmission. The network has got data but each time the transmission had the same sequence number, 0. So it acknowledges it (which is what you see in the web page with downlink sequence numbers increasing) but doesn't show anything as it treats it as a repeated, old transmission. If you fix that, should work OK.

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jcaron @mk
                    last edited by

                    @mk are you using deep sleep? If you do, do you correctly save and restore LoRa state?

                    M 1 Reply Last reply Reply Quote 1
                    • M Offline
                      mk @jcaron
                      last edited by

                      @jcaron no, not using deep sleep yet. Just have a fairly basic main.py, sending one packet as per the examples, and I either run it by uploading it to the LoPy and just keep pressing the reset button, or I've been using the "Run" command provided by the Pymakr extension in VS Code. I've been getting some weird results though and I'm starting to wonder if I shouldn't just be re-running the whole main.py every time I want to re-test.

                      Sorry, didn't mean to hijack this thread.

                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        jcaron @mk
                        last edited by

                        @mk IIRC a reset will have the same effect as deep sleep, resetting LoRaWAN counters and other state. Unless you join every time you reset, you need to save and restore state.

                        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