If you had taken the time to try and combine the code I gave you for the AP connection and the webserver code from my hackster project, you'd find it wasn't that hard. Even a guy with my limited abilities was able to bust out a quick concept in a few minutes.
from m5stack import *
from m5ui import *
from uiflow import *
import usocket as socket
html = """<html><body>M5Stack AP Server</body></html>"""
ap = network.WLAN(network.AP_IF)
response = None
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn, addr = s.accept()
request = conn.recv(1024)
request = str(request)
print ('Content = %s' % request)
lcd.print('Content = %s' % request,0,50,0xffffff)
if ap.isconnected() == True:
response = web_page()
conn.send('HTTP/1.1 200 OK\n')
@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.