Heltec not working with battery

I’ve got the Heltec WiFi LoRa 32 (V2) and a battery that connects to the battery port on the bottom of the board, but the Heltec doesn’t seem to recognize the battery. I’ve tried everything below with the beta firmware build 1.2.45 and the alpha firmware build 1.2.48.371335e.

3.7V 102050 1000mAh lithium polymer lipo Rechargeable battery JST 1.25mm 2pin plug for KTV household wired microphone GPS Camera|Replacement Batteries| - AliExpress is the battery I bought. In case the link doesn’t work, the title is “3.7V 102050 1000mAh lithium polymer lipo Rechargeable battery JST 1.25mm 2pin plug”. I’ve bought two of these batteries and tried them both.

My understanding of the documentation page on the power settings (Power Settings | Meshtastic) is that by default, the device won’t charge an attached battery. To get it to do so, I need to change the value of charge_current from the default of MAUnset. There’s no explanation of what the value should be, but I’m assuming it should match the mAh capacity of the battery.

I used the meshtastic.py CLI on Windows to send the command “meshtastic --set charge_current MA1000” (since the battery I have is a 1000 mAh battery) and the CLI returns a message indicating the config change was successful. But then I see an animated progress bar across the middle of the screen on the Heltec that just repeats, and pressing the Program button has no effect. If I unplug the USB cable, the Heltec immediately turns off. When I reconnect the cable, the progress bar is gone and the program button works again to switch between the different screens. But I don’t see the screen that shows the battery voltage and capacity, and the main screen still has the cable icon instead of the battery icon. I’ve run “meshtastic --info” and it still shows the charge_current as MA1000, so I know that’s configured correctly. I’ve left the Heltec overnight with the battery connected and a USB cable providing power, thinking maybe the battery just needs to be charged up before it starts working. But that didn’t change anything.

The documentation page for the device firmware makes no mention of the progress bar that I see on the Heltec screen when I run the charge_current command. Any idea what that progress bar means?

There doesn’t seem to be a way to check the battery status from the CLI. That might be worth adding to the output of the --info command.

Has anyone else been able to use a battery with a Heltec device? Am I setting charge_current to the correct value?

Thanks in advance.

The change_current directive only works when your device has an AXP192 power management IC. The code assumes only TBeam devices have that (and looking up a Heltec I don’t think it does.

In any case, leaving it unset will result in a default value being applied so you wouldn’t have to mess with it even for a TBeam.

As for the battery measurement, the code has GPIO13 defined as an analog input to measure battery voltage, it looks like it will only work while the screen is not powered which seems odd. I don’t have a Heltec on hand to play around with here, but you may have to mess around with the sleep modes to get the screen to power off before the battery measurement will come through. The heltec schematic for this part of the circuit seems odd, I don’t know why they’d do it that way

It sounds like Meshtastic doesn’t (currently) support charging an attached battery on the Heltec. If that’s the case, can the documentation be updated to mention that?

I’m new to this and I bought the Heltec because it seemed to be the cheapest option and I didn’t have to solder on the screen. And really I liked that I could buy a plastic case for the Heltec from AliExpress for another $1. But I didn’t realize that the battery for the Heltec wouldn’t fit in the case and didn’t consider that the TBeam’s included GPS chip makes it more useful as it can be used to track location without even needing to connect to a phone.

If someone wants a device that can be directly connected to a battery (versus using a USB battery) and that they don’t need to solder a screen to, it seems the only option is the T-Echo (assuming Meshtastic will work w/ the included battery), but that costs more than $50.

The Heltec costs less than half of that, and is easy to power from a USB battery pack, AC adapter, or car cigarette to USB adapter.

It would be really helpful if these considerations were spelled out in the documentation.

I took a look at the schematic for that device:

The power block in the schematic says the battery charger IC works independently and doesn’t rely on software configuration. In fact, it’s configured at the factory (R9) to charge the battery @ 100ma. You can change the charge rate by swapping out that resistor.

If you want to swap out the resistor for a different charging current, look at page 7 for the formula