M5Stack serious WiFi Failures !!
I have spent considerable time to develop an application using M5Stack. I have run into a serous reliability problem. I have two M5Stack basic. While testing they would connect to Wifi (open network). Suddenly one stopped connecting. I tried the other one it also was now not connecting. I load same program to M5Stack grey model and it connects fine. I load example program SimpleWiFiServer to grey M5stack and it connects immediatly. I load the SAME program to the black units and neither one will connect. I am very unhappy with the time wasted with this unreliable hardware. My application was going to use 200 to 300 M5stacks but now I am very uncertain if such a failure can just happen without any known cause in just a few weeks of testing. Any suggestions welcome otherwise we throw this product out and warn others.
I reply to myself. It appears this problem is related to the use of BtnA and Wifi. Some delays seem to help but somewhat unreliable. Maybe somebody has better solution
Checkout Lesson 3.1 (WiFi Access Point (Web Server) here in the forum under NEWS & LESSONS if you haven't already. Might be something there. It uses WiFi..... Button presses on the M5Stack activate a printed message in a web browser. Includes the use of button A.
There is a bug on Arduino-IDF that cause interference between Wifi and GPIO39
Using older precompiled libraries can eliminate this problem.
I had the same problem on my MultiApp firmware and i solved by using an IDF patch.
HERE you can find the libraries i use to fix the GPIO39/Wifi problem
@calin That would explain it. But how do you apply your patch ?
Here is the other thing - the grey M5Stack works fine, but all the black M5stacks do not connect. It there some firmware or other difference between models besides the 9dof chip which I do not use in my application.
@drwino What IDE are you using?
What SDK? Arduino? ESP-IDF? Python?
I am using a black M5Stack with ESP-IDF and Arduino-ESP32 on PlatformIO and i never had any wifi connection problems.
Arduino 1.8.5 with board M5Stack-core-ESP32
@drwino I think the IDE you are using have something to do with the problem you get...
Integrating the ESP32 IDF into Arduino Processing variant is not straight forward.
Try PlatformIO and you will never look back to Arduino "IDE"
@drwino M5Stack - Model Differences: Grey vs Black
Apart from the MPU-9250 providing the 9dof, the only other major difference is the addition of 4 Mb PSRAM in the grey model.
The chips in both models are ESP32 Revision 1.
Both models I checked are running the same SDK version.
I think the way Arduino Ide compile the project might be the problem. Just as a small observation, the same code compile at least 4 times faster on PlatformIO than on Arduino "IDE"
I call it "IDE" because that's more like a text editor than a real IDE. Even Notepad++ have more coding related features than Arduino "IDE".
Arduino Wiring framework is OK. Arduino "IDE" (text editor) not so much.
@jimit Hm... you might be right on this one... There might be a power related issue... since ESP's are very sensitive to power fluctuations.
Here is a study of the problem: https://www.youtube.com/watch?v=wf_msvWv1jk&t=632s
Regarding the example you mentioned in the post above, here is a version adapted to latest IDF using M5Stack button functions: https://github.com/botofancalin/M5StackLight_OnOff
@calin Well it seems there are a few possibilities... Hopefully Dr Wino can pin it down to one.
Wow - a blast from the past! That was one of the first vids I saw on these ESP things some time ago now.... Nice idea to make an IDF version of the Light on/off sketch.
Nice idea to make an IDF version of the Light on/off sketch.
Is not esp-idf... is Arduino-IDF code on PlatformIO using M5Stack library
@calin Ah.. i was wondering about that. I am interested to move over to using PlatformIO... Maybe this week.
Oh and CONGRATULATIONS on your now award winning MultiApp software. Great effort that !!
I read the all the suggestions in this blog but I cannot get the M5Stack to connect reliably. It will connect sometimes. Different M5Stacks may or may not connect. Some may connect in a different location. ESP32 is becoming a big waste of time and I am giving up on the M5Stack/ESP32 as useless. Which is surprising as an IOT device it should be at least able to connect. In other irritations the ADCs are kind of useless and noisy. I tried to use ADS1015 over I2C but it fails after some random number of hours. The M5Stack is useless for battery operations as the display takes about 160mA and there is no way to turn it off and on.
M5Stack -> trash box.
I always end up replying to myself ! Anyway, here is the latest - maybe it can help someone or get some ideas. I decided to remove the BOTTOM and try again. The power is only from the USB to the PC or USB power supply. Now the same M5Stack connects every time ! Maybe the battery is somehow not letting it reset properly for the next connection. Using just the bare PROTO board also works fine. Next step is to try the ADS1015 over I2C and see if that is OK. Interesting.
Still looking for ideas to conserve battery power.
@drwino To conserve battery power you can try disable backlight on lcd with :
update: I just tested this:
backlight almost disabled and nothing on screen.
so better is just set backlight to zero.