4 Replies Latest reply on Mar 10, 2020 1:04 PM by VictorZ_46

    Doubts about LPN

    mawu_4270096

      Hi all:

        

          when I debug the LPN,I  have some doubts about LPN sleep times. the print messages as below:

       

       

       

      before establishing the friendship with the friend node, the sleep timeout is 8s, after establishing the friendship, the sleep timeout is 6s

       

       

      the device configuration info is below:

       

          .features           = WICED_BT_MESH_CORE_FEATURE_BIT_LOW_POWER, // A bit field indicating the device features. In Low Power mode no Relay, no Proxy and no Friend

          .friend_cfg         =                                           // Empty Configuration of the Friend Feature

          {

              .receive_window = 0,                                        // Receive Window value in milliseconds supported by the Friend node.

              .cache_buf_len  = 0,                                        // Length of the buffer for the cache

              .max_lpn_num    = 0                                         // Max number of Low Power Nodes with established friendship. Must be > 0 if Friend feature is supported.

          },

          .low_power          =                                           // Configuration of the Low Power Feature

          {

              .rssi_factor           = 2,                                 // contribution of the RSSI measured by the Friend node used in Friend Offer Delay calculations.

              .receive_window_factor = 2,                                 // contribution of the supported Receive Window used in Friend Offer Delay calculations.

              .min_cache_size_log    = 3,                                 // minimum number of messages that the Friend node can store in its Friend Cache.

              .receive_delay         = 100,                               // Receive delay in 1 ms units to be requested by the Low Power node.

              .poll_timeout          = 100                                // Poll timeout in 100ms units to be requested by the Low Power node.

          },

       

       

      hope for correct reply as quickly as possible!

       

      thanks!

       

      mandy

        • 1. Re: Doubts about LPN
          DheerajP_41

          hi,

           

          on an initial test I got log as below. May i know which is the application you are using?

          Could you please share full logs with me so that I can compare it with mine?

           

          "

          !!!mesh_state_changed_cb:LPN_SCAN: scan:1

          observe start active:0

          mesh_state_changed_cb:LPN_SCAN: scan:0

          observe stop

          !!mesh_state_changed_cb:LPN_SCAN: scan:1

          observe start active:0

          mesh_state_changed_cb:LPN_SCAN: scan:0

          observe stop

          mesh_state_changed_cb:LPN_SLEEP: timeout:6000

          Get ready to go into ePDS sleep, duration=6000

          mesh_state_changed_cb:LPN_FRIENDSHIP: established:1 addr:5/5

          #

          #

          @

          ePDS wake up!!!

          !!mesh_state_changed_cb:LPN_SCAN: scan:1

          observe start active:0

          mesh_state_changed_cb:LPN_SCAN: scan:0

          observe stop

          mesh_state_changed_cb:LPN_SLEEP: timeout:6000

          Get ready to go into ePDS sleep, duration=6000

          "

           

          There may be some update for LPN_SLEEP: timeout after establishing the friendship. i will check and get back to you.

           

          Thanks,

          -Dheeraj

          1 of 1 people found this helpful
          • 2. Re: Doubts about LPN
            mawu_4270096

            Hi,

            the application code  is mesh_ onoff_ server

             

             

            thanks!

             

            wuyy

            • 3. Re: Doubts about LPN
              VictorZ_46

              Its a bit confusing. When LPN poll timeout is 10 seconds, we cannot sleep for 10 seconds, because after the wake if we send a poll and the friend does not receive for some reason, the friendship will be lost and it will take a lot of energy to reestablish. The formula that we use is

               

              max_sleep_duration = LPN poll timeout - Min Time, where

              Min Time = LPN Max HW start time + (receive delay + receive window) * LPN Poll Attempts, where

              LPN Max HW start time is time for HW to start. On some chips with some time mode it can take up to 1 sec.

              receive delay is the time that we wait after sending a poll before starting listen for the response from the friend, this is configured to 100ms

              receive window is how long we listen for the response from the friend, this is negotiated and 100ms by default

              LPN Poll Attempts is number of times we try to send LPN Poll until we decide that the friend is not there, this is set to 10.

               

              When friendship is established and receive window is negotiated 200ms, the sleep duration is 6sec.

               

              When friendship is not established and IV recovery does not work, it is not clear what to do. Currently we use the same formula (except that there is no friend and receive window is 0). Note that the max_sleep_duration is just a recommendation to the app. App can decide to sleep less or more (just make sure that you do not lose friendship).

              2 of 2 people found this helpful
              • 4. Re: Doubts about LPN
                VictorZ_46

                By the way, if you are playing with LPN/Friend, you should probably decrease the receive windows on the friend side. It does not have to be 200ms value. I believe 20ms should work just fine and LPN will use much less power.

                2 of 2 people found this helpful