moshe-braner / SoftRF

:airplane: Multifunctional, compatible DIY general aviation proximity awareness system
GNU General Public License v3.0
18 stars 4 forks source link

Power-off button issues #12

Closed moshe-braner closed 5 months ago

moshe-braner commented 2 years ago

With previously compiled versions (on the same T-Beam) if I press and hold the button then after 2 or 3 seconds it says "OFF" and I can release the button and it turns off. But with my newly compiled version, using the 2.0.2 version of the Arduino ESP32 core library, it does not say "OFF", rather, after about 5 seconds the OLED and the red LED turn off, but the blue LED stays on. I must be able to turn it off or it will drain the battery. Also, now that I connected a buzzer, when it boots up, it makes 3 rising tones instead of 4 like the older versions. I did not change anything in the parts of the code that handle power on/off, so is this a library issue? Or a library incompatibility with the 2.0.2 "core"?

I've tracked it down somewhat: the code to make the AXP PMU send an IRQ to the ESP32 when that power button is pressed is working as far as passing control to the IRQ code, which is then handled in ESP32_loop(). But there it does not progress past the line: if (axp.readIRQ() == AXP_PASS) Further testing shows that axp.readIRQ() does not return at all! So there is something wrong with the the AXP library & the 2.0.2 core?

moshe-braner commented 2 years ago

Other issues with the recent compilations using ESP32 Core v2.0.2:

moshe-braner commented 2 years ago

Apparently ESP32 Core v2.0.2 has issues with I2C: https://github.com/espressif/arduino-esp32/issues/6553 and both the AXP library and the baro sensor use I2C. SD card access is also broken in 2.0.2. Have to (grit teeth) upgrade to the very new v2.0.3? https://github.com/espressif/arduino-esp32/releases/tag/2.0.3 Recompiled with 2.0.3 - power button now back to normal!!! For both long and short presses. "LEDC not initialized" errors still show up in that one point in the booting though. The new binary here (version 07d) is OK to use for flight testing - at least you can turn it off when you are done!