Battery based NRF52 sensor compile options?



  • 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?



  • 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
    


  • @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.


  • Hardware Contributor

    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.


 

328
Online

8.6k
Users

9.4k
Topics

99.0k
Posts