Send manufacturer update data packets after wakeup

Learn MoreFAQsTutorials

10 posts / 0 new
Last post
Rajapurerohit
Offline
Last seen:5 months 4 weeks ago
加入:2017-04-20 09:17
Send manufacturer update data packets after wakeup

Hi All,

I am working on the DA14583 sleep configuration.

For my custom code development, I have used a ble_app_peripheral SDK example and made required changes as per my requirement. Without sleep configuration and continuous advertising, my functionalities are prooven.

I have configured the device in extended sleep mode and wakeup using sensor pin signal low interrupt. For this, I have followed the ble_app_sleepmode SDK example for sleep configuration.

During advertising, I sent devices in extended sleep mode. (i.e., in function user_app_adv_start()) and wake up using sensor pin low detection and start advertising again.

Details below,

1) advertising interval is 2sec.

2)#define APP_PARAM_UPDATE_REQUEST_TO (50)

/* Advertising data update timer */
#define APP_ADV_DATA_UPDATE_TO (50)

Requirement,

- I have to connect to device and assign some settings.

- I want to send controlling packets to another device (almost I have 50 packets that I need to send to another device). I am using an update manufacturer function to do so.

Before sleep mode incorporation in the code, I used continuous advertising of the device and there I am able to send all my packets with making slow advertising intervals.

But now as I have incorporated sleep and wake up call back using interrupt the logic changes. With the above details config, I tried to send data but only 1 packet is being sent to another device and that sticks for the advertising period. I am unable to other packets to the device so please help me how I can achieve this sending 50 packets when the device wakes up from sleep.

Please help me as early as possible.

Thanks and Regards

Rohit R

Device:
PM_Dialog
Offline
Last seen:9 hours 3 min ago
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

What do you mean with 50 packets? Please clarify it and provide a BLE sniffer capture, so that we can understand what is happening over the air. Can you please check if the device is adverting and provide a screenshot from the Power Profiler of SmartSnippets toolbox?

You mentioned that this issue is occurred only if you are using extended sleep mode. Are you using any peripheral block ( I2C , SPI ec) ? If yes, all the peripheral domains are shut down in any of the sleep modes.

Thanks, PM_Dialog

Rajapurerohit
Offline
Last seen:5 months 4 weeks ago
加入:2017-04-20 09:17
Hi PM_Dialog,

Hi PM_Dialog,

50包意味着我发送一个接一个包another device, the packets contain the BDA of other device and it's controlling value other than this nothing else.[for example in mnf_data_update() function I am sending - "80EACA0101017F" packets to another device].

And, Yes, I have peripheral block using I2C, timer and I know very well that peripheral does not work in sleep, I know everything I have managed that part.

And I told for sleep configuration I have referred ble_app_sleepmode example in my custom code that is working fine without issue.

My question is after wake up from sleep how to send packets to another device? And How can stay awake when I am connecting to a device? (means I want when device POR did it should stay awake for some time and go to sleep unless until there is interrupt)-I am waiting for this response.

Thanks for understanding

Rohit R

Rajapurerohit
Offline
Last seen:5 months 4 weeks ago
加入:2017-04-20 09:17
Hi PM_Dialog,

Hi PM_Dialog,

Any update regarding the previous question?

Thanks and Regards

Rohit R

PM_Dialog
Offline
Last seen:9 hours 3 min ago
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

>>>My question is after wake up from sleep how to send packets to another device?

Could you please clarify what you are trying to accomplish? Is it connectable, or not connectable application? You can place data into the advertising or scan response data, or send them through notifications/indication to the peer device.

>>>And How can stay awake when I am connecting to a device?

如果您正在使用任何configuratio睡觉n setup, the device will wake up automatically via the BLE timer between connection intervals. If no sleep mode is used, the device will always wake up.

>>>means I want when device POR did it should stay awake for some time and go to sleep unless until there is interrupt

When the chip is advertising or when it is connected?

Thanks, PM_Dialog

Rajapurerohit
Offline
Last seen:5 months 4 weeks ago
加入:2017-04-20 09:17
Hi PM_Dialog,

Hi PM_Dialog,

Thanks for the response,

>> Could you please clarify what you are trying to accomplish? Is it connectable, or not connectable application? You can place data into the advertising or scan response data, or send them through notifications/indication to the peer device.

- My device is a sensor-based light controlling device, this device is battery operated and should work with minimum possible power consumption. My device should be a connection base and it should send data through advertising packets. I want to connect and assigns some settings through one of the Characteristics and advertise controlling data (send packets to another device) using mnf_data_update().

>> If you are using any of the sleep configuration setups, the device will wake up automatically via the BLE timer between connection intervals. If no sleep mode is used, the device will always wake up.

- I referred ble_app_sleepmode() example for sleep configuration. During advertising user_app_adv_start() function called arch_set_extended_sleep(). And wakeup using sensor pin signal low interrupt detection and start advertising

>>>means I want when device POR did it should stay awake for some time and go to sleep unless until there is interrupt When the chip is advertising or when it is connected?

- when POR is done stay awake for a few seconds and then go to sleep. If the user tries to connect then stay awake and remain is wake up state until and unless device disconnects from App. And also it should wakeup on interrupt (sensor pin signal low interrupt detection and start advertising) send all packets and once packets over again go back to sleep.

Thanks and Regards

Rohit R

Rajapurerohit
Offline
Last seen:5 months 4 weeks ago
加入:2017-04-20 09:17
Hi PM_Dialog,

Hi PM_Dialog,

Any update to my previous question.

Thanks and Regards

Rohit R

PM_Dialog
Offline
Last seen:9 hours 3 min ago
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

In all our SDK example, the device starts adverting be default. The it is up to the user if the chip operates either in sleep or active mode. If is configured in sleep mode, then it will sleep between advertising or connection intervals and it will wake up via the BLE timer.

You mentioned that : when POR is done stay awake for a few seconds and then go to sleep.

Do you mean that the device will start advertising for a while without sleeping? If yes, you should change the app_default_sleep_mode variable. When it goes into sleep, do you mean that you want to stop advertising and put in in extended sleep mode?

Thanks, PM_Dialog

Rajapurerohit
Offline
Last seen:5 months 4 weeks ago
加入:2017-04-20 09:17
Hi PM_Dialog,

Hi PM_Dialog,

Please try to understand my application first and then you can help me better with regards to this,

My Application for my Device: I want a BLE peripheral based application with sleep mode enabled. My device is a kind of event-based Sensor Host where the sensor is programmed in such a way that it interrupts (this interrupt is nothing but event) the dialog MCU whenever there is some data available for MCU.

Please note that the sensor is I2C based.

Whenever the MCU is interrupted it should wake up from the sleep and check any data on I2C from the sensor. If yes, then send controlling packets through advertising.

这些广告包收集的点头es in the range(network) and react respectively I also have to provide the user with connection facility where a user has provision to change sensor parameter/read device status, this is done by the user by exchanging data over the characteristics in connection mode.

Now as I told earlier, My server host is battery operated, which has to work with the least possible power consumption so I am using sleep mode. Also, I know that in sleep all peripheral shut down.

Now, for this application design, I have referred the "ble_app_sleepmode" example to go to sleep and wakeup on interrupt. My application I set the device in sleep during advertising and wakeup on interrupt. After wakeup, I have again enabled my peripherals (I2C and Timer which I am using in the project).

In short, my device should work as mentioned below,

1)When powered upstart advertising for a few secs (example 15sec or 30sec) after few secs then stop advertising and send the device in sleep mode.

2)Now device only wakes up when there is interrupt from the sensor,

3) If MCU is interrupted, wake up, then check I2C data and start advertising again for a few seconds (15 to 30 secs). here while advertising if I2C data is valid update the user bytes in the advertising packet.

4) Now users can connect to the device whenever there such wakeup cycles. Also if the connection is established then the device should remain in the wake-up state until its disconnected.

5)If no connection request then goes to sleep (extended sleep means stop advertising)

6)If there no interrupt then the device should always in sleep (no advertise).

However, I am facing the below-mentioned issues so I request you to please help me to diagnose these issues and fix them.

1) when I set the device in extended sleep mode during advertising(as I am using DA14583), I am not able to connect to the device.
- For this, my question is how I can get maximum time to connect my App to the device?

2) After wakeup, I as said I want to send controlling node packets in advertising string. I am able to send only 1 packet but not all packets( as I explained about my packet in an earlier post)
- For this, my question is, after wakeup how I can send my all node packets in one shot and after completion of the packet device should go to extended sleep again?

Thanks and Regards

Rohit R

PM_Dialog
Offline
Last seen:9 hours 3 min ago
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

  1. Can you detect the device over the air? I would recommend using Power Profiler from the SmartSnippets toolbox in order to check if it is advertising.
  2. Do you mean that you would like to place your data into the advertising string, or send the data over notifications to the peer device? Could you please share a sniffer log in order to understand what is happening over the air? What is the amount of data should be sent over BLE?

Thanks, PM_Dialog