This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 relay LPN data over Friend node

Hi,

I am using the nrf5 SDK for Mesh v4.0,

Windows 10,

4 DevKits PCA10056.

I have 2 DevKits as LPN (from the experimental_lpn example) and 2 DevKits as FNs (friend nodes) (from light_switch/server example). They all communicate in the same network just fine. 

Q1: if I move one FN[1] out of reach of the LPNs, will it still receive data from the LPNs if the other FN[2] can reach boath LPNs and FN[1]?

Q2: I want to read out on which LPN which button was pressed, but i can't identify the name of each LPNs. All i receive from the FN server is:

00> <t:   11184514>, generic_onoff_server.c,  136, Server: transition_time_ms = 64
00> <t:   11184517>, generic_onoff_server.c,  137, Server: delay_ms = 32
00> <t:   11184520>, app_onoff.c,  204, msg: SET: 1
00> <t:   11184522>, app_onoff.c,  132, cur onoff: 0  target: 1  delay: 50 ms  remaining time: 100 ms
00> <t:   11186165>, main.c,   96, Setting GPIO value: 1
00> <t:   11186167>, app_onoff.c,  132, cur onoff: 1  target: 1  delay: 0 ms  remaining time: 100 ms
00> <t:   11189449>, app_onoff.c,  132, cur onoff: 1  target: 1  delay: 0 ms  remaining time: 0 ms

I would like to have either a name of the LPN or some kind of ID. could someone provide a code snippet of this or where i need to change the code?

Q3: As a result, i would like to have a lot of LPNs in a parking house to determine if a car is there or not. All the LPNs should send their ID and a 1 (car is here) or 0 (no car here) to a PC.

If the answer to Q1 is yes, i should be able to listen to a FN and receive all the messages from all LPNs there and then just send those data to a PC over UART. Is this doable? Can I just listen to a random FN and have the data of all LPNs? Any suggestions how to do this otherwise?

Thank you

Brocc

  • Hi Brocc, 

    Q1. Each LPN has to establish a friendship with a friend node. If the LPNs have friendship with FN[2] it doesn't matter where FN[1] is if it's still in the network range, it's can receive the data from LPNs. However, if the LPNs have the friendship with FN[1] and FN[1] move out of range of the LPNs. Then the LPNs will be disconnected from the network. Until it establish a new friendship with FN[2] (the friendship with FN[1] will timed out after a while)

    In our stack this re-initialize friendship is not done automatically you need to do it in the application. 

    Q2. You can check the function generic_onoff_state_set_cb(). It's the function that call onoff_state_value_update() to print the log. Inside generic_onoff_state_set_cb() you can find p_meta that contain the src - source address of the packet. It will show which LPN sends the data. 

    Q3. You can configure the LPN to send the data to a group address which your gateway subscribe to. It doesn't matter which FN it connect to, as long as it has established a friendship with a FN in range, it can send data to the whole network. 

Related