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

TBeam-AXP2101-V1.2 doesn't work with current AXP implementation #137

Open
jccricket opened this issue Jul 5, 2023 · 4 comments
Open

TBeam-AXP2101-V1.2 doesn't work with current AXP implementation #137

jccricket opened this issue Jul 5, 2023 · 4 comments

Comments

@jccricket
Copy link

jccricket commented Jul 5, 2023

Hello,

I have a TBeam-AXP2101-V1.2 and unfortunately, the current AXP implementation doesn't work. (Indeed, AXP2101 is NOT AXP192).
I have found library XPowersLib (https://github.com/lewisxhe/XPowersLib) which is developped by same person who did AXP202 library.

I tried to implement the XPowerLibInterface, but this was not following GXAirCom current structure, so, I decided to add everything in "main.cpp" despite this is not my preferred best practice.

I did implement for myself, but think this is worth sharing as this new XPowersLib sounds quite good in how to manage battery.
Something like this sounds more readable to me in case the board has a PMU:
bool printBattVoltage(uint32_t tAct){
#ifdef BOARD_HAS_PMU
if (!PMU){
log_e("PMU not initialized");
}else{
status.vBatt = PMU->getBattVoltage();
status.BattPerc = PMU->getBatteryPercent();
return true;
}
#endif

This is my first contribution, and I'm pretty sure this is not a good idea to merge. Anyone who would like to guide me and make sure what I'm introducing is not going to brake anything else, please feel free to reach out. I'm more than happy to invest time in this project.

Now, I need to learn how to make a pull request with GIT...

@gereic
Copy link
Owner

gereic commented Jul 16, 2023

updated GXAircom to XPowerLib.
Works on T-Beam (axp192) and S3Core (axp2101).
Can you test it ?

@jccricket
Copy link
Author

Hello,

I had a bit of time before work this morning and I did a quick build, upload and monitor.

[I][main.cpp:1126] setupPMU(): AXP2101 PMU init succeeded, using AXP2101 PMU

It looks good so far.
I have the "charging battery logo" displayed on the OLED when plugged in.

I will do more test when I have more time, but at the moment, with my TBeam v1.2 and AXP2101 it looks good.
Thanks a lot !

@mooiweertje
Copy link

mooiweertje commented Feb 9, 2024

I have this board aswell I think but I am not able to get it going. Flashing seems to work but display doesn't show anything and nothing on WiFi. Flashing Meshtastic works fine so it's not broken. I tried al the v5.5.2 firmwares but no succes.

@mooiweertje
Copy link

Ah, I found the 5.3.5 firmware in jccricket his repo and it seems to work. All that needs to be done is a pull request to get it in this repo? I can do that if you like from my repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants