Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Battery based NRF52 sensor compile options?

Battery based NRF52 sensor compile options?

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 3 Posters 628 Views 3 Watching
  • 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.
  • kisse66K Offline
    kisse66K Offline
    kisse66
    wrote on last edited by
    #1

    I have NRF52-based rain gauge. works well and got finally proper power consumption, but seem to have one problem to solve.
    It sends multiple sensor values and then goes to sleep for 20 minutes. This one is on the edge of radio coverage and occasionally seem to loose connection. Below is battery voltage measurement. You can see, that when there's a gap in the values (something wrong in radio coverage) the battery voltage drops rapidly, which suggests it does not sleep, but keeps trying something:

    0_1558718789617_2019-05-24 (2).png

    So the question is is there a good set of compile options to remove all checks etc, as I only want this one to send the values? If it fails just try again after the sleep period.

    Currently I have

    #define MY_SMART_SLEEP_WAIT_DURATION_MS  400
    #define MY_TRANSPORT_UPLINK_CHECK_DISABLED
    #define MY_TRANSPORT_WAIT_READY_MS  5000
    #define MY_RADIO_NRF5_ESB
    

    values are sent like

    send(msg);
    

    Any suggestions?

    1 Reply Last reply
    1
    • nagelcN Offline
      nagelcN Offline
      nagelc
      wrote on last edited by
      #2

      When a MySensors node can't find the gateway, it will try to find another one or a repeater. That might be what you are seeing. I used the code listed below in a node I was using just as a beacon to tell if my car was nearby or not. It might be worth a try. It tells the node to just stop looking if it can't find the specified gateway.

      Note: If you are using a repeater to get to the gateway, then this is not what you want to do.

      /**
       * @def MY_PARENT_NODE_IS_STATIC
       * @brief Enable MY_PARENT_NODE_IS_STATIC to disable fall back if parent node fails
       */
      #define MY_PARENT_NODE_IS_STATIC
      
      #define MY_PARENT_NODE_ID 0
      
      kisse66K 1 Reply Last reply
      1
      • nagelcN nagelc

        When a MySensors node can't find the gateway, it will try to find another one or a repeater. That might be what you are seeing. I used the code listed below in a node I was using just as a beacon to tell if my car was nearby or not. It might be worth a try. It tells the node to just stop looking if it can't find the specified gateway.

        Note: If you are using a repeater to get to the gateway, then this is not what you want to do.

        /**
         * @def MY_PARENT_NODE_IS_STATIC
         * @brief Enable MY_PARENT_NODE_IS_STATIC to disable fall back if parent node fails
         */
        #define MY_PARENT_NODE_IS_STATIC
        
        #define MY_PARENT_NODE_ID 0
        
        kisse66K Offline
        kisse66K Offline
        kisse66
        wrote on last edited by
        #3

        @nagelc

        good point, have to try. Actually I now have one repeater, but can remove it or maybe move it even closer and use that as static.

        1 Reply Last reply
        0
        • Nca78N Offline
          Nca78N Offline
          Nca78
          Hardware Contributor
          wrote on last edited by Nca78
          #4

          You also have the MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS, which is set by default to 10s. It means before going to sleep it will keep the radio on for 10 consecutive seconds, which will obviously hit the battery, you can shorten this interval.

          Also, you can set a static parent node ID with MY_PARENT_NODE_IS_STATIC (and MY_PARENT_NODE_ID), this will avoid the search for a "better" parent. You can set the parent node ID to the ID of your repeater if you use one.

          And if you don't care at whether your value has arrived or not, then you can configure your node as a passive node with MY_PASSIVE_NODE: it will only send the message and never listen to anything. No ACKs, no possibility of OTA and it also seems (if I believe the comments in the config file) no signing.

          1 Reply Last reply
          0
          • kisse66K Offline
            kisse66K Offline
            kisse66
            wrote on last edited by
            #5

            I tried all the options and maybe got a bit better battery life. However I have now found out, that the actual problem is not likely radio connection after all, but I2C related problem. Started getting more of random drops and after adding some more debug stuff I finally found, that it sometimes get stuck in HTU21 driver, that had a forever loop if there was no proper response. The driver code has later been modified (Adafruit) to avoid this loop. I had my own async version of it, which had the same bug (same code, but split into start() and read() to avoid the delay saving run time).

            So likely this random dead battery issue was forever loop draining the battery. Have no idea why it sometimes rebooted by itself, recently it has just died and after reset (battery off and back on) the battery is more or less empty.

            1 Reply Last reply
            1
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            19

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular