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

Expected behaviour of successful flash #67

Closed
spoonwzd opened this issue Apr 9, 2022 · 18 comments
Closed

Expected behaviour of successful flash #67

spoonwzd opened this issue Apr 9, 2022 · 18 comments

Comments

@spoonwzd
Copy link

spoonwzd commented Apr 9, 2022

Can you verify the expected behaviour of a successful flash?

Looking at the log output after reboot it seems to be establishing a configuration then saving it to flash.

image

Is it normal to take ~3 minutes after establishing the sensor config to save preferences to flash?

Once the saving preferences to flash message appears, is it safe to power off the device at this point?

Does the ESP32 device need to be connected to the BMS when it's adding sensors on first boot?

Apologies for the noob questions, I'm still waiting for it to click for me :)

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

Is it normal to take ~3 minutes after establishing the sensor config to save preferences to flash?

This is normal. If the startup doesn't succeed multiple times (= the boot loop counter exceeds 10: https://esphome.io/components/ota.html) the ESPHome node goes into a recovery mode. So you are able to reflash the device via OTA.

Once the saving preferences to flash message appears, is it safe to power off the device at this point?

It's always safe to reboot the ESP. If you reset/reboot the ESP manually 10 times in a row the recovery mode kicks in (see above).

Does the ESP32 device need to be connected to the BMS when it's adding sensors on first boot?

No it doesn't need to be connected. The custom component polls the BMS (with a single request) periodically. The BMS responds with a full status report. You can decide by adding sensors how much data of the status report is published as sensor data.

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

Could you provide the BMS type + hardware & software version you are using? I would like to extend the list of supported devices if your device version is missing.

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

Model: JK-BD6A24S10P
Hardware: 8.X
Software: 8.0.6G
Version: 3.7.1

This doesn't seem to be on your supported list and may explain why I'm not seeing any data. :/

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

It should be supported because the device pretty new. Could you provide a photo of your wiring?

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

image

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

Are you sure the green cable is connected to GND? It looks like GPIO20.

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

image

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

20220409_113449

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

Alright! Did you try to swap RX and TX just for testing? Your setup looks fine. The BMS is up and running (blinks)?

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

Not tried swapping, but I can if you think it's worth a try.

BMS defo up and running.

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

Where did you buy the BMS?

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

It's worth a try! Can be done via config yaml (no resoldering required).

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

Where did you buy the BMS?

https://www.aliexpress.com/store/911303103

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

No luck?

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

Right, so swapping the TX/RX GPIO around didn't help.

Swapped them back to their original states and ran the debug.

image

I'm clearly getting data from the BMS but I'm not seeing anything at the MQTT listener.

I'm not running HomeAssistant - I'm using the MQTT listener in node-red which I've used before successfully.

Should I be seeing MQTT related messages in the debug output? Because I'm not...

@syssi
Copy link
Owner

syssi commented Apr 9, 2022

Perfect! You are able to retrieve the data from the BMS. The next step is to debug the MQTT connection. I don't know node-red in details. Is there a mosquitto broker or something like that? Could you take a look at the mosquitto.log? Is the ESPHome able to connect? Gets the connection dropped/disconnected because of failed authorization or something?

@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

Using MQTT explorer I can connect to my MQTT broker and see all the data flowing in, so this must be something throwing me off in node-red.

image

I'll suss it, but pretty sure your bit is all working great now.

Thanks for all your help.

@syssi syssi closed this as completed Apr 9, 2022
@spoonwzd
Copy link
Author

spoonwzd commented Apr 9, 2022

Ok I was subscribing to:

batt3/sensor/batt3_cell_voltage_1

instead of

batt3/sensor/batt3_cell_voltage_1/state

#facepalm

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

No branches or pull requests

2 participants