cyberman54 / ESP32-Paxcounter

Wifi & BLE driven passenger flow metering with cheap ESP32 boards
https://cyberman54.github.io/ESP32-Paxcounter/
Other
1.7k stars 399 forks source link

No BATTERY status for T-Beam on paxcounter 2.0.x #658

Closed PlumbumDN closed 3 years ago

PlumbumDN commented 3 years ago

After flashing paxcounter 2.0 on Sunday I experienced that my TTGO T-Beam has no battery status anymore. You can see, that after flashing the cwa counter became active and battery voltage was missing.

I checked several things and measured the correct voltage on GPIO 35, thus I think the config and PIN mapping is correct. Anyone else experiencing this?

paxcounter_no_bat_status

cyberman54 commented 3 years ago

What T-Beam version are you using? pre 1.0, 1.0 or 1.1.?

PlumbumDN commented 3 years ago

its a pre 1.0 (late 2018) T-Beam.

cyberman54 commented 3 years ago

could you please try to change line122 in power.h from &sigmoidal to &linear and re-test?

cyberman54 commented 3 years ago

And: which software version did you use before, that did show correct battery voltage values?

PlumbumDN commented 3 years ago

ok, change it to linear, but no values at all. 2020-10-07 10_46_26-Window Previous version on T-Beam was quite old... 1.8.2 if build logs are correct... but could be the result of not updating platformio.ini in the past. Because of the big gap I reconfigured everything from scratch in 2.0.1x, cleared esp and did a fresh build

cyberman54 commented 3 years ago

I will check this on a old T-Beam. Generally, battery monitoring was refactored and improved since 1.8.x, thus it is possible that a bug came in. The relevant code is in power.cpp

PlumbumDN commented 3 years ago

No hurry, just noticed the missing values ;-)

cyberman54 commented 3 years ago

Turns out: it's not a bug, it's a feature.

With newer versions of paxcounter it is possible to control payload of device data more granular. See description. The default for battery values is now OFF. You can it turn it ON by once sending rcommand 0x16 0x01 to your device. Then the battery status shold reappear in your device dashboard.

The setting is stored in NVRAM of device, thus will be persistant, until you change it again.