mariolukas / Bluetti_ESP32_Bridge

Bluetti Power Station ESP32 Bluetooth to MQTT Bridge
GNU General Public License v3.0
88 stars 29 forks source link

still no bluetooth connection for EB3A #25

Closed giovanne123 closed 1 year ago

giovanne123 commented 1 year ago

Compiled lastest code from today (FW in WebUI 0.1.0), still no bluetooth connection for EB3A without:

BTooth.cpp: Line 50: from: if (advertisedDevice.haveServiceUUID() && advertisedDevice.isAdvertisingService(serviceUUID) && advertisedDevice.getName().compare(settings.bluetti_device_id)) { to: if (advertisedDevice.haveServiceUUID() && advertisedDevice.isAdvertisingService(serviceUUID) && (strcmp(advertisedDevice.getName().c_str(),settings.bluetti_device_id)==0) ) {

Serial.out:

192.168.0.13
MDNS responder started
HTTP server started
BLE Advertised Device found: Name: EB3A224xxxxxxxxxxxxx, Address: dd:aa:bb:cc:97:c9, manufacturer data: 424c424c5545545449, serviceUUID: 0000ff00-0000-1000-8000-00805f9b34fb, rssi: -50
...
Connecting to MQTT at: 192.168.0.111:1883
Connected to MQTT Server... 
subscribe to topic: ac_output_on
subscribe to topic: dc_output_on
Client reconnected! Last message ID that it got is: 57002

No more output, not connected...

platformio.ini

PS C:\Users\Bluetti_ESP32_Bridge> pio pkg update Resolving esp32dev dependencies... Already up-to-date.

Had same behaviour also before in Arduino IDE


With the change implemented, it is connecting and reading:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13104
load:0x40080400,len:3036
entry 0x400805e4
deactivate relais contact
Loading Values from EEPROM
*wm:AutoConnect
*wm:Connecting to SAVED AP: MY_WLAN
*wm:connectTimeout not set, ESP waitForConnectResult... 
*wm:AutoConnect: SUCCESS 
*wm:STA IP Address: 192.168.0.13

IP address:
192.168.0.13
MDNS responder started
HTTP server started
BLE Advertised Device found: Name: EB3Axxxxxxxxxxxxxx6, Address: dd:aa:bb:cc:dd:c9, manufacturer data: 424c424c5545545449, serviceUUID: 0000ff00-0000-1000-8000-00805f9b34fb, rssi: -71
Connecting to MQTT at: 192.168.0.111:1883
Connected to MQTT Server... 
subscribe to topic: ac_output_on
subscribe to topic: dc_output_on
Forming a connection to dd:aa:bb:cc:dd:c9
 - Created client
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)
 - Connected to server
 - Found our service
[  3088][E][BLERemoteCharacteristic.cpp:289] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[  3089][E][BLERemoteCharacteristic.cpp:289] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
 - Found our Write characteristic
 - Found our Notifyite characteristic
activate relais contact
We are now connected to the Bluetti BLE Server.
Write Request FF02 - Value:  0103 000a 0028 65d6
F01 - Write Response
0103 5045 4233 4100 0000 0000 0000 0003
fb1f 6aa2 fe02 0b00 0000 0000 0021 fb00
0321 9700 0300 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 5d00 0000 0000 0000 0000 
0000 00d7 ba
publish topic for field: device_type
publish topic for field: serial_number
publish topic for field: arm_version
publish topic for field: dsp_version
publish topic for field: dc_input_power
publish topic for field: ac_input_power
publish topic for field: ac_output_power
publish topic for field: dc_output_power
publish topic for field: power_generation
publish topic for field: total_battery_percent
Write Request FF02 - Value:  0103 0046 0015 65d0
F01 - Write Response
0103 2a00 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 002e d8
Write Request FF02 - Value:  0103 0bb9 003d 57da
F01 - Write Response
0103 7a00 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0400 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 01dd 84

image

giovanne123 commented 1 year ago

No further investigation needed, I will add the change to my special usecase for the little EB3A.

gerab commented 1 year ago

@giovanne123 advertisedDevice.getName().compare(settings.bluetti_device_id)

doesn't work for me either. It's not only your device which has problem connecting.

https://github.com/mariolukas/Bluetti_ESP32_Bridge/issues/31