[BUG] ESP32 D1 without battery (ulanzi firmware)
Bug report
Devices involved
- Model: ESP32 D1 mini, with BME280 and LDR sensors
- awtrix3 version: ulanzi 0.98
Describe the bug
I've got the problem you're talking about in this PR https://github.com/Blueforcer/awtrix3/pull/412#issuecomment-1832620228
Seems to be a problem with the range validation, wich is zero if you dont have a battery https://github.com/Blueforcer/awtrix-light/blob/9da869024736f11297737041a6fe4dbf61ae5cdc/src/PeripheryManager.cpp#L445
I haven't any battery installed, and ADCVALUE = analogRead(BATTERY_PIN); returns zero.
So, MQTT doesn't send its statistics.
For now, I've complied an updated version, replacing
if ((ADCVALUE > 100) && (ADCVALUE < 1000)) {
with
if ((ADCVALUE >= 0) && (ADCVALUE < 1000)) {
but it's just a temporary workaroud.
Do I need to connect directly 3V3 to ADC6 / GPIO34 ?
In that case, won't I get a reading of 1023 and have the problem at the high threshold ?
Maybe I can create a voltage divider to reduce voltage to 3V for example, and simulate a 100% charged battery ?
Thanks for help.
Did you find a good solution for this?
For now, I kept my modified version.