You can't read the Hall Sensor on the M5StickC.
According to the ESP32 manual the internal hall sensor on the ESP32 is connected to the analog channels on pins GPIO36 and GPIO39.
The ESP32 document note reads: "It is also possible to read the internal hall effect sensor via ADC1 by calling dedicated function hall_sensor_read(). Note that even the hall sensor is internal to ESP32, reading from it uses channels 0 and 3 of ADC1 (GPIO 36 and 39). Do not connect anything else to these pins and do not change their configuration."
The M5StickC uses pin GPIO39 as the hardware button pin B switchingthe stick on and off (always monitoring for a 6 sec press) , GPIO36 is brought out to the connector at the top of the device and there is no schematic showing it has no internal strings attached ..
No prob, I was just bit upset with some M5Stack features aswell, its all good, Im still new to ESP32 itself and as usual lacking time to discover it.
uRequests seem to be fine for this task, I'm trying to work with VS Code but most of examples lead to M5Stack and UIFlow libraries,
Guess I should start with something eaasy like blinking leds first :D
Overall idea is:
I got couple devices (maybe 3 of them) driven by own controllers (Atmega family)
I want M5Stack to connect to them through i2c
M5Stack runs webserver, whenever I connect it, I got 2 buttons like read and write, once I press read it gets atmega devies statuses and shows in browser, than I can edit them, press write and it will send new parameters.
I've got atmega devices ready, html page, m5stacks, wires but can't figure out how to combine it all together
I did similar job with atmegas some years ago and I remember I used to parse url to get params from it (GET method), but thought there's some advanced libraries already exist. I'd go MQTT but it requiers broker device which I dont want to have
@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?
@ajb2k3 Thanks a lot !
@cepics "A custom ESP-WROOM-32 build without any flash chip added, so the existing GPIO6, GPIO7, GPIO8, GPIO9, GPIO10 and GPIO11 pins can be used to allow us to add a GD25Q127C (or similar) on our external circuit."
@kat @Rop you need to create and M5ez project, create a text place holder and set the code to replace the text with the values. Hopefully @Rop will pick up the notification and help you out. My knowledge is more towards Uiflow
Currently there is no support for png images in the micropython port that form the firmware of the m5Stack range.
BMP is its raw uncompressed state is a simple file to translate along with base level jpg (not JPEG!)
Until such time that a codec exist for micropython, we are all stuck with converting graphics into base level formats.
@rob-biernat which M5Stack or Stick are you using?
The M5Stacks and Sticks have an I2C grove port (port A) but this is also a digital I/O port in that it can read or write 0 or 1 values (on or off) I am currently triggering a relay unit from the port.
The M5Go base has has 2 additional port which are multi I/O (port b) and UART (port C) Unlike Arduinos, the esp32 which powers the M5Stack has no set pin functions and all pins can be used for a range of functions.
When using Port A Yellow is SCL (pin 22) and white is SDA (pin 21) and need to be defined.
I have started to document the different functions of the grove connector and you can find them on pg 19 and 20 of my WIP book here https://github.com/Ajb2k3/UIFlowHandbook/blob/master/UIHB1404192.pdf
@brij300 So sorry about that. We haven't tried to connect to AIOT website yet? But some guys make a project about opendimes. You can contact them. Thanks a lot.