Skip to content
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

Bluetooth BT BLE devives not recognized / found by Tasmota @ V 14.0.0 #21445

Closed
8 of 13 tasks
Rushmed opened this issue May 19, 2024 · 24 comments · Fixed by #21451
Closed
8 of 13 tasks

Bluetooth BT BLE devives not recognized / found by Tasmota @ V 14.0.0 #21445

Rushmed opened this issue May 19, 2024 · 24 comments · Fixed by #21451

Comments

@Rushmed
Copy link

Rushmed commented May 19, 2024

PROBLEM DESCRIPTION

A clear and concise description of what the problem is.
No bluetooth devices found on Tasmota V14.
V13.4 was working fine.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • [] Device used (e.g., Sonoff Basic): _____
  • Tasmota binary firmware version number used: 14.0.0_____
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: OTA_____
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:

  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:

  • Provide the output of this command: Status 0:
  STATUS 0 output here:

  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:

TO REPRODUCE

Have a ESP32 with Tasmota installed, BT activated and some Mi BT Sensors or iBeacons nearby. On V13.4 they`re recognized.
On V14 nothing is recognized.

EXPECTED BEHAVIOUR

All bt deviches (mi senors, ibeacons) need to be recognized.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Check this discussion:
#21328
Whats the time plan for a solution?
Thanks in further!

(Please, remember to close the issue when the problem has been addressed)

@Mark-Muc
Copy link

Hello . I have nearly the same problem.
I compile a latest version (14.0.0.1 dev) and run it on a ESP32 device (Sonoff SwitchMan 2C) configurated as shutter.
After i updated to 14.0.0.1 dev. The device getting (respond) getting terribly slow and NO BLE devices show up. Switch back to 13.4.0 (stable) everything works fine and the BLE devices show up.
Compile with:
image

Regards
Mark_Muc

@kroon040
Copy link

kroon040 commented May 20, 2024

Same issue here. I have more devices with bluetooth and all lost connection with tasmota 14, reverting back to 13.4 resolves the issue. Also a issue for the EQ3 devices

v14.0

10:23:58.530 BLE: scan stall? no adverts > 120s, restart BLE
10:23:58.537 BLE: BLETask: Restart NimBLE - restart Tasmota in 10 if not complt
10:23:58.541 BLE: Task:Stopping NimBLE
10:23:58.664 BLE: BLETask:Starting NimBLE
10:23:59.547 MQT: tele/rolluikslaap1/BLE = {"blerestart":"no adverts in 120s"} (retained)
10:23:59.549 BLE: Failure! Restarting BLE Stack because no adverts in 120s
10:25:59.533 BLE: scan stall? no adverts > 120s, restart BLE
10:25:59.630 BLE: BLETask: Restart NimBLE - restart Tasmota in 10 if not complt
10:25:59.636 BLE: Task:Stopping NimBLE
10:25:59.757 BLE: BLETask:Starting NimBLE

@Jason2866
Copy link
Collaborator

@btsimonh Can you have a look?

@btsimonh
Copy link
Contributor

looks like NimBLE may have some issues to be resolved to work well with core 3.0.0
h2zero/NimBLE-Arduino#645

I think we should wait to see how @h2zero progresses....

@Jason2866
Copy link
Collaborator

Jason2866 commented May 20, 2024

@btsimonh wrong repo. Tasmota does not use NimBLE-Arduino anymore.
Moved to https://github.com/h2zero/esp-nimble-cpp.
The issue you mentioned is not relevant for esp-nimble-cpp
The MI driver from Staars does work well with esp-nimble-cpp and Arduino Core 3.0.0
"Only" the classic Tasmota BLE driver is not working.

@Rushmed Rushmed changed the title Bloetooth BT BLE devives not recognized / found by Tasmota @ V 14.0.0 Bluetooth BT BLE devives not recognized / found by Tasmota @ V 14.0.0 May 20, 2024
@btsimonh
Copy link
Contributor

ahh... ok. So just taking a quick look at the source, there are really no changes to account for changing library? I guess the NimBLE classes and structures are identical in both cases...
I build the firmware and confirm the above - adverts are not all being seen. It DID see one from an EQ3, but then failed to connect to the EQ3. So it looks like the stack is working a bit, just the radio not working too well.
We could look at changes to the wifi/BLE sharing methods in core 3.0.0?

@Jason2866
Copy link
Collaborator

There are some small changes made to make the BLE driver compile with Arduino Core 3.0.0 and h2zero lib esp-nimble-cpp. Take a look at the commits.

@btsimonh
Copy link
Contributor

yep, spotted it. NimBLE-arduino had a separate scan end callback, set in a different way. Your commits meant that it was never called. Just testing a change now, so let's see....
(the scan end callback caused the start of another scan. so basically, currently scan once at start, and never again - and it's the scanning which hears adverts)

@Rushmed
Copy link
Author

Rushmed commented May 20, 2024

Thanks a lot!
When will the fix be available in precompiled files. Next version?

@Jason2866
Copy link
Collaborator

@Rushmed It is already here in section development https://tasmota.github.io/install/

@btsimonh
Copy link
Contributor

@Rushmed @kroon040 @Mark-Muc - pls report success here.
For me, the mods showed my one pvv temp+hum sensor which was close, and 6 EQ3, 3 of which connection failed because of low signal, but the other three happily read valve position, etc. indicating connections success. (EQ3 connection is always a little dodgy - an ideal device to stress tas's BLE stack! ).
I didn't test aliasing or any other features - but nothing has changed there, so all should be good.

@kroon040
Copy link

@btsimonh ,

I got 4 EQ3 devices and 4 LYWSD03MMC devices. All the devices are working, also valve position and desired temp. Also aliasing also still works. I See one device he just needs to try 3 times and than it connects.

@Mark-Muc
Copy link

Just to let you know. I also built today a version in the dev. brache and all BLE derives are visible.
one slight problem:
if u use a "." (dot) in the aliasing . like:
BLEAlias E72E0050A0CC=1.OG_Bad A4C1382D29C3=1.OG_Arbeit_2

it shows in the UI like that:
image
image

as u can see it shows a "," (coma) instead of a "." (dot)
it is also in the version: 13.4.0 final.
Mark_Muc

@arendst
Copy link
Owner

arendst commented May 21, 2024

That's the auto decimal kicking in. It replaces a dot by a comma for Germany :-)

Let me see if it can be easily fixed....

arendst added a commit that referenced this issue May 21, 2024
@arendst
Copy link
Owner

arendst commented May 21, 2024

Try latest dev.

@btsimonh
Copy link
Contributor

I wish CSV import in Excel different countries was fixed so easily and quickly!

@Mark-Muc
Copy link

Try latest dev.

did and looked good!!
image
that was fast and quick!!
Thx & Regards
Mark

@Mark-Muc
Copy link

Mark-Muc commented May 21, 2024

but i do have an other problem.
not belog to the "bluetooth bug".
I foud out, that he newer versions of tasmota now connect my device (Sonoff SwitchMan 2C) now connect to my AP in
Mode HT40
image

bevor it connected to my AP in
Mode 11n
image

I think that will be the reason why it device is laging like hell.
The informiation of the device:
image

in my Fritz.Box it connects like:
image

if it's not the right place .. pls be so kind to move it!

Mark_Muc

@arendst
Copy link
Owner

arendst commented May 21, 2024

Well core3 does support both n (=HT20) and HT40 depending on your wifi AP. Reconfig your AP to HT20 and it should connect to HT20 (at least that's what my ubiquiti does.)

@Jason2866
Copy link
Collaborator

The connection mode is most probably not the reason for your devices being laggy.
It is Bluetooth. Bluetooth and WiFi together enabled on an Esp32 is always problematic.

@Mark-Muc
Copy link

Mark-Muc commented May 22, 2024

Well core3 does support both n (=HT20) and HT40 depending on your wifi AP. Reconfig your AP to HT20 and it should connect to HT20 (at least that's what my ubiquiti does.)

seems that this is not the issue .. fount out.
If u use a fresh installed 32bit device . flashed it with the webflasher included the final with Bluetooth.
it works with the network and no lagging.
BUT
if i restore my config .. the it is lagging like hell.
Found out:
If u upload to the filesystem it happens.
i.e. I upload a file called: autoexec.bat the device hangs / lagging.
autoexec.bat contains:

Mi32Option6 1
MI32Page 10
MI32Block A4C138465A57
MI32Block E7764500F442
BLEAlias 150311116C66=LYWSD02-1 A4C138AF4A0B=Temp&Hum(LYWSD03MMC) E72E0050A0CC=1.OG_Bad A4C138465A57=Pavillion_innen A4C1382D29C3=1.OG_Arbeit_2 A4C1389C4D2A=Thermostat
shutteropen

asap it hangs after upload.

It is fine in 13.4.0!!
Regards Mark
PS: I can provide my safed .DMP file.

@Rushmed
Copy link
Author

Rushmed commented May 29, 2024

@Rushmed It is already here in section development https://tasmota.github.io/install/

Thanks, how can I download the .bin file? I have to flash OTA.

@Jason2866
Copy link
Collaborator

Via official Tasmota OTA server https://ota.tasmota.com/tasmota32/

@Rushmed
Copy link
Author

Rushmed commented May 29, 2024

@Rushmed @kroon040 @Mark-Muc - pls report success here. For me, the mods showed my one pvv temp+hum sensor which was close, and 6 EQ3, 3 of which connection failed because of low signal, but the other three happily read valve position, etc. indicating connections success. (EQ3 connection is always a little dodgy - an ideal device to stress tas's BLE stack! ). I didn't test aliasing or any other features - but nothing has changed there, so all should be good.

Tasmota 14.0.0.3 (b61ea17-bluetooth) is working as expected. Thanks Sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants