Tasmota icon indicating copy to clipboard operation
Tasmota copied to clipboard

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

Open Rushmed opened this issue 1 year ago • 8 comments
trafficstars

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!

  • [x] Read the Contributing Guide and Policy and the Code of Conduct
  • [x] Searched the problem in issues
  • [x] Searched the problem in discussions
  • [x] Searched the problem in the docs
  • [x] Searched the problem in the chat
  • [] Device used (e.g., Sonoff Basic): _____
  • [x] Tasmota binary firmware version number used: 14.0.0_____
    • [x] Pre-compiled
    • [ ] Self-compiled
  • [x] 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: https://github.com/arendst/Tasmota/discussions/21328 Whats the time plan for a solution? Thanks in further!

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

Rushmed avatar May 19 '24 22:05 Rushmed

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

Mark-Muc avatar May 20 '24 07:05 Mark-Muc

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

kroon040 avatar May 20 '24 09:05 kroon040

@btsimonh Can you have a look?

Jason2866 avatar May 20 '24 09:05 Jason2866

looks like NimBLE may have some issues to be resolved to work well with core 3.0.0 https://github.com/h2zero/NimBLE-Arduino/issues/645

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

btsimonh avatar May 20 '24 10:05 btsimonh

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

Jason2866 avatar May 20 '24 12:05 Jason2866

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?

btsimonh avatar May 20 '24 14:05 btsimonh

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.

Jason2866 avatar May 20 '24 14:05 Jason2866

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)

btsimonh avatar May 20 '24 15:05 btsimonh

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

Rushmed avatar May 20 '24 19:05 Rushmed

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

Jason2866 avatar May 20 '24 19:05 Jason2866

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

btsimonh avatar May 21 '24 05:05 btsimonh

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

kroon040 avatar May 21 '24 05:05 kroon040

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

Mark-Muc avatar May 21 '24 12:05 Mark-Muc

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 avatar May 21 '24 12:05 arendst

Try latest dev.

arendst avatar May 21 '24 12:05 arendst

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

btsimonh avatar May 21 '24 12:05 btsimonh

Try latest dev.

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

Mark-Muc avatar May 21 '24 12:05 Mark-Muc

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

Mark-Muc avatar May 21 '24 13:05 Mark-Muc

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

arendst avatar May 21 '24 13:05 arendst

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.

Jason2866 avatar May 21 '24 14:05 Jason2866

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.

Mark-Muc avatar May 22 '24 10:05 Mark-Muc

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

Rushmed avatar May 29 '24 15:05 Rushmed

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

Jason2866 avatar May 29 '24 16:05 Jason2866

@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!

Rushmed avatar May 29 '24 18:05 Rushmed

I do not know if this is related, but after upgrading my EQ3 to 14.2.0.6, my eQ3 devices are no longer connecting reliably.

I have 8 Xiaomi devices and 8 EQ3s. The Xiaomis (running ATC firmware) seem to work but the EQ3s just show 20:44:07.951 EQ3: 001A2208C9FA: trv operation failed - retrying -12 (with the respective device ID).

Interestingly, I see all 8 EQ3 TRVs right after a restart and they briefly show the correct temperatures in the WebUI. But then the connection starts failing and all values are set to 0.

Does anybody have similar issues?

EDIT: Reverted to 13.4.0 (http://ota.tasmota.com/tasmota32/release-13.4.0/tasmota32-bluetooth.bin) and it works again. So seems that something is broken in 14.2.0.6 again.

AleXSR700 avatar Oct 05 '24 18:10 AleXSR700