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 MAC Battery Level reporting

    Scheduled Pinned Locked Moved Issues & Bugs
    lopy lorawan
    4 Posts 3 Posters 2.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.
    • bmarkusB Offline
      bmarkus
      last edited by bmarkus

      There is a lora.set_battery_level(level) method introduced in latest firmware:

      0_1501737154368_upload-d0def910-09e4-4876-b871-aaee637a699b

      Unfortunately current implementation is not in line with LoraWAN Specification v1.0.2

      0_1501737300888_upload-2c6e55f3-b554-4458-9196-f5b743643866

      Method is passing values between 0 and 100 to the LoRaWAN server directly which means on server side 39% for level=100, 20% for level=50, there are no way to report battery level 40-100%.

      Default value is 0 which indicates device is running on external source, level=0 doesn't mean 0%. Proper default value would be 255 which by the way can't be reported via this method.

      I advice to allow level=0...255 and use level=255 as default, adding the quoted text from the LoRaWAN specification to the documentation.

      1 Reply Last reply Reply Quote 3
      • B Offline
        bucknall
        last edited by

        Hi @bmarkus,

        Thanks for the bug report! Would you mind creating an issue on our GitHub repository for this?

        https://github.com/pycom/pycom-micropython-sigfox/issues

        Thanks!

        Developer Evangelist - Pycom

        1 Reply Last reply Reply Quote 0
        • bmarkusB Offline
          bmarkus
          last edited by

          Sure, I will open an issue at GitHub.

          1 Reply Last reply Reply Quote 1
          • D Offline
            daniel
            last edited by

            @bmarkus thanks, fixing it now.

            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