Maker Pi Pico with ESP01S Module

It has been a while since my last post, most of which has been spent dealing with other things, as well as waiting for electronics modules to arrive from overseas. A lot of my time has also been spent on getting to grips with the Raspberry Pi Pico, and in particular, the Maker Pi Pico, from Cytron Technologies. This has been an experience with quite a lot of mixed feelings… As Usual, Cytron has done an excellent job with the development board, which, while apparently still in Beta, seems to be rock solid. Most of my frustration came from the “patchy” C/C++ support for the Pi Pico (Yes, I know there are great support, BUT it is not exactly user friendly 🙂 ). That left me with MicroPython, which although I am fluent, are not my goto language…

Lets get back on track though… The Maker Pi Pico has built in support for an ESP01/ESP01S Module. Lets look at the schematic….

Maker Pi Pico Schematic

As we can see, Cytron has provided us with access to Tx (GP17) and Rx(GP16) directly on the Pi Pico. Power (+3.3v) and Ground are connected as well… On this version of the board, no access to IO0,IO2 and the Reset Pin for the ESP01/ESP01S was provided… Maybe this will change in future…?

I have used the standard AT command firmware that comes pre-loaded onto the ESP01/S module. This allows you to send AT commands to the ESP01 Module to control it. It is also possible to setup a transparent WiFi “channel” to communicate between Pico and a remote application , making it possible to control Pico remotely. I have however not prepared and example of that for release yet….

MicroPython Code to communicate with ESP01 from Maker Pi Pico

import uos
from machine import UART, Pin
import utime


print("Machine: \t" + uos.uname()[4])
print("MicroPython: \t" + uos.uname()[3])

#indicate program started visually
led_onboard = machine.Pin(25, machine.Pin.OUT)
led_onboard.value(0)     # onboard LED OFF/ON for 0.5/1.0 sec

uart0 = UART(0, rx=Pin(17), tx=Pin(16), baudrate=115200)
# NOTE that we explicitly set the Tx and Rx pins for use with the UART
# If we do not do this, they WILL default to Pin 0 and Pin 1
# Also note that Rx and Tx are swapped, meaning Pico Tx goes to ESP01 Rx 
# and vice versa.

def sendCMD_waitResp(cmd, uart=uart0, timeout=2000):
    print("CMD: " + cmd)
    waitResp(uart, timeout)
def waitResp(uart=uart0, timeout=2000):
    prvMills = utime.ticks_ms()
    resp = b""
    while (utime.ticks_ms()-prvMills)<timeout:
        if uart.any():
            resp = b"".join([resp,])
    except UnicodeError:
sendCMD_waitResp('AT\r\n')          #Test AT startup
sendCMD_waitResp('AT+GMR\r\n')      #Check version information
#sendCMD_waitResp('AT+RESTORE\r\n')  #Restore Factory Default Settings
sendCMD_waitResp('AT+CWMODE?\r\n')  #Query the Wi-Fi mode
sendCMD_waitResp('AT+CWMODE=1\r\n') #Set the Wi-Fi mode = Station mode
sendCMD_waitResp('AT+CWMODE?\r\n')  #Query the Wi-Fi mode again
#sendCMD_waitResp('AT+CWLAP\r\n', timeout=10000) #List available APs
sendCMD_waitResp('AT+CWJAP="jean_iot","master123abc"\r\n', timeout=5000) #Connect to AP
sendCMD_waitResp('AT+CIFSR\r\n')    #Obtain the Local IP Address

You can now extend and adapt this code to suit your purposes…

The ESP01/ESP01S AT Command Datasheet is available for download here

Thank you

6 thoughts on “Maker Pi Pico with ESP01S Module”

  1. Gregory Walters

    Thank you for this post.
    I received my Maker board and ESP-01 yesterday and I must say that I am impressed.

    I was struggling to get connected to my network but with your example code I was able to connect.

    However, once I am connected, nothing else seems to work. I have tried to connect to a local MQTT server as shown in the AT Command Datasheet you point to and am getting an error.
    I have also tried (using the same datasheet information) to connect to the NTP server and get the “network” time, but still receive an error.
    The code is:
    and the responses are:
    CMD: AT+CIPSNTPCFG=1,-6,””,””

    Can you provide any words of wisdom?
    Thank you in advance,

    1. Hi Greg,
      I am also still battling with similar issues. Micro-python is definitely not my favorite language to use.
      The code that I posted, took me quite a few hours to translate from other examples, for other chips…

      From the responces you get back, it seems like the ESP01 is not happy with that ntp server…

      I suggest you do what I did, get a serial to usb device connected directly to that ESP01, keeping in mind that it MUST
      be powered with ONLY 3.3v. Also connect that 3.3v to the EN pin…

      Then connect that straight to the Arduino Serial monitor, and try out those commands. also ensuring that you can actually ping those servers from the ESP01 when connected to wifi…

      then try those in the Micropython Code…

      I also suggest that you place some sort of delay between the commands…
      I found out the hard way, that simply getting an IP address, right after connecting, fails, unless I add about 1 sec delay …

      Seems all is definitely not there yet, and for some reason, USING the ESP01 as a wifi Modem, from Micropython, is not documented …

      Everybody seem to flash it with micropython, which completely defies the object of us trying to use the Pico with the ESP01…

      Hopefully, C/C++ support will get better, and then things will get easier. Feel free to contact me directly on email if you need more help…

      I would love to help, as I am just as frustrated with this issue…



      1. Gregory Walters

        Thank you for your thoughts.

        I will try the serial direct from PC to ESP-01 to get see if I can get things to work.

        I agree with you that flashing the ESP-01 with MicroPython is the wrong way to go for this project. The idea is giving the Pico a “voice on the network” at least until there is more support for networking on the Pico, like the upcoming Arduino RP2040 board.

        I don’t think that anyone including the Raspberry Pi Foundation realized just how popular the Pico would be when it was introduced. The fact that the MicroPython port for the Pico is being updated everyday just goes to show how much effort is being put into getting it up to speed.

        I will update you if I find anything helpful.


        1. Thank you. Yes I agree, It is quite popular. I also believe the Arduino RP2040 will be quite a hit, If not only for the support that the Arduino ecosystem will bring to the party. Good Luck with the project.. I will also post here if I manage to find something else that is useful to everyone else out there 🙂

          1. This morning, I was able to connect the ESP-01 to an Arduino Uno and do direct serial commands via the Serial Monitor.
            I was able to get connected to my network and then using the AT+CIPSTART=4,”TCP”,”″,80
            to get a connection to an outside server, but was unable to create a packet formatted correctly the server.

            I’m afraid that the software inside the ESP-01 is too old to support all of the “advanced” AT commands. I don’t have the ability to flash a newer version of the firmware and it seems there are questions about which version should be used (from what I’ve seen on the Web searches that I did).

            Just between us (and who ever reads this), Cytron support couldn’t get it to work correctly either and they pointed me to your site.

            I agree that if anything needs to be done via network like MQTT, we’ll have to …
            a) wait for the Arduino RP2040 and…
            b) wait for the MicroPython port to the Pico to become more mature.

            This is the unfortunate side of working on the “bleeding” edge of technology. You have to be prepared to bleed a bit yourself :o}

            Thanks for you help and if I get any further, I’ll post it here.


          2. Hi Greg,

            Yes, I have also found that the AT Command Set of the ESP01 seems quite old…
            You can try to download an update from the espressive site ( the ESP manufacturer)

            I can however not say if it will be any better, as it seems like they focus more on the bigger chip modules…

            Waiting for the Micropython port to become more mature is definitely an option,
            and the same with the Arduino Port ….

            I agree, bleeding edge stuff is quite painful, as answers are few and far between 🙂
            I will also keep trying and give update here when i get to it …

            What I did see in my own experiments is that, although I can get the ESP01 to connect to WiFI, as well as host a transparent “server” on it, I can not seem to connect to it from outside ( This works well with Arduino however, making int possible to host a webserver on an Arduino UNO, with the ESP01 as a WiFi Modem … )

            The Micropython port is definitely not very mature at this stage … Circuit Python seems attractive option, But as it is still in Beta status, could not really get it to work on the pico at all ….



Leave a Reply

Your email address will not be published. Required fields are marked *