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 fsck.repair=yes 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

AT

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:

AT+CWMODE=1
AT+CWLAP

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


12. To connect to one:

AT+CWJAP="SSID","password"



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

13. Then find your IP address

AT+CIFSR



To disconnect for the AP, type

AT+CWQAP

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 https://github.com/guyz/pyesp8266.git

Then change into that directory and run the server code

python esp8266server.py /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.



  

133 comments:

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

    Basically press ctrl-a, z, then a

    http://arstechnica.com/civis/viewtopic.php?f=20&t=566236

    ReplyDelete
  2. I dropped minicom long time ago for screen:

    screen /dev/ttyUSB0 115200

    It made my life way simpler.

    ReplyDelete
  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).

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

    http://paulbyford.blogspot.co.uk/2016/03/updating-firmware-on-pimoroni-esp8266.html

    ReplyDelete
  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.

    ReplyDelete
  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 reset.py 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

    ReplyDelete
  7. 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

    ReplyDelete
  8. 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

    ReplyDelete
  9. 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

    ReplyDelete
  10. 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

    ReplyDelete
  11. 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

    ReplyDelete
  12. I really love your website.. Pleasant colors & theme. Did you create this website yourself? Please reply back as I’m wanting to create my very own blog and want to know where you got this from or just what the theme is named. Thanks! KBC Head Office Number

    ReplyDelete
  13. A backlink is a link created when one website links to another. Backlinks are important to SEO & impact for higher ranking. In my 7+ years seo Career i see, without backlinks a website doesn't rank higher on google SERP.

    Get Your 300+ High Quality DoFollow Backlinks Here!

    Order Now with Full Confidence & 100% satisfaction.

    ReplyDelete
  14. Oh my goodness! Incredible article dude! Many thanks, However I am encountering issues with your RSS. I don’t know the reason why I can't subscribe to it. Is there anybody else having the same RSS problems? Anyone that knows the answer can you kindly respond? Thanks!!
    Spot on with this write-up, I truly believe that this amazing site needs much more attention. I’ll probably be returning to read through more, thanks for the information!
    KBC Lottery Winner
    KBC Lottery Winner 2020
    KBC Winner List
    KBC Winner List 2020
    KBC Winner
    KBC Winner 2020
    kbc Lottery Winner 2020 List Today

    ReplyDelete
  15. The great website and information shared are also very appreciable. Black Parade Jacket

    ReplyDelete
  16. I have 901N Router I make this one like to use as a mini firewall I used this router at least one year as a firewall but now this router stop working i tried several MS but can't fix this Mad Sweeney Denim Jacket

    ReplyDelete
  17. Thanks for being an employee who is as hungry for challenges and excellence as much as for recognition and promotions.
    Thank you for the fantastic blog you have been doing. Virgin River Coat

    ReplyDelete
  18. Looking so yummy. I will try your this recipe for sure. Check this amazing Tate Langdon Striped Sweater available in discount.

    ReplyDelete
  19. Such a amazing content thanks
    we believe in what is shown must have given to the customers because product material matters the most so give a moment and check WandaVision Outfits

    ReplyDelete
  20. Thanks for sharing this articles this is really helpful for me. Check this amazing Men Daily Wear Leather Jacket available in special discount and with free shipping as well.

    ReplyDelete
  21. I think this is a very informative post and it is very useful and knowledgeable. Therefore, I would like to thank you for the efforts you have made in writing this post. Learn how to make an app like uber in android.

    ReplyDelete
  22. Great post i read your article is superb . This is given good information , adidas yeezy boost 350 v2

    ReplyDelete
  23. This is a very wonderful post I appreciate your work. Thank youdisposable face masks made in usa

    ReplyDelete
  24. Great article Lot’s of information to Read. Great Man Keep Posting and update to People.balenciaga triple s

    ReplyDelete
  25. I went to work before the last session. And therefore, when the session began, there was absolutely no time for study. And so I had to buy pre-written essays at once. And I got all the work in due time.

    ReplyDelete
  26. Juan -- Welcome!

    A "completely manuscript" is a finished, full-length novel. No novelettes, collections, etc. And definitely nothing incomplete. Agents do not want to be queried on incomplete works.schuhe damen

    ReplyDelete
  27. First of all, you're terrific to run these contests. Besides the chance to land an agent, this is a great way to get unvarnished criticsm. summer cardigan

    ReplyDelete
  28. A "completely manuscript" is a finished, full-length novel. No novelettes, collections, etc. And definitely nothing incomplete.jersey liverpool skills

    ReplyDelete
  29. First of all, you're terrific to run these contests. Besides the chance to land an agent,nike air max 98 Nike

    ReplyDelete
  30. I envy your piece of work, appreciate it for all the good content.best brooks running shoes for women in

    ReplyDelete
  31. This is the most popular game. I will be grateful to earn the real cashback. scarpe adidas ?

    ReplyDelete
  32. A "completely manuscript" is a finished, full-length novel. No novelettes, collections, etc. And definitely nothing incomplete.Nike Classic 1985,

    ReplyDelete
  33. Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work.womens new balances

    ReplyDelete
  34. This is the most popular game. I will be grateful to earn the real cashback.jersey arizona cardinals

    ReplyDelete
  35. Wow, this is very interesting reading. I found a lot of things which I need. Great job on this content.liverpool jersey

    ReplyDelete
  36. Let’s say you’ve spilled your coffee while at work, or in a restaurant. Either way, you’re not taking off your white shirt anytime soon, but need to get rid of this stain before going about the rest of your day. dr martens 2976 chelsea boot

    ReplyDelete
  37. Wow, this is very interesting reading. I found a lot of things which I need. Great job on this content.sac messenger pm voyager

    ReplyDelete
  38. I found your this post while searching for some related information on blog search... foulard carre

    ReplyDelete
  39. Thanks for sharing this article i really appreciate you for this you can now get discounted coupon on many categories available...new balance 574

    ReplyDelete
  40. Just when I couldn’t love you more. You posted this pic and my jaw dropped to the floor.descuento nike

    ReplyDelete
  41. I think this is the best I’ve seen till now. You can certainly visit your expertise inside the article you write.fjallraven au

    ReplyDelete
  42. Thank you ever so for you blog article. Much obliged. Really informative article. Really looking forward to read more.Nike Cross Training Shoes

    ReplyDelete
  43. Hy I'm Designer For Customize Leather Jackets. Please Visit Our Website. Captain Marvel Carol Danvers Cotton Tracksuit

    ReplyDelete
  44. I have checked this link this is really important for the people to get benefit from. cardigan sweater

    ReplyDelete
  45. Is Canad goose and Golden goose the same products? I have only heard about Golden Goose shoes and I have a pair of them. adidas stan smith

    ReplyDelete
  46. but they don't depreciate in value the same way most other jackets do, making them an investment.mike trout jersey signed

    ReplyDelete
  47. I found very helpful information on your post, thanks for sharing with your great knowledge, I have bookmarked to you for future updates.san francisco giants nike jersey

    ReplyDelete
  48. I would love to read more about your work to enhance my knowledge. adidas ultra boost weiß

    ReplyDelete
  49. Are you as enthusiastic about fall and winter trends as were? Because if that is the case then you better start working on your obsession of warm and cozy.adidas yeezy boost 350

    ReplyDelete
  50. I always found very much interesting content on your posts. keep posting, thanks for sharing us and giving us your precious time. jersey chelsea

    ReplyDelete
  51. If someone who just picked up a brand new phone and wants to make sure everything is up to snuff.zoom pegasus nike

    ReplyDelete
  52. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.black converse

    ReplyDelete
  53. Thanks for sharing this. I this food is health how much you will eat you will be fit and healthy.nike air max 90

    ReplyDelete
  54. I also wrote an article on a similar subject will find it at write what you think. kardigan damski allegro

    ReplyDelete
  55. You can make a video about it, post it on youtube and buy youtube subscribers to make your channel popular

    ReplyDelete
  56. This is very nice a single and provides in-depth data. Thanks just for this nice write-up.miami dolphins jersey

    ReplyDelete
  57. Standard daviation is a term of data on this subject we need a specialised calculator. basket new balance

    ReplyDelete
  58. HARDCORE CYCLES was started in the Greater Philadelphia area by a group of tight friends with a passion for V-Twin performance aftermarket parts.Visit our Website Thanks
    BASSANI XHAUST Road Rage 2 to 1 Short Exhaust System Bagger

    ReplyDelete
  59. Thanks to author it was very informative. Don't you think it's worth posting these thoughts on Instagram? After all, this social network is now very popular. By the way, I advise you to buy instagram followers in order to quickly increase their number and promote your account to the top.

    ReplyDelete
  60. I am glad you take pride in what you write. This makes you stand way out from many other writers that push poorly written content. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic Men’s Handmade Cowhide Leather Biker Jacket If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. thanks for wonderful info. If you want to know about the site Dragon Ball Z Goku 59 Leather Jacket click here and get the best Garrett Hedlund Sam Flynn Tron Legacy Leather Jacket jackets.

    ReplyDelete
  61. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. Cyborg Letterman Jacket

    ReplyDelete
  62. The very next time I read a blog, I hope that it won’t fail me as much as this particular one. I mean, Yes, it was my choice to read through, however I genuinely believed you would have something helpful to say. All I hear is a bunch of complaining about something that you could fix if you weren’t too busy searching for attention. Yellowstone Jacket Collection

    ReplyDelete
  63. I really impress your article such a wonder full information provide i really like your stuff keep it up dear . arsenal human race jersey

    ReplyDelete
  64. Wow, that is the thing that I was scanning for, what a material! present here at this site, s płaszcz męski

    ReplyDelete
  65. Wow such a stunning substance I never analyzed this before keep it up and keep on providing for us more solid information. Really research this now varsity bomber jacket and advantage it.

    ReplyDelete
  66. A "totally original copy" is a gotten done, full-length novel. No novelettes, assortments, and so forth Furthermore most certainly nothing inadequate. Specialists would rather not be questioned on inadequate works. mountain warehouse jackets

    ReplyDelete
  67. This is very nice a single and provides in-depth data. Thanks just for this nice write-up matalan coats

    ReplyDelete
  68. Aussie Jackets not only offers you the readymade collection but take custom bulk orders and Free Delivery. Visit My Website To Order. adidas yeezy

    ReplyDelete
  69. Bravo! Can you please also right such amazing posts related to mobile app development, we are emerging in the same domain contact us for more info and collaboration. adidas samba

    ReplyDelete
  70. Thanks for sharing with us your precious time to create this post. kurtka z kapturem

    ReplyDelete
  71. CSS Founder is known as the best Website design company in Dubai. You can connect with us if you want a dream website for your business.

    ReplyDelete
  72. Are you looking for the best SEO Company in Delhi that can provide you white hat SEO services? If yes then connect with Promotedial and increase your online business worldwide.

    ReplyDelete
  73. Money is any item or verifiable record that is generally accepted as payment for goods and services and repayment of debts,basket homme puma

    ReplyDelete
  74. The term happiness is used in the context of mental or emotional states, nike air max 98

    ReplyDelete
  75. Connect with the best infrastructure company that can provide you the best home at the best location. We can be the right choice for you. Call us and book now.
    Upcoming projects in Sector 79 Noida

    ReplyDelete
  76. Jilin Freed Trading Ltd was stablished in 2017, and has specially been recognized for it's quality machinery products or medical. aktuelle nike

    ReplyDelete
  77. The going with time I read a blog, I recognize that it doesn't beat me however much this one down. Considering everything, I like it was my decision to look at, yet I genuinely thought you have something astonishing to say. All I hear is a huge load of crying concerning something that you could fix if you weren't very clamoring searching for thought. nasa bomber jacket

    ReplyDelete
  78. I have been reading out some of your articles and i must say nice stuff. nike air vapormax online

    ReplyDelete
  79. Wonderful article, thanks for putting this together! This is obviously one great post. gants cuir

    ReplyDelete
  80. Thanks for the valuable information and insights you have so provided here.bransoletka z zawieszkami

    ReplyDelete
  81. I also wrote an article on a similar subject will find it at write what you think.beach hats

    ReplyDelete
  82. This is really a great bluesman thank you for the beautiful music. converse ballerina

    ReplyDelete
  83. Steadfast Service can you provide Work Permit in Croatia from Dubai. If you want to get it then connect with us to get better and fast service.

    ReplyDelete
  84. Do you want to get the best tent supplier and manufacturer in Dubai, UAE? If yes then connect with AL Mumtaz tents, this is very old and reputed company in Dubai.
    Car parking shades Dubai

    ReplyDelete
  85. Contact us if you want to grow your business through a website. We are the best website design company that provides services in this digital world, visit here to contact us.
    Website design company Dnipro

    ReplyDelete
  86. We can provide you best iphone insurance plan connect with us. For more information visit our website
    Online Iphone insurance

    ReplyDelete
  87. We are very thankful to you for sharing this post. We have a wide range of leather goods and browse our online store with the name of jackets in leather.
    Leather Shirt Mens
    Leather Vest Mens
    Leather Biker Jacket Women
    Aviator Jacket Women

    ReplyDelete
  88. This comment has been removed by the author.

    ReplyDelete
  89. hey, usually I never comment on any site but your post is very informative. I am here to telling you that If you want to purchase some books in lowest price so, you can purchase it amazon book coupons from here.

    ReplyDelete
  90. I really impress your article such a wonder full information provide. travisscottshop

    ReplyDelete
  91. Additionally, the FUR Aviator Pilot Jacket's abdomen is decorated with a belt, a soft and warm hide, and additional wrapping. For the winter months, grab this magnificent Aviator flying Pilot fur jacket, and be ready to embrace the chill in extreme style!

    FUR Aviator mens flight jacket is offered by Jacketars. Check out the other stylish Emily's Outfit and other top-selling jackets, including the Avengers, Cyberpunk 2077, Yellowstone, and Guardians of the Galaxy jackets. Check out the most popular TV-series jackets, biker jackets, movie jackets, gaming jackets, and cafe racer jackets as well.

    ReplyDelete
  92. Thanks for sharing the informative article. It is really very valuable and interesting.
    Best Place to Stay in Lansdowne

    ReplyDelete
  93. lilpeepmerchandise.comI found such a large number of intriguing stuff with regards to your blog particularly its conversation

    ReplyDelete
  94. charlidameliomerchI found such a large number of intriguing stuff with regards to your blog particularly its conversation

    ReplyDelete
  95. Thanks for sharing this wise chromeheartsoutfit and mindful content , keep it up mate

    ReplyDelete
  96. Thanks for providing the best and nice information about it. This is very good. I hope, I will read your next blog soon
    Vastu for Villas in Dubai

    ReplyDelete
  97. Really want to appreciate your efforts for this post
    gift to Pakistan

    ReplyDelete
  98. Thanks! I read your content very carefully and deeply, it is so amazing and interesting. Do you want to rank your website through Expect-From-Top-SEO-Companies (Search Engine Optimization)?

    ReplyDelete
  99. I have been looking for this type of post and you have provided this to me. Very thankful to you send flowers to oman online

    ReplyDelete
  100. Great ideas and are really helpful for someone looking for start a blog. Birthday gifts to Pakistan

    ReplyDelete
  101. Thanks for this wonderful article it was nice and amazing keep sharing your good content with us. Celebrity Leather Jackets

    ReplyDelete
  102. Its a really impressive blog of today. Please write according to lifestyle and daily wear because i need it N7 Black Leather Jacket. Hope you will share in next move.

    ReplyDelete
  103. Wonderful blog post. This is absolute magic for you!
    Kristoffer Polaha Jacket

    ReplyDelete
  104. Thanks for this beautiful thing. it is really amazing. I love it.Areenadesign

    ReplyDelete
  105. I'm looking forward to reading more posts like this in the future. I'm confident that many readers will benefit from this post. Thank you for sharing your knowledge and expertise.
    file uncontested divorce virginia
    protective order violation virginia

    ReplyDelete
  106. Are you planning a trip to India and need a visa? Look no further, as we offer a seamless and hassle-free online visa application process. At Visit Visa, we understand the importance of a seamless visa application experience, and we aim to make the process as simple as possible for travelers. In this blog, we will take you through the step-by-step process of applying for an India Visa online, highlighting the main requirements and documents required.

    ReplyDelete
  107. Your blog is a breath of fresh air in the digital landscape, offering insightful perspectives with every post. leather bags for women

    ReplyDelete