Thursday, 4 February 2016

Getting started with the Pimoroni ESP8266 IOT pHAT

The ESP8266 pHAT from Pimoroni for adding wifi to your Raspberry Pi projects.  Here's a brief 'quick-start guide'. If you're going to use the pHAT on a Pi Zero, it can be easier to do the config on a full-size Pi then just transfer the pHAT and SD card when you're all done.

1. Start with a fresh install of Jessie

2. sudo apt-get update

3. sudo apt-get upgrade

4. sudo apt-get install minicom

5. We need to stop the Pi using the Serial port for console messages. Edit /boot/cmdline.txt to remove 'console=ttyAMA0' from the line. You should be left with:

dwc_otg.lpm_enable=0  console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

6. sudo raspi-config. Go to Advanced Options => Serial and set it to disabled.

7. Shutdown the Pi

8. Solder the header onto the pHAT. Attach to the Pi and power up.

9. Now we can connect to the ESP8266 via a serial connection. Run minicom -b 115200 -o -D /dev/ttyAMA0

10. To test, type


and hit enter/return as normal. Then type ctrl+j 

You should see the reply OK

11. Now you can start putting the ESP8266 to work. There's a useful list of AT commands here, but to get started try:


which will list all the wifi Access Points that it can see.

12. To connect to one:


Obviously replace SSID and password of the network you're trying to connect to!

13. Then find your IP address


To disconnect for the AP, type


Don't forget the ctrl-j after each command. 

To quit minicom, type ctrl+a then q

14 As a more advanced test, you can set up your Pi as a simple web server.  Download this really useful python code:

 git clone

Then change into that directory and run the server code

python /dev/ttyAMA0 115200 "SSID" "password"

You should see a whole bunch of familiar AT commands being executed. When everything has finished, fire up your web browser and connect to the IP address just allocated to your PI/ESP8266.

You should see the system date displayed:

Once you're finished developing, transfer everything over to your Pi Zero.



  1. The following forum posts explains how to set minicom to send the linefeed (ctrl-j)

    Basically press ctrl-a, z, then a

  2. I dropped minicom long time ago for screen:

    screen /dev/ttyUSB0 115200

    It made my life way simpler.

  3. Great guide. I have followed all steps and everything works until I try the example server code, connection to my WiFi router completes but when I try and browser to the IP address nothing is returned (browser times-out).

  4. Great post Richard. It inspired me to continue your work and write a post on how to flash the firmware on the pHAT:

  5. after I typed "AT+CWMODE=1" the esp8266 disappeared from my wifi devices and all i get is error messages from minicom. I do not know what happened. Is there any way to reset it? It is now not getting recognized by any of my Pi's.

  6. I get nothing. I followed the instructions and when I get to minicom, it comes up and I get nothing but help screens and other things pop up, no communication though. I went to the update firmware page and the script causes lights on the esp8266 but I get no indication of any kind in minicom. Across the bottom of minicom is 115200 8n1 | vt102 | offline | ttyAMA0

  7. I wish to indicate because of you only to bail me out of this specific trouble. As a consequence of checking through the net and meeting systems that were not beneficial, I thought my life was and safety course in chennai

  8. Thank you so much for sharing this worth able content with us. The concept taken here will be useful for my future programs and I will surely implement them in my study. Keep blogging article like this.
    offshore safety course in chennai

  9. I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.
    safety course in chennai

  10. I was curious if you ever considered changing the layout of your site? It’s very well written; I love what you’ve got to say.
    nebosh course in chennai

  11. Hello. This post couldn’t be written any better! Reading this post reminds me of my previous roommate. He always kept chatting about this.
    fire and safety course in chennai

  12. Excellent Blog. I really want to admire the quality of this post. I like the way of your presentation of ideas, views and valuable content. No doubt you are doing great work. I’ll be waiting for your next post. Thanks .Keep it up!
    Kindly visit us @
    Luxury Boxes
    Premium Packaging
    Luxury Candles Box
    Earphone Packaging Box
    Wireless Headphone Box
    Innovative Packaging Boxes
    Wedding gift box
    Leather Bag Packaging Box
    Cosmetics Packaging Box
    Luxury Chocolate Boxes

  13. Thanks for this amazing blog, I really appreciate with your blog. Ogen Infosystem provides one of the best Website Designing Services in Delhi.
    Website Designing Company

  14. Aw, this was an incredibly nice post. Taking the time and actual effort to produce a really good article… but what can I say… I hesitate a lot and don't manage to get nearly anything done.
    kbc official winner