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.
我已经在扩展睡眠模式下配置了设备,并使用传感器引脚信号低中断唤醒。为此,我遵循BLE_APP_SLEEPMODE SDK示例以获取睡眠配置。
在广告期间,我在扩展睡眠模式下发送了设备。(即,在函数user_app_adv_start()中),并使用传感器引脚唤醒低检测并再次启动广告。
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 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
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
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
Hi PM_Dialog,
Any update regarding the previous question?
Thanks and Regards
Rohit R
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
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
Hi PM_Dialog,
Any update to my previous question.
Thanks and Regards
Rohit R
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
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.
这些广告数据包由范围(网络)中的节点收集,并分别反应,我还必须向用户提供用户具有改变传感器参数/读取设备状态的连接设施,这是通过交换数据来完成的在连接模式下的特征。
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)如果没有连接请求,那么睡眠(延长睡眠意味着停止广告)
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)唤醒后,我说我想在广告字符串中发送控制节点报文。我能够只发送1个数据包但不是所有数据包(因为我在早期帖子中解释了我的数据包)
- 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
Hi Rohit,
Thanks, PM_Dialog