ESP8266 Support WIKI

User Tools

Site Tools

Command disabled: backlink

raspberrypi:getting_started

Table of Contents


Getting started with ESP-01 and Raspberry Pi

There are a number of different modules that all feature the ESP8266EX chip - some that have been numbered ESP-01 to ESP-12 as well as others, and new ones are being made all the time.

Requirements

  • ESP-01
  • Raspberry Pi A+ or B+

ESP-01 module looks like this (ensure you have later version with chip marked ESP8266EX): And we'll be using a Raspberry Pi running Raspbian operating system to talk to the module. As well as these two boards you'll need something to connect them together - ideally some female to female jumper cables. The Raspberry Pi has a serial port that works on 3.3v logic which is handy. However, the older Raspberry Pi models A and B won't work like this - only the newer A+ and B+ are able to supply the module with enough power, as they use a different power supply conversion system that can deliver the required ~250mA during transmissions.

So - if you only have a model A or B then you'll need to find another way to power the module. A fresh pair of AA alkaline batteries would probably work, even though the batteries are only going to be giving you 3.0v or even less, often the modules will carry on working. However you power the module, make sure you connect the two grounds together, so that your system is sharing a common reference. That is, make sure you connect the ground of the raspberry pi to the negative of the battery or other power source, as well as to the module.

Wiring

OK so assuming you've got a newer model A+ or B+, attach the pins of the Raspberry Pi to the ESP-01 module like this: So to summarize - that's VCC to 3.3v on the Pi, ground to ground, Tx to Rx and Rx to Tx, and connect the CHPD (Chip Power Down) to VCC to disable the chip power down and make it power up! If you are using female to female headers then getting both VCC and CHPD connected might be easier this way: Now, we need to do a little bit of software work on the Raspberry Pi side to use the port we've just connected our module to. Using Raspian operating system, edit the inittab file by typing at the terminal 'sudo nano /etc/inittab'. Then look at the bottom of the file for the line that starts 'T0:23:respawn:/sbin/getty' - put a # at the beginning of the line to disable it. Then save and reboot - this stops the Raspberry Pi from outputting onto this port, so that we can use it for inputting!

Communication

Now we need to install a terminal communications program - several are available but I use picocom because I'm used to it. So, again on the terminal, do a 'sudo aptitude update && sudo aptitude install picocom'.

Now you should be able to jump into a terminal onto the module by typing 'picocom /dev/ttyAMA0 –omap crcrlf' into a terminal window on the Pi. If you just get the picocom startup messages and no response to pressing enter then try disconnecting the power and reconnecting it. You should see a bit of garbage and then a line like [System Ready, Vendor:www.ai-thinker.com]. If you type AT+GMR and press enter the system should respond with the firmware version.

Congratulations - you've connected to the module!

If you just get garbage try changing the baud rate (with control A then control U or control D) - maybe the connections aren't made correctly, or maybe you have a duff board?

Search around the forum for people having the same symptoms as you, and if that doesn't help resolve your problem then why not ask in the forum for help?

raspberrypi/getting_started.txt · Last modified: 2014/12/31 18:44 by george-hopkins

Page Tools