Configuration examples for M5stack Core2 v1 (screensaver, 5v power) #805
Replies: 4 comments 1 reply
-
for screen saver there is a workaround using command over MQTT e.g. via node-red where /hasp/panel_name/state/idle topic is subscribed and on "short" or "long" value node-red issues command to /hasp/panel_name/command with payload 'backlight {"state":"off","brightness":128}' |
Beta Was this translation helpful? Give feedback.
-
Providing external 5V power turned out to be not an issue at all - recent AXP192 lib from m5stack handles the presence of external VIN automatically (https://github.com/m5stack/M5Core2/blob/0.1.9/src/AXP192.cpp#L65) and sets 5V bus accordingly (5V output when USB power is present and 5V input if not). Comments in m5stack repo can be misleading but with little help from this document (https://images.shoutwiki.com/mindworks/8/8b/2020_infrasonic_wildfire_detector_APX192_Enhanced_Single_Cell_datasheet_en.pdf page 20) and serial debug messages telling how axp192 initializes I was able to confirm that with USB power present the "else" block gets executed so with external VIN the (Read8bit(0x00) & 0x08) condition should be satisfied (which is not that easy to test without breaking the usb cable etc.) but let's hope it will. |
Beta Was this translation helpful? Give feedback.
-
To sum up - this little discussion with myself can be closed but probably useful to someone new to openHASP who does not find answers to basic installation/deployment questions regarding m5stack Core2. If someone knows how to get the screensaver to work without issuing external commands via MQTT, that would properly address all my initial questions. |
Beta Was this translation helpful? Give feedback.
-
Thanks. What version are you running on the device? |
Beta Was this translation helpful? Give feedback.
-
Hello, does anyone know where to get examples on using openHASP on m5stack Core2 v1 regarding e.g. the screen saver or powering from 5v bus instead of USB?
The build 0.7.0.rc-13 for core2 loads fine and firmware boots correctly.
The issue with core2 is with the way it handles backlight and power - through axp192 chip.
Settings from /config/gui do not result in getting the screen dimmed or turned off.
I can't find any useful documentation on how to get the screensaver to work either using built-in functions or some workarounds (if available).
Regarding powering from 5v rail the axp192 must be initialized with proper argument (e.g. like I did in other project https://github.com/Girgitt/Homepoint/blob/6-external-5V-power/main/config/PlatformInject.hpp#L83).
From what I can see in the sources (
openHASP/src/dev/esp32/m5stackcore2.cpp
Line 19 in 80a9ddb
Beta Was this translation helpful? Give feedback.
All reactions