Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Useless info when usb-powered, and without battery pack #21

Open
dl9sau opened this issue Apr 3, 2021 · 2 comments
Open

Useless info when usb-powered, and without battery pack #21

dl9sau opened this issue Apr 3, 2021 · 2 comments
Assignees
Labels
bug Something isn't working high prio High Priority Ticket

Comments

@dl9sau
Copy link

dl9sau commented Apr 3, 2021

I run my device just with USB. -> No battery voltage, current and no charging.

LoRa_APRS_Tracker adds " - Bat.: 0.00V - Cur.: 0mA" to the comment field.
This info is just useless and costs aitime.

I suggest the following solution:

--- power_management.h.orig	2020-12-13 22:39:19.000000000 +0100
+++ power_management.h	2021-04-03 14:51:00.000000000 +0200
@@ -25,6 +25,8 @@
 	double getBatteryVoltage();
 	double getBatteryChargeDischargeCurrent();

+	bool isBatteryConnect();
+
 private:
 	AXP20X_Class axp;
 };

--- power_management.cpp.orig	2021-04-02 19:02:59.000000000 +0200
+++ power_management.cpp	2021-04-03 15:04:57.000000000 +0200
@@ -84,3 +84,9 @@
 	}
 	return -1.0 * axp.getBattDischargeCurrent();
 }
+
+// cppcheck-suppress unusedFunction
+bool PowerManagement::isBatteryConnect()
+{
+	return axp.isBatteryConnect();
+}

And in LoRa_APRS_Tracker.cpp:

#ifdef  TTGO_T_Beam_V1_0
                if (powerManagement.isBatteryConnect()) {
                        String batteryVoltage(powerManagement.getBatteryVoltage(), 2);
                        String batteryChargeCurrent(powerManagement.getBatteryChargeDischargeCurrent(), 0);

Testet with just usb: works
Not testet: 1. with battery and no usb power. 2. with battery and with usb power.

@peterus
Copy link
Member

peterus commented May 14, 2021

there was a fix for this issue here integrated: 727c90e

@peterus peterus closed this as completed May 14, 2021
@peterus
Copy link
Member

peterus commented May 14, 2021

I will reopen this issue as I have the feeling that i have seen this issue in the last time.
I need to check this again.

@peterus peterus reopened this May 14, 2021
@peterus peterus added the high prio High Priority Ticket label May 14, 2021
@peterus peterus self-assigned this May 14, 2021
@peterus peterus added the bug Something isn't working label May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high prio High Priority Ticket
Projects
None yet
Development

No branches or pull requests

2 participants