Is it possible at all to connect to wifi with ESP01S?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
mathieu
Posts: 88
Joined: Fri Nov 10, 2017 9:57 pm

Is it possible at all to connect to wifi with ESP01S?

Post by mathieu » Sat Sep 04, 2021 4:53 pm

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.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Is it possible at all to connect to wifi with ESP01S?

Post by Roberthh » Sat Sep 04, 2021 5:08 pm

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.

JennaSys
Posts: 33
Joined: Tue Jul 15, 2014 8:29 am
Location: Southern California, US
Contact:

Re: Is it possible at all to connect to wifi with ESP01S?

Post by JennaSys » 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.
John Sheehan

User avatar
mathieu
Posts: 88
Joined: Fri Nov 10, 2017 9:57 pm

Re: Is it possible at all to connect to wifi with ESP01S?

Post by mathieu » Sat Sep 04, 2021 10:53 pm

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?

JennaSys
Posts: 33
Joined: Tue Jul 15, 2014 8:29 am
Location: Southern California, US
Contact:

Re: Is it possible at all to connect to wifi with ESP01S?

Post by JennaSys » Sun Sep 05, 2021 5:27 am

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.
John Sheehan

User avatar
mathieu
Posts: 88
Joined: Fri Nov 10, 2017 9:57 pm

Re: Is it possible at all to connect to wifi with ESP01S?

Post by mathieu » Sun Sep 05, 2021 6:50 am

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.

:D

Post Reply