Send manufacturer update data packets after wakeup

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
10 posts / 0 new
Last post
Rajapurerohit
Offline
Last seen:8 months 2 weeks ago
加入:2017-04-20 09:17
Send manufacturer update data packets after wakeup

大家好,

我正在研究DA14583睡眠配置。

我为我定制的代码开发,用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.

- 我想将控制数据包发送到另一个设备(几乎我有50个我需要发送到另一个设备的数据包)。我正在使用更新制造商函数来执行此操作。

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.

感谢致敬

Rohit R.

设备:
PM_Dialog
Offline
Last seen:1天11小时前
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

你的意思是50包?请澄清它并提供BLE嗅探器捕获,以便我们能够理解空中发生的事情。您是否可以检查设备是否已被遵循并提供SmartSnippets Toolbox的电源分布器的屏幕截图?

您提到才会在使用扩展睡眠模式时发生此问题。您是否使用任何外围块(I2C,SPI EC)?如果是,则所有外围域都会在任何睡眠模式中关闭。

Thanks, PM_Dialog

Rajapurerohit
Offline
Last seen:8 months 2 weeks ago
加入:2017-04-20 09:17
嗨pm_dialog,

嗨pm_dialog,

50个数据包是指我向另一个设备发送一个数据包,该数据包包含其他设备的BDA,而它的控制值除此以外。设备]。

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.

我告诉睡眠配置我在我的自定义代码中引用了BLE_APP_SLEEPMODE示例,没有问题。

我的问题是从睡眠唤醒后如何将数据包发送到另一个设备?当我连接到设备时,如何保持清醒?(意思是我想要当设备POR完成时应该保持清醒一段时间并睡觉,除非直到有中断) -I am waiting for this response.

感谢您的理解

Rohit R.

Rajapurerohit
Offline
Last seen:8 months 2 weeks ago
加入:2017-04-20 09:17
嗨pm_dialog,

嗨pm_dialog,

Any update regarding the previous question?

感谢致敬

Rohit R.

PM_Dialog
Offline
Last seen:1天11小时前
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

>>>我的问题是从睡眠唤醒后如何将数据包发送到另一个设备?

你能澄清你想要完成的事情吗?它是可连接的,还是不可连接的应用程序?您可以将数据放入广告或扫描响应数据,或通过向对等设备的通知/指示发送它们。

>>>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:8 months 2 weeks ago
加入:2017-04-20 09:17
嗨pm_dialog,

嗨pm_dialog,

谢谢你的回应,

>>你能澄清你想要完成的事情吗?它是可连接的,还是不可连接的应用程序?您可以将数据放入广告或扫描响应数据,或通过向对等设备的通知/指示发送它们。

- 我的设备是一种基于传感器的光控制装置,该装置是电池供电,应使用最小可能的功耗。我的设备应该是连接基础,它应该通过广告数据包发送数据。我想通过一个特征连接和分配一些设置,并使用mnf_data_update()将数据(发送数据包发送到另一个设备)。

>>如果您使用的是任何睡眠配置设置,设备将通过连接间隔之间的BLE定时器自动唤醒。如果没有使用睡眠模式,则设备将始终唤醒。

- 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

>>>意味着我想要当设备POR完成时应该保持清醒一段时间并睡觉,除非在芯片广告或连接时存在中断,否则

- 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.

感谢致敬

Rohit R.

Rajapurerohit
Offline
Last seen:8 months 2 weeks ago
加入:2017-04-20 09:17
嗨pm_dialog,

嗨pm_dialog,

Any update to my previous question.

感谢致敬

Rohit R.

PM_Dialog
Offline
Last seen:1天11小时前
Staff
加入:2018-02-08 11:03
Hi Rohit,

Hi Rohit,

在所有SDK示例中,设备将默认启动adverting。如果芯片在睡眠或活动模式下运行,则由用户取决于用户。如果在睡眠模式下配置,则它将在广告或连接间隔之间睡眠,并且它将通过BLE定时器唤醒。

你提到说:当Por完成时,保持醒来几秒钟,然后去睡觉。

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:8 months 2 weeks ago
加入:2017-04-20 09:17
嗨pm_dialog,

嗨pm_dialog,

请首先尝试了解我的申请,然后您可以更好地帮助我,

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.

These advertising packets are collected by the nodes 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.

现在,对于此应用程序设计,我提到了“BLE_APP_SLEEPMODE”示例进行睡眠和唤醒中断。我的应用程序我在广告和唤醒中,在中断时将设备设置在睡眠状态。唤醒后,我再次启用我的外围设备(我在项目中使用的i2c和timer)。

In short, my device should work as mentioned below,

1)在几秒钟之后(例15SEC或30SEC)的电源UPSTART通告后,然后停止广告并在睡眠模式下发送设备。

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)现在用户可以随时随地连接到设备。此外,如果建立连接,那么设备应保留在唤醒状态,直至断开连接。

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)当我在广告期间在扩展睡眠模式下设置设备时(如我使用DA14583),我无法连接到设备。
- 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?

感谢致敬

Rohit R.

PM_Dialog
Offline
Last seen:1天11小时前
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. 您是否意味着您希望将数据放入广告字符串中,或​​将数据发送到对等设备的通知?您能否分享一个嗅探器日志,以了解在空中发生的事情?应该通过ble发送数据量是多少?

Thanks, PM_Dialog