ESP8266 ESP-01 WIFI Shield for Arduino


Just to start off and getting everyone up to speed on my suggestion: I have developed a control that controls the crockpot from a remote location using Blynk. You would think this is a simple task but it isn’t. The idea is to maintain the temperature in the crockpot below the point where the meat cells burst. If the temperature is too high, the cells burst and the result is a dry taste to the meat. You also want to bring this pot up to temperature as quickly as possible to reduce the cook time. So, I switched from a simple bang bang control to a PID control. This was not easy. There are about 5 heat transition points in this system starting from the heating element, the air, the thick ceramic crockpot, the liquid and the sheath on the thermistor. Together this results in a 5 minute lag between the turn-on of the element and the heat reaching the thermistor. The NANO was selected because I wish to use this configuration for other projects. Connecting the WIFI ESP-01 to NANO was a small challenge.

My wife loves it. She fills the pot, plugs it in, goes to work. At work, she can programme the start time and cook time, start it, gets confirmation that it has started and and view the temperature in the pot. When she’s gets home, it is perfectly cooked. I don’t like Blynk. Text is small and you have to pay for their services in a sneaky way.after you reach a limit.

Now… the ESP8266 has many configurations. The ESP-01 is the smallest and is best suited to fill the role of a WIFI shield for a controller. This is probably the reason why it has only two digital I/O pins. The ESP-01 comes with the AT Firmware preinstalled. Now this is very important to understand. You can serially connected (TTL 3.3V on ESP.01 RX) and send AT commands with the expected replies. What some people do is overwrite this programme with a control sketch to play with the two pins. Then try to use it as a WIFI shield and find that it no longer communicates with AT commands. You have to download that AT firmware once again. And it isn’t that easily available. So in a nutshell, don’t touch it. Leave it alone. At $2 a pop, it’s a great WIFI shield for a NANO.

I used Blynk’s .h library to connect ESP-01/NANO to their servers. Great. If you like I can reply with a sketch I used. There are two in fact. The first is completely automated. The second requires some coding but the advantage is you can control how the system recovers when WIFI/power is lost. The second is the best bet to connect to Cayenne if you don’t want to connect to Blynk’s servers.

What I don’t see is that option here at Cayenne. When I pull up Arduino and specifically NANO and look for the ESP-01 shield, I don’t see it. There is an ESP8266 stand alone but I’m not interested in that. Remember that the ESP-01 comes preprogrammed with the AT Firmware and I want to leave it intact so the stand alone ESP8266 - ?? is not an option. I have been searching this community for a “quick fix” and that hasn’t resulted in anything I could use. Almost all topics center on using the ESP8266 as a stand alone controller. Actually, all the topics do.

So, what I ask is this… is there a topic I missed that explains how to configure the Arduino with an ESP-01 WIFI shield to work with Cayenne? If not, does anyone wish to write one? Or am I on my own and have to come up with a fix?


Welcome to Cayenne!

It’s a bit hidden, but here it is. I agree that eventually there should be some official support, but for now this is how you do it. Let me know if that helps!


Thank you, Adam.

Good news and bad news.

The good news is that you people are doing something.

The bad news is that this is not a complete solution for my setup.

Let me explain: The solution given uses two hardware serial ports. There are a couple of Arduino’s that have that, like the Leonardo (TTL RX TX identified as Serial1). But, the NANO does not. We get around this by using software serial. SoftwareSerial.h is built into the Arduino IDE. Now… the other problem is that although they say softwareSerial will work on any pins up to 115200 baud… in truth for the NANO it does not. We have to slow down the ESP8266-01 to 9600 baud. The easiest way to do that is to simply use a TTL USB serial cable to connect to the ESP with a 3.3 power supply and voltage divider on ESP RX (I have a 3.3 RX TX version). Testing the connection with Arduino Monitor set at 115200 with AT should get a response OK. If not… you pick the next speed. Sometimes its 57600. If you do, you send a command AT+CIOBAUD 9600. Then change Monitor to 9600 and hook up again. AT > OK. To test the radio, AT+CWLAP will list all the available networks in the range of the ESP.

You now connect the ESP to NANO. I identified DO pins 10 and 11 as my communication port to work with ESP. That now allows me to use the USB port to monitor Serial.print messages.

This is the programme I use to test the setup. I don’t know who wrote it. But it’s a simple programme. This is also how Blynk works around it. Now I took a peak at a couple of header library files that Cayenne and Blynk have written… and I’m not going to reverse engineer this stuff. Unless you know what was in the programmer’s mind, it’s difficult to follow. So, what I’m asking you do to is to try to work it out using SoftwareSerial? I’d love to test out Cayenne with NANO and ESP-01. Otherwise, I notice you don’t have MKR1000 included. That would have been my other choice. I firmly believe this is important for Cayenne to have startup examples that cover either one. Preferably both.

// Basic serial communication with ESP8266
// Uses serial monitor for communication with ESP8266
// Pins
// Arduino pin 2 (RX) to ESP8266 TX
// Arduino pin 3 to voltage divider then to ESP8266 RX
// Connect GND from the Arduiono to GND on the ESP8266
// Pull ESP8266 CH_PD HIGH
// When a command is entered in to the serial monitor on the computer
// the Arduino will relay it to the ESP8266

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(10, 11); // RX | TX

void setup()
Serial.begin(9600); // communication with the host computer
//while (!Serial) { ; }

// Start the software serial for communication with the ESP8266

Serial.println("Remember to to set Both NL & CR in the serial monitor.");


void loop()
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( ESPserial.available() ) { Serial.write( ); }

// listen for user input and send it to the ESP8266
if ( Serial.available() )       {  ESPserial.write( );  }



Hi @fred2013ies, welcome to the Cayenne Community!

We do have MKR1000 support through our MQTT API, if you add the device as “Bring Your Own Thing” rather than through the Arduino menu in the Cayenne UI. Here is the sketch in question, and the whole library itself.

That sketch has some commented example code to show how you can send and receive sensor and actuator data to our platform, and can of course be extended upon. This might be a simpler solution than tethering an ESP to an Arduino board and troubleshooting that communication.



It is possible to setup debug on the software serial port and leave the hardware port for the Cayenne libraries to connect to the ESP. The ESP stuff is not for the faint of heart. There are multiple variants, and multiple firmwares, and that is why ESPs are only officially supported as standalone right now.



Thanks. I’ll look it up. On the issue of NANO… got it working. What I did was put the ESP on the TTL TX RX pins and use softwareSerial to set up pins for diagnostics and put my TTL cable there. It works!!



I used software serial to setup a monitoring port and used my TTL cable to connect to the PC. The ESP-01 was connected to the NANO RX TX pins after the download. The ESP is a heavyweight and by sticking to hardware it would solve my problems. Monitoring the software serial port wasn’t a biggie so using softwareSerial.h there was a good choice. When I started it up, the MONITOR used the USB port that the TTL cable was on and displayed a message I set up. The native RXTX port connected to ESP and was able to connect to your servers. I then went ahead and designed my first dashboard… DO pin 13 to turn on and off. Hello World lives!!!

You people should write this up properly and put it in the Newbie setup pages.

In any event… the setup of one ESP-01/Chinese NANO and the tiny 3.3 V PS cost me under $10 USD.


Graig… This just arrived in my email and I immediately thought of you. :grinning: I understand what you mean about the AT firmware that differs from one manufacturer to another… generally I find the new stuff pretty consistent. It is possible to upgrade the AT firmware on ESP but that’s another story. ESP is shooting up like a rocket and I hate to see Cayenne miss out on the excitement. Hackster ESP8266 Contest But WAIT… I see My Devices in as a sponsor. You sly devil you.



The handsome fella on the right is not @bestes. He’s the other one.




Hi @fred2013ies, I am a newby in IOT and I am working on a class project since weeks and could not be able to get thing worked. Your solutions should help end my project in schedule. Coud you please email me your source code or post it here? Thank you in advance.



See this post


@adam @shingyfetue @kreggly @rsiegel Hey guys. We just provided support in our MQTT Arduino library for using ESP8266 as a shield :slight_smile: We’ve done basic testing and works well. Give it a try for your project and let us know how it works out for you !

Here is the updated library on our github:

and the code can be found here: