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

how to know sleep period of node(s110)

FormerMember
FormerMember

if i am a master i want know to know the sleep period of node,how do i know...?

how do i know whether it is sleeping or awake..?

if i have data to sent for node,but the node is sleeping ..then what i have to do...?

  • If Your peripheral is awake, You should put it in advertising state. Your central should be scanning (all the time maybe?), so You'll get event when it gets advert packet from peripheral.

    Re-think Your roles - in my design it is peripheral who samples data - when it collects enough data it starts advertising, central immediately connects to it and peripheral sends collected data to central.

  • FormerMember
    0 FormerMember in reply to Wojtek

    yes..that is correct but,some other peripheral wants to send the data to this peripheral,but this device is sleeping...in that case what will happen to packets..? how much time it will wait to send data to peripheral...?

  • Peripheral (s110) cannot connect to other s110 anyway. If You want to use central/peripheral role in your "nodes" then You could try using s130 softdevice and switch between scanning/advertising.

    About packets - it depends of what do You call a packet. If it is the advertising packeet, it will be lost automatically if no device is scanning at the moment of advertising. If You mean packets during connection - they will be immediately received be the peer.

    You could try describe Your problem more precisely, or just check nordics example apps to understand what is the typical program flow.

  • FormerMember
    0 FormerMember in reply to Wojtek

    my exact question is one s110 device wants to talk with another s110 device through s130 device. if first s110 device is sends data to s130 ,the s130 has to send the data to second s110,but the second s110 is sleeping.In this case what will happen..?

    and one more doubt is.. sleeping means, the difference time between connection events only..? if the radio is off in sleeping period,will it start advertising again or it will directly talk with master(previously they connected and the device has gone to sleeping period for some time)...

    1. It depends of how You will implement it. There is no pre-defied behavior, You have to write code that will handle this situation somehow. S130 can hold the data until destination s110 is available. Or it can discard it. Or it can... blink led. Depends of your code...

    2. Sleeping means that nrf51 is in lower power consumption mode. It doesn't transmit/receive at the moment. It can return to normal work mode (wake up) by some interrupt (gpio, timer etc).When You wake up You can manually start advertising (or scanning if You are using central enabled softdevice...). There is no pre-defined automatic behavior. You have to write code.

    Here You can find informations that could help start with Your developement: devzone.nordicsemi.com/.../

Related