meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.51k stars 865 forks source link

[Bug]: Heltec tracker (and possibly all esp32-s3 targets) not properly setting usbPower detection #4582

Open geeksville opened 2 months ago

geeksville commented 2 months ago

Category

Hardware Compatibility

Hardware

Heltec Wireless Tracker

Firmware Version

2.5.? (a private build from today's master)

Description

While working on something else I noticed that the heltec tracker isn't properly setting usbPowered detection to true when we are hooked to USB power. This will break many things ;-)

Alas - I can't look at this now but if no one has looked at it by October please pass it to me and I'll work on it.

Relevant log output

DEBUG | 00:34:59 46 [Power] Battery: usbPower=0, isCharging=0, batMv=3694, batPct=47
StevenCellist commented 2 months ago

The Heltec Wireless Tracker is something unique, also in this regard. While charging, the reported voltage on the ADC pin is not the VIN voltage, but still the battery voltage but roughly 0.2V or so higher. So you cannot determine from the ADC pin alone whether the battery is charging. However, you can monitor the battery charge this way! So.. mixed bag, but Tracker-only.