Skip to content

BT issue: Assert_warn and no serial connection possible, but pairs #5053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Shane87F3Ng opened this issue Apr 13, 2021 · 28 comments
Closed

BT issue: Assert_warn and no serial connection possible, but pairs #5053

Shane87F3Ng opened this issue Apr 13, 2021 · 28 comments
Labels
Area: BT&Wifi BT & Wifi related issues

Comments

@Shane87F3Ng
Copy link

Shane87F3Ng commented Apr 13, 2021

Make your question, not a Statement, inclusive. Include all pertinent information:

----------------------------- Remove above -----------------------------

Hardware:

Board: WEMOS LOLIN D32 PRO V2.0.0
Core Installation version: ?1.0.0? ?1.0.1-rc4? ?1.0.1? ?1.0.1-git? ?1.0.2? ?1.0.3?
IDE name: Arduino IDE?
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10 + Mac OSX

Description:

I cannot connect to the serial COM-port as soon as i use the 5.1 Bluetooth adapter. I can pair the esp32, but nothing more and the message/warning below occures. If i use a BT4.0 dongle, anything works fine without warning etc. and the connection is stable. Data transfer is possible with BT4.0, but i need to use the new adapter because of multiconnect.

How can is solve this? What does the warning actually mean?

Best regards

Sketch: (leave the backquotes for code formatting)

//Change the code below by your sketch

#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;

void setup() {
  Serial.begin(115200);
  SerialBT.begin("ESP32test"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
}

void loop() {
  if (Serial.available()) {
    SerialBT.write(Serial.read());
  }
  if (SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

### Debug Messages:
[I][BluetoothSerial.cpp:539] _init_bt(): device name set
The device started, now you can pair it with bluetooth!
[I][BluetoothSerial.cpp:228] esp_spp_cb(): ESP_SPP_INIT_EVT
[I][BluetoothSerial.cpp:231] esp_spp_cb(): ESP_SPP_INIT_EVT: slave: start
[I][BluetoothSerial.cpp:315] esp_spp_cb(): ESP_SPP_START_EVT
ASSERT_WARN(103 23), in lc_task.c at line 8775ASSERT_WARN(103 24), in lc_task.c at line 8775
@Shane87F3Ng Shane87F3Ng changed the title Hi all, BT 5.1 dongle issue: Assert_warn and no serial connection possible Apr 13, 2021
@Shane87F3Ng Shane87F3Ng changed the title BT 5.1 dongle issue: Assert_warn and no serial connection possible BT 5.1 dongle issue: Assert_warn and no serial connection possible, but pairs Apr 13, 2021
@Shane87F3Ng Shane87F3Ng changed the title BT 5.1 dongle issue: Assert_warn and no serial connection possible, but pairs BT issue: Assert_warn and no serial connection possible, but pairs Apr 13, 2021
@societyofrobots
Copy link

@VojtechBartoska VojtechBartoska added the Area: BT&Wifi BT & Wifi related issues label Apr 21, 2021
@Shane87F3Ng
Copy link
Author

Try NimBLE.

This is what I use:
https://github.com/h2zero/NimBLE-Arduino/tree/master/examples/Refactored_original_examples/BLE_uart

Thanks for your reply!
As i try to use BT-serial, i think it is not possible with BLE? Thought i have to use BT-classic?

@societyofrobots
Copy link

I use NimBLE for passing serial.

Use this to declare it a serial port:
pAdvertising->addServiceUUID((uint16_t)0x1101);

before you start advertising:
BLEDevice::startAdvertising();

@Metaln00b
Copy link

Same problem here with 1.0.6:
No connection possible. Using 1.0.4 no problem.

02:22:10.444 -> ets Jun  8 2016 00:22:57
02:22:10.444 -> 
02:22:10.444 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
02:22:10.492 -> flash read err, 1000
02:22:10.492 -> ets_main.c 371 
02:22:10.828 -> ets Jun  8 2016 00:22:57
02:22:10.828 -> 
02:22:10.828 -> rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
02:22:10.828 -> configsip: 0, SPIWP:0xee
02:22:10.828 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
02:22:10.828 -> mode:DIO, clock div:1
02:22:10.876 -> load:0x3fff0018,len:4
02:22:10.876 -> load:0x3fff001c,len:1044
02:22:10.876 -> load:0x40078000,len:10124
02:22:10.876 -> load:0x40080400,len:5856
02:22:10.876 -> entry 0x400806a8
02:22:11.161 -> Setup
02:22:11.161 -> [D][ESP32-BT.ino:66] ledc_init(): ledc_channel_config returned 0
02:22:11.209 -> [D][ESP32-BT.ino:75] ledc_init(): ledc_timer_set: divider: 0x3d090 duty_resolution: 10
02:22:11.209 -> 
02:22:11.209 -> [D][ESP32-BT.ino:66] ledc_init(): ledc_channel_config returned 0
02:22:11.209 -> [D][ESP32-BT.ino:75] ledc_init(): ledc_timer_set: divider: 0x3d090 duty_resolution: 10
02:22:11.209 -> 
02:22:12.692 -> [I][BluetoothSerial.cpp:571] _init_bt(): device name set
02:22:12.692 -> [I][BluetoothSerial.cpp:243] esp_spp_cb(): ESP_SPP_INIT_EVT
02:22:12.692 -> [I][BluetoothSerial.cpp:246] esp_spp_cb(): ESP_SPP_INIT_EVT: slave: start
02:22:12.692 -> [I][BluetoothSerial.cpp:347] esp_spp_cb(): ESP_SPP_START_EVT

ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
...

@Shane87F3Ng
Copy link
Author

Same problem here with 1.0.6:
No connection possible. Using 1.0.4 no problem.

02:22:10.444 -> ets Jun  8 2016 00:22:57
02:22:10.444 -> 
02:22:10.444 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
02:22:10.492 -> flash read err, 1000
02:22:10.492 -> ets_main.c 371 
02:22:10.828 -> ets Jun  8 2016 00:22:57
02:22:10.828 -> 
02:22:10.828 -> rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
02:22:10.828 -> configsip: 0, SPIWP:0xee
02:22:10.828 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
02:22:10.828 -> mode:DIO, clock div:1
02:22:10.876 -> load:0x3fff0018,len:4
02:22:10.876 -> load:0x3fff001c,len:1044
02:22:10.876 -> load:0x40078000,len:10124
02:22:10.876 -> load:0x40080400,len:5856
02:22:10.876 -> entry 0x400806a8
02:22:11.161 -> Setup
02:22:11.161 -> [D][ESP32-BT.ino:66] ledc_init(): ledc_channel_config returned 0
02:22:11.209 -> [D][ESP32-BT.ino:75] ledc_init(): ledc_timer_set: divider: 0x3d090 duty_resolution: 10
02:22:11.209 -> 
02:22:11.209 -> [D][ESP32-BT.ino:66] ledc_init(): ledc_channel_config returned 0
02:22:11.209 -> [D][ESP32-BT.ino:75] ledc_init(): ledc_timer_set: divider: 0x3d090 duty_resolution: 10
02:22:11.209 -> 
02:22:12.692 -> [I][BluetoothSerial.cpp:571] _init_bt(): device name set
02:22:12.692 -> [I][BluetoothSerial.cpp:243] esp_spp_cb(): ESP_SPP_INIT_EVT
02:22:12.692 -> [I][BluetoothSerial.cpp:246] esp_spp_cb(): ESP_SPP_INIT_EVT: slave: start
02:22:12.692 -> [I][BluetoothSerial.cpp:347] esp_spp_cb(): ESP_SPP_START_EVT

ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
ASSERT_WARN(103 24), in lc_task.c at line 877
...

Yes, 1.0.4 is doing the trick, so it seems there is a problem with the newer versions

@stale
Copy link

stale bot commented Jul 8, 2021

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jul 8, 2021
@Shane87F3Ng
Copy link
Author

Will this issued bei focused in a future update? Maybe in 2.0.0 ?

@stale
Copy link

stale bot commented Jul 15, 2021

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

@stale stale bot removed the Status: Stale Issue is stale stage (outdated/stuck) label Jul 15, 2021
@stale
Copy link

stale bot commented Sep 19, 2021

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Sep 19, 2021
@alastaira
Copy link

Faced this issue today (or a very similar one, at least) - I can successfully use SerialBT to pair ESP32 to another, pin-protected, device (HC-05) and receive a stream of data just fine.
But, periodically (every few seconds), I receive an error printed to the serial output:
ASSERT_WARN(1 8), in lc_task.c at line 1394

All Google searches seem to point to this thread as being the only useful reference, and the only solution (to compile against v1.0.4 rather than v1.0.6), which feels unsatifactory, but does resolve the issue.

@zvikaf
Copy link

zvikaf commented Mar 15, 2022

Did you find any solution ? @alastaira ?

@Shane87F3Ng
Copy link
Author

I could not find any other solution than just use 1.0.4
Newer versions are still not working

@zvikaf
Copy link

zvikaf commented Mar 15, 2022

WOW bummer... :-(

@Shane87F3Ng Shane87F3Ng reopened this Mar 16, 2022
@alastaira
Copy link

Did you find any solution ? @alastaira ?

Nope, unfortunately not - just seems to be a regression bug in later versions - I had to go back to v1.0.4.

@Shane87F3Ng
Copy link
Author

Yes, i really hope they will fix it i a future update

@zvikaf
Copy link

zvikaf commented Mar 20, 2022

Went back to 1.0.4 warning indeed stopped, but the ESP now falsely acknowledge connection by address or by name .
checked 1.0.5, correctly connects, behaves like the 1.0.6

@VojtechBartoska
Copy link
Contributor

Hello , sorry for late reply. Are you able to test your issue on development version 2.0.3-RC1 to check if this is still valid? You can take a look on Docs where is explained how to choose development release version in Arduino IDE.

@VojtechBartoska VojtechBartoska removed the Status: Stale Issue is stale stage (outdated/stuck) label Mar 30, 2022
@Shane87F3Ng
Copy link
Author

Thanks for your answer!!

I can do that on next monday, until then i am away, but maybe one of the others can check it earlier :)

@alastaira
Copy link

@VojtechBartoska I just tried compiling against the latest 2.0.3-RC1 but unfortunately the issue remains for me. The only difference is the line number on which it occurs ;)

ASSERT_WARN(1 8), in lc_task.c at line 1409

@VojtechBartoska
Copy link
Contributor

@alastaira Thanks for testing. I have added this to our Roadmap and we will investigate into this more.

@alastaira
Copy link

@VojtechBartoska And thankyou for your attention - it's much appreciated :)

@nabe-abk
Copy link

One way to solve this problem is to change the sdk build options.

Original

# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set
CONFIG_BTDM_CTRL_MODE_BTDM=y

Solved

# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y
# CONFIG_BTDM_CTRL_MODE_BTDM=y

@ricardoquesada
Copy link

Might be a duplicate from this one: #6193

@VojtechBartoska VojtechBartoska added the Status: Needs investigation We need to do some research before taking next steps on this issue label May 4, 2022
@Shane87F3Ng
Copy link
Author

@ricardoquesada yes it is, as @alastaira already wrote before, these problems are definetly related and it does not matter what kind of tasks you try to do, it happens even while purely connecting, if you look at my example code above (first post)

@VojtechBartoska could it be related to the esp-wroom revision we are using?

@Shane87F3Ng
Copy link
Author

One way to solve this problem is to change the sdk build options.

Original

# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set
CONFIG_BTDM_CTRL_MODE_BTDM=y

Solved

# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y
# CONFIG_BTDM_CTRL_MODE_BTDM=y

How can it be done?

@ricardoquesada
Copy link

@Shane87F3Ng ty.

That can be done from idf.py menuconfig -> "components" -> "bluetooth" and only select BR/EDR (not dual stack)

but it didn't work for me. I'm still getting the ASSERT_WARN(103 23), in lc_task.c at line messages with BR/EDR only stack.

@nabe-abk
Copy link

nabe-abk commented May 8, 2022

I rewrote "sdkconfig" directly without using "menuconfig" for rebuilding ESP-IDF v4.4 SDK.
It works on Windows10 with BT5.0 adapter on Arudino-esp32 v2.0.x (replaced sdk with it).

@Parsaabasi Parsaabasi removed the Status: Needs investigation We need to do some research before taking next steps on this issue label Jan 16, 2025
@Parsaabasi
Copy link

Hello,

Due to the overwhelming volume of issues currently being addressed, we have decided to close the previously received tickets. If you still require assistance or if the issue persists, please don't hesitate to reopen the ticket.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BT&Wifi BT & Wifi related issues
Projects
Development

No branches or pull requests

9 participants