Skip to content

[BUG] ESP32 D1 without battery (ulanzi firmware) #732

@BmdOnline

Description

@BmdOnline

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 #412 (comment)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions