Page 1 of 1
Is it possible at all to connect to wifi with ESP01S?
Posted: Sat Sep 04, 2021 4:53 pm
by mathieu
I have some experience with pyboards and a TinyPICO, but I am a complete newbie regarding EP8266. I grabbed a couple of ESP-01S modules and flashed them with
esp8266-20191220-v1.12.bin based on
https://micropython.org/download/esp8266. REPL tests such as print("foo", 2+2) work fine.
But when I try connecting to my WiFi network using:
Code: Select all
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(WLAN_SSID, WLAN_PASSWORD)
On both boards this results in a crash/reset loop, printing out gibberish along the way.
Am I doing this wrong ? Could omeone please point me to a minimal example of an ESP-01S successfully connecting to a WLAN? For the record my TinyPICO handles the above code with no problems.
Re: Is it possible at all to connect to wifi with ESP01S?
Posted: Sat Sep 04, 2021 5:08 pm
by Roberthh
The esp01S modules should work with sifi. Please check that you use a firmware files matching the flash size of the board and that the power supply can source sufficient current, which is up to 250 mA when transmitting.
Re: Is it possible at all to connect to wifi with ESP01S?
Posted: Sat Sep 04, 2021 7:14 pm
by JennaSys
WiFi works just fine on the ESP-01S.
I think @Roberthh is correct, the
esp8266-20191220-v1.12.bin file requires a device with 2M or more of flash and the standard ESP-01S only has 1MB. If you use a MicroPython firmware build set up for 1MB flash like
esp8266-1m-20210902-v1.17.bin it might solve your issue.
Re: Is it possible at all to connect to wifi with ESP01S?
Posted: Sat Sep 04, 2021 10:53 pm
by mathieu
JennaSys wrote: ↑Sat Sep 04, 2021 7:14 pm
WiFi works just fine on the ESP-01S.
I think @Roberthh is correct, the
esp8266-20191220-v1.12.bin file requires a device with 2M or more of flash and the standard ESP-01S only has 1MB. If you use a MicroPython firmware build set up for 1MB flash like
esp8266-1m-20210902-v1.17.bin it might solve your issue.
I just tried with
esp8266-1m-20210902-v1.17.bin and the issue seems unchanged. For the record, the downloads page states:
Also note that v1.12 and earlier will work on modules with 1M or more of flash, while v1.13 requires 2M or more.
I'll continue investigating and report here, but new suggestions are welcome. In case it's relevant, my WLAN uses WPA2-AES. Might that be part of the problem?
Re: Is it possible at all to connect to wifi with ESP01S?
Posted: Sun Sep 05, 2021 5:27 am
by JennaSys
I haven't tried 1.17 myself yet since it just came out, but I do have 1.16-1m running on several ESP-01 and ESP-01S modules right now with 2.4G WiFi using WPA.
The code that you posted should be all you need to connect. It matches what I use.
Re: Is it possible at all to connect to wifi with ESP01S?
Posted: Sun Sep 05, 2021 6:50 am
by mathieu
Solved! After switching off WPS (which is insecure anway) on my router, everything seems to work well. Thanks for confirming that this should work, I probably wouldn't have gone digging into wifi setting otherwise.
