please, could you help me? What is M5.powerOFF() doing inside? I am using the esp-idf for my projects with M5Stack and I want Power off from software, but I can only deinitialize all of my routines and turn off display. And when I want to powr on again after power button, then the device turn off first.
@ckuehnel said in M5stack basic core battery power on issue (ip5306 strange power management):
Here is a working code example:
Test of IP5306 functions
// initialize the M5Stack object
Wire.begin(); // required to access IP5306
M5.Lcd.printf("IP5306 Function Test\r\n");
M5.Lcd.printf("No communication with IP5306 chip");
uint8_t bat = M5.Power.getBatteryLevel();
if (M5.Power.isCharging()) M5.Lcd.printf("Battery is charging\r\n");
else M5.Lcd.printf("Battery is not charging\r\n");
M5.Lcd.printf("Battery Level %d", bat);
M5.Lcd.progressBar(0, 220, 360, 20, bat);
Hi, doesn't compile for me!!!
this is the arduino IDE output:
Arduino: 1.8.7 (Mac OS X), Board: "M5Stack-Core-ESP32, QIO, 80MHz, Default, 921600, None"
Build options changed, rebuilding all
/Users/AD/Documents/Arduino/libraries/M5Stack/src/utility/Power.cpp: In member function 'void POWER::powerOFF()':
/Users/AD/Documents/Arduino/libraries/M5Stack/src/utility/Power.cpp:361:28: error: 'gpio_deep_sleep_hold_dis' was not declared in this scope
Multiple libraries were found for "SPI.h"
Not used: /Users/AD/Documents/Arduino/libraries/SPI
Multiple libraries were found for "SD.h"
Not used: /Users/AD/Documents/Arduino/libraries/SD
Not used: /private/var/folders/f3/0kf10ljj6sj4q4twsw_vtxrw0000gn/T/AppTranslocation/395E70C5-F1F6-4076-AA11-9C132A2C6ACF/d/Arduino 1.8.7.app/Contents/Java/libraries/SD
exit status 1
Error compiling for board M5Stack-Core-ESP32.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hi @heybin !
What do you want to show us with the picture: flickering due to problems with contacts?
Do you know what the meaning is of:
flashing? ( = 1s on > 1s off > 1s on > and so on: charging?)
What I noticed so far:
a) USB charging cable connected to M5GO CHG Base and M5GO CHG Base attached to M5GO Base: LED is flashing and obviously charging
b) M5GO disconnected from M5GO Base: LED = ON for 30 seconds , than OFF, but FIRE is still on and operational (Power from internal Lipo Battery?)
c) M5GO CHG Base attached to M5GO Base, but no power on USB-Cable: same behaviour as item b) above. (Power from internal Lipo battery AND/OR CHG Base Battery?)
For a) and b) so far, I didn't test, for how long the FIRE stays ON.
If it's not connecting to the device, what errors do you see? Paste your command line output here and maybe I can help further.
One other custom I did for ampy... I created the file ~/.ampy with these contents:
# Example .ampy file
# Please fill in your own port, baud rate, and delay
# Fix for macOS users' "Could not enter raw repl"; try 2.0 and lower from there:
If you create that file, you will not have to pass the port and baud rate options when running the ampy command. This is the standard way to run ampy when you don't have the .ampy file created.
world101$ ampy -p /dev/tty.SLAB_USBtoUART -b 115200 ls
Also, I was mistaken on the the v1.2.3 firmware with the beeps disabled by default. I just flashed one of my cores with the M5Burner and the beeps are there. I must have been running a custom firmware before.
How about this example code?