Open oufei19 opened 1 year ago
Hi @oufei19 ,
Can you please share more information.
Hi @oufei19 ,
Can you please share more information.
- Which release version is being used ?
- Which chip is being used ?
- Is the issue seen by using existing examples in IDF ? . May be bleprph ?
- Can you share application level changes done at your end after which issue is seen.
- Is it possible to get and Over the Air logs ?
- Do you have any debug enabled console logs for the run ?
idf 5.0.2 Esp32 c2 it is have none example used C2 ,and none example in IDF about C2 update adv datas. for debug it , I will provide the test example .,it is the same as my codes, can you help me to debug it? spp_server_adv_updata.zip
Hi @oufei19 ,
Thanks for the codes. The code has uart specific changes and taking the code as is causing garbage value to be shown on screen. So, went ahead and took only advertising related changes from your code. I saw that the adv report is always shown up on nrfconnect app of the phone.
However, please note that your original image has device name as Health Scale 5 and other details, but the adv data shared in the example file is of the below format, where address and name gets modified later on. I assume this difference is intended as you attached just sample code and not your exact working code ?
uint8_t raw_adv_data[ADV_LENGHT_MAX] = { / flags / 0x02, 0x01, 0x06, / service uuid / 0x05, 0x02, 0xf0,0xff,0x12,0x18, / service uuid / 0x14, 0xff, 0x00, 0x00, / mac addr / 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, / data / 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, };
Since am not able to see the mentioned behaviour, it would help if you could give some more detailed logs:
Please enable Debug logs for ESP chip. You can do the same via Component Config --> Log Output --> Default Log Verbosity --> Debug Component Config --> Bluetooth --> NimBLE Options --> NimBLE Host log verbosity --> Debug Logs
Do you have any OTA logs that can be shared ?
When you observe incomplete data, can you press on the "raw" data on the remote side to show the adv report data recieved in hex ?
Adv report would ideally go in one packet. So, whatever data is sent, should be seen in its whole ( and not just partial )
Hi @oufei19 ,
Thanks for the codes. The code has uart specific changes and taking the code as is causing garbage value to be shown on screen. So, went ahead and took only advertising related changes from your code. I saw that the adv report is always shown up on nrfconnect app of the phone.
However, please note that your original image has device name as Health Scale 5 and other details, but the adv data shared in the example file is of the below format, where address and name gets modified later on. I assume this difference is intended as you attached just sample code and not your exact working code ?
uint8_t raw_adv_data[ADV_LENGHTMAX] = { /* flags / 0x02, 0x01, 0x06, / service uuid / 0x05, 0x02, 0xf0,0xff,0x12,0x18, / service uuid / 0x14, 0xff, 0x00, 0x00, / mac addr / 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /_ data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, };
Since am not able to see the mentioned behaviour, it would help if you could give some more detailed logs:
- Please enable Debug logs for ESP chip. You can do the same via Component Config --> Log Output --> Default Log Verbosity --> Debug Component Config --> Bluetooth --> NimBLE Options --> NimBLE Host log verbosity --> Debug Logs
- Do you have any OTA logs that can be shared ?
- When you observe incomplete data, can you press on the "raw" data on the remote side to show the adv report data recieved in hex ?
Adv report would ideally go in one packet. So, whatever data is sent, should be seen in its whole ( and not just partial )
the project code need run in my hardware.so I provide the example project to debug,it is the same functions of my project.
1.example project issue: start runing ,its don
t update adv datas contiune up 10S.after that ,the BLE adv is normal run.However, there are cases of lost adv packets and whe use nrf connect scan the adv ,it is display adv interval N/A
please help me to Analyze the problem spp_server_adv_updata.zip Debug Log.txt
Hi @oufei19 ,
I have some suggestions that you can do to first correct the application.
The app_adv_data_init is setting both data and scan response. Please confirm the requirement. If remote device adv reports, it shows the adv data of the reports. When it performs scan request, it will get the scan response which it will then show up. So, it will now be on remote device implementation to show up the adv report data and scan response data.
In your code, in a loop , i observe that you have only invoked the function to set_data. This will not cause any change. The correct flow should rather be: a. Set data b. Start advertising. c. Stop advertising d. Set new data e. Start advertising.
Basically ,just setting data won't have the effect, unless you stop / start advertising.
In the log you shared, the first time advertising happens around line number 503.
^[[0;32mI (2147) APP_ADV: ble_spp_server_advertise^[[0m ^[[0;32mI (2157) NimBLE: GAP procedure initiated: advertise; ^[[0m ^[[0;32mI (2157) NimBLE: disc_mode=2^[[0m ^[[0;32mI (2167) NimBLE: adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=160 adv_itvl_max=160^[[0m ^[[0;32mI (2187) NimBLE:
So, the adv data set before this instance is the only one that got sent from host to controller. (Line 458 - 500 ).
After this, as mentioned above, no matter how many times your application sets adv data, it never gets transmitted.
Hi @oufei19 ,
I have some suggestions that you can do to first correct the application.
- The app_adv_data_init is setting both data and scan response. Please confirm the requirement. If remote device adv reports, it shows the adv data of the reports. When it performs scan request, it will get the scan response which it will then show up. So, it will now be on remote device implementation to show up the adv report data and scan response data.
- In your code, in a loop , i observe that you have only invoked the function to set_data. This will not cause any change. The correct flow should rather be: a. Set data b. Start advertising. c. Stop advertising d. Set new data e. Start advertising.
Basically ,just setting data won't have the effect, unless you stop / start advertising.
In the log you shared, the first time advertising happens around line number 503.
^[[0;32mI (2147) APP_ADV: ble_spp_server_advertise^[[0m ^[[0;32mI (2157) NimBLE: GAP procedure initiated: advertise; ^[[0m ^[[0;32mI (2157) NimBLE: disc_mode=2^[[0m ^[[0;32mI (2167) NimBLE: adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=160 adv_itvl_max=160^[[0m ^[[0;32mI (2187) NimBLE:
So, the adv data set before this instance is the only one that got sent from host to controller. (Line 458 - 500 ).
After this, as mentioned above, no matter how many times your application sets adv data, it never gets transmitted.
Hi @rahult-github
Answers checklist.
General issue report
I using NimBLE ,and set adv interval 100ms. adv data update period time 250ms.
when I call the function : ble_gap_adv_set_data(raw_adv_data, raw_adv_len) to update adv datas.But sometimes there is no adv data (used NRF connect) and the APP cannot scan it (N/A).
then,I try to update it (ble_gap_adv_stop(); ble_gap_adv_start();) but it is none change why?
no advertising data,As shown in the figure below
Below is a normal advertising