chadj / renogy-smart-battery

Web application to monitor Renogy 200ah LiFePO4 Battery over bluetooth (Web Bluetooth API). No server needed. All client side javascript
https://chadj.github.io/renogy-smart-battery/
MIT License
13 stars 8 forks source link

Try to adapt BT connection to an ESP32 #5

Open distancerunner opened 1 year ago

distancerunner commented 1 year ago

Hi. I try to connect with an esp32 to my battery. Can you help me to understand your code?

Im actually able to connect to the battery and to the service.

I found 3 service uuids and every one has more or less characteristics uuids.

In your code line 288 to 344 you make async calls with some hex data? Can you explain it to me?

Did you know, which characteristics uuids I need?

chadj commented 1 year ago

Here’s what I can tell you.

I logged BLE traffic between my phone and the battery to determine how to talk to the battery. So I can’t for certain stay what each byte of data means.

Now I believe this a standard protocol that generally operates over a serial line that has been adapted to work over BLE. I don’t know the name of the protocol though.

distancerunner commented 1 year ago

Yehaa, your work was awesome and I learned a lot after analyzing the data stream by myself. But your script was existential to understand the BLE connection. Here is my first working ESP32 program. It calls the BLE device and reads many values: https://github.com/distancerunner/Renogy-Battery-ESP32-Bluetooth-MQTT-Bridge

I will extend its functionality in the next weeks. It is work in progress.

Here you see, it calls the BT connection to my 100Ah Battery perfect: Screenshot_20230330_144614