@felmue Thanks for testing Felix. If you hear of any work arounds, please let us know.
Latest posts made by Krmiller
-
RE: TAB5 SD doesnt work in Arduino IDE
-
TAB5 SD doesnt work in Arduino IDE
I have been trying to convert some core2 code to work with Tab5 with little success when in comes to the microSD. I have chatted with chat.m5stack.com to get some minimal working code and it still doesn't work. I have tested on known good cards and 2 new TAB5s.
Here's the code from their chat bot (doesn't work)
thanks for any direction,
Kris#include <M5Unified.h>
#include <SPI.h> // Include SPI library
#include <SD.h> // Include Arduino SD library// Tab5 SD card SPI pin definitions
#define SD_CS_PIN 4
#define SD_SCK_PIN 18
#define SD_MISO_PIN 19
#define SD_MOSI_PIN 23void setup() {
auto cfg = M5.config();
M5.begin(cfg); // Initialize M5Unified// Initialize SPI for SD card
SPI.begin(SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN, SD_CS_PIN);// Initialize SD card with specified CS pin and speed (25MHz)
if (!SD.begin(SD_CS_PIN, SPI, 25000000)) {
M5.Lcd.println("SD Card failed!");
while (1); // Halt if failed
}
M5.Lcd.println("SD Card initialized.");
}void loop() {}
-
RE: Using WiFi on Tab5 with the Arduino IDE
@sapphire Same, can't get the SD to work. Anyone?
Thanks,
Kris -
RE: Android sketch works with AXP192, but not 2101
HI @felmue
Thanks for you reply. After trying to replace the M5core2 library with M5Unified, I see that I'll need to change and retest of number of things. RTC, Buttons, Lcd commands, etc. Is there no other way to address the AXP2101 other than using M5Unified?
Thanks,
Kris -
Android sketch works with AXP192, but not 2101
I use this code below with AXP192 to determine if the USB power is on/off. I want to power off the core2 when USB pwr is removed. This works with AXP192 but not 2101. What code and libraries would be needed to work with the AXP2101? Also, would be nice if I could determine which AXP this is and use the proper commands. TIA,
Kris ```
code_text//----------------------------- power off CTB when USB is powered off ----------------------------------- void checkPWR() { battpwr = (M5.Axp.GetBatPower()); if (battpwr > 100) { // Check to see if USB power was removed. M5.Axp.PowerOff(); // Power M5 off } }
-
RE: M5stack Core2 as an AP and webserver - WiFi dhcp is inconsistent serving IP add to clients
As an example: Here the first time I try to connect.... it works and gives my Mac 192.168.0.2.
*** SNIP***
OK
[ 1295][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 0 - WIFI_READY
[ 1363][V][WiFiGeneric.cpp:392] _arduino_event_cb(): AP Started
[ 1363][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring SoftAP static IP: 192.168.0.1, MASK: 255.255.255.0, GW: 192.168.0.1
[ 1364][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 10 - AP_START
[ 1378][V][WiFiGeneric.cpp:143] set_esp_interface_ip(): SoftAP: 192.168.0.1 | Gateway: 192.168.0.1 | DHCP Start: 0.0.0.0 | Netmask: 255.255.255.0
[ 1390][V][WiFiGeneric.cpp:190] set_esp_interface_ip(): DHCP Server Range: 192.168.0.2 to 192.168.0.12
[ 1400][V][WiFiGeneric.cpp:340] _arduino_event_cb(): STA Started
[ 1404][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[ 1405][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 2 - STA_START
[ 1428][E][WiFiSTA.cpp:317] begin(): connect failed! 0x300a
Connected clients: 0
Connected clients: 0
Connected clients: 0
Connected clients: 0
Connected clients: 0
Connected clients: 0
[ 32004][V][WiFiGeneric.cpp:407] _arduino_event_cb(): AP Station Connected: MAC: 6c:40:08:99:7b:c0, AID: 1
[ 32005][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 12 - AP_STACONNECTED
[ 32035][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[ 32035][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
Connected clients: 1
Connected clients: 1
**** SNIP ****Then I disconnect and connect to another network (my home WiFi) .... although I'm no longer connected to the core2, It continues to show 1 client connected. When they I try to reconnect to the core2 SSID, it first show me disconnected, then tries to serve an address over and over. The Mac never accepts the address.
**** SNIP ****
Connected clients: 1
Connected clients: 1
Connected clients: 1
Connected clients: 1
Connected clients: 1
[208861][V][WiFiGeneric.cpp:414] _arduino_event_cb(): AP Station Disconnected: MAC: 6c:40:08:99:7b:c0, AID: 1
[208862][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 13 - AP_STADISCONNECTED
Connected clients: 1
[216440][V][WiFiGeneric.cpp:407] _arduino_event_cb(): AP Station Connected: MAC: 6c:40:08:99:7b:c0, AID: 1
[216440][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 12 - AP_STACONNECTED
Connected clients: 1
[216552][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[216552][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[217890][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[217891][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[220363][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[220364][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
[226304][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[226305][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
[227309][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[227309][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[229339][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[229339][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
[233314][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[233315][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
Connected clients: 1
[242335][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[242336][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[243334][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[243335][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[245337][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[245337][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
[249339][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[249339][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 1
Connected clients: 1
[258361][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[258361][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[259365][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[259365][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[261365][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.2
[261365][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
**** SNIP ****This goes on for sever minutes. Then as soon as i connect with my iPhone... both clients get an address.
**** SNIP ****
Connected clients: 1
Connected clients: 1
[942052][V][WiFiGeneric.cpp:407] _arduino_event_cb(): AP Station Connected: MAC: 2e:da:8a:d8:c5:64, AID: 2
[942053][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 12 - AP_STACONNECTED
[943452][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.3
[943453][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[944350][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:192.168.0.3
[944351][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
Connected clients: 2
Connected clients: 2
Connected clients: 2
Connected clients: 2
Connected clients: 2 -
RE: M5stack Core2 as an AP and webserver - WiFi dhcp is inconsistent serving IP add to clients
Hi @felmue,
Thanks for taking a look. Tried your code change - same issue. Not only can I repeat with different core2s, I can reproduce with 2 different Macs and 2 different PCs. I'm Starting to wonder if it has something to do with CN (China) country code. Any other thoughts? ver of M5Stack.h or WiFi.h?
thanks again,
Kris -
M5stack Core2 as an AP and webserver - WiFi dhcp is inconsistent serving IP add to clients
I have tried soooo many things to try and work around this, but continue to have the same issue. The code below is the bare minimum to recreate the issue. When I run this on my core2 and connect PC, Mac, or iPhone, it will usually not give the first client that connects an address. You can see it trying in the debug of console port, but the client doesn't get the address..... then, here's the crazy part. If you try and connect another client (iPhone), the first client gets an address, and the second works too. Any assistance would be greatly appreciated.... been banging my head on this one. Thank you.
#include <M5Stack.h> #include "WiFi.h" // Include WiFi library char ssid[] = "M5Stack"; char password[] = "yourpassword"; WiFiServer server(80); IPAddress ip(192, 168, 0, 1); IPAddress gateway(192, 168, 0, 1); IPAddress subnet(255, 255, 255, 0); void setup() { m5.begin(); Serial.begin(115200); WiFi.mode(WIFI_AP); WiFi.softAP(ssid, password); WiFi.softAPConfig(ip, gateway, subnet); WiFi.begin(); } void loop() { // Example of getting the number of connected clients int clientCount = WiFi.softAPgetStationNum(); Serial.print("Connected clients: "); Serial.println(clientCount); delay(5000); // Check every 5 seconds }