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

NRF52832 6LoWPAN radio poll interval

Hi,

I'm working on an IoT project with NRF52832 (S132). I need to connect this device to mqtt over 6LoWPAN (IPv6) and run it on a button cell battery CR2032 for as long as possible. 

I noticed that whenever I ping the device, I get a latency of around 300ms. To preserve battery, I want to turn the radio on (RX/TX) every 1 second and sleep the rest. 

I know that for BLE you can set the advertising interval to 1 second the the device is sleeping most of the time. 

How can I set how often the radio goes ON on a 6LoWPAN application? Also, is it possible to adjust the TX power to minimum?

Thanks

Parents
  • Hi, 

    Could you please describe your setup ? Which device will be your gateway from 6LowPAN to internet ? 

    Note that the communication on 6LowPAN happens on GATT connection, not via advertising. 

    How long is the sleep ? If it's short, you can just increase the connection interval. It's longer you may think of disconnect the connection and establish again when the device wakes up. 

  • I'm using RasPi as a gateway with the classic setup from the documentation. I want to use NRF52832 to send sensor data or control a switch/relay, so latency is not an issue, but power consumption is. 

    One second or two seconds will be good if I can still keep the connection alive with the gateway. 

    Is there a diagram that explains how data transfer works once 6LoWPAN BLE connection is established? I'd expect something like this in my case:

    If so, I'd expect a PING to the device to get a response time of at least 1s. I tried tunning different connection parameters, but I still get around 300ms ping response time, which makes me think that the NRF52 antena is in RX mode most of the time. 

    Any help in understanding this would be appreciated.

    Thanks

  • Could you point me to which example you are testing, or where you get the figure ? 
    The way it works with BLE (which 6LowPAN over BLE running on top of) is that the CPU and the radio will sleep between connection interval and only wake up at each connection interval. Which power consumption are you seeing now ? Which connection interval are you using ? 

  • I am testing the ICMP example. Based on your previous answer, it looks like the parameter I was looking for is MIN/MAX_CONN_INTERVAL .

    The example runs just fine with the default values of:

    CONN_SUP_TIMEOUT 43
    MAX_CONN_INTERVAL 24
    MIN_CONN_INTERVAL 6
    SLAVE_LATENCY 6
    But when I change MAX_CONN_INTERVAL to 48 for example, I get a fatal error:
    Reading symbols from ../nRF5_SDK_16.0.0/examples/iot/icmp/pca10040/s132/armgcc/_build/nrf52832_xxaa.out...
    0x00027be8 in app_error_fault_handler (id=id@entry=16385, pc=pc@entry=0, info=info@entry=536936356) at ../../../../../../components/libraries/util/app_error_weak.c:100
    100	    NRF_BREAKPOINT_COND;
    (gdb) bt
    #0  0x00027be8 in app_error_fault_handler (id=id@entry=16385, pc=pc@entry=0, info=info@entry=536936356) at ../../../../../../components/libraries/util/app_error_weak.c:100
    #1  0x00027bb4 in app_error_handler_bare (error_code=error_code@entry=7) at ../../../../../../components/libraries/util/app_error.c:73
    #2  0x0002f6b4 in gap_params_apply () at ../../../../../../components/iot/medium/ipv6_medium_ble.c:246
    #3  ipv6_medium_init (p_init_param=p_init_param@entry=0x20003d20 <ipv6_medium_init_params>, desired_medium_type=desired_medium_type@entry=1 '\001', 
        p_new_medium_instance=p_new_medium_instance@entry=0x20003d50 <m_ipv6_medium>) at ../../../../../../components/iot/medium/ipv6_medium_ble.c:672
    #4  0x0002c392 in main () at ../../../main.c:805
    I've done no other changes to the code other than MAX_CONN_INTERVAL and 
    BLE_6LOWPAN_LEGACY_MODE = 0
    Is there any dependency between these parameters? Should I update other parameters as well in order for this to work?
    Sorry for switching to this problem now, but I think this is related to my issue. 
    Thanks
  • I found the problem. There is some dependency between these params. You can check the validity using this tool: https://docs.google.com/spreadsheets/d/1uOebp5u8fzdiRhz1w7zY6jxE1IqiF0TxMMZDIs1yhNk/edit#gid=0

    Now it works fine! thanks for your help

Reply Children
No Data
Related