WifiShield with arduino uno compiling error


Got connected to cayenne using ESP8266…


please give one suggestion…
in our college cyberoam login is there…we have given separate id to use internet services.after connected to the wifi, login page is appear, in which we have to fill login info to acess the internet…

firstly, i connected to my college wifi.it got connected but i am not able to access internet because of login problem(i dnt know how to enter login details after connecting esp8266 to arduino)…

i tried by using mobile internet…got succeed…

please help me to connect using college cyberroam network


Sorry @vin3yasukhadeve,

That is a very specific thing that is really beyond the scope of what Cayenne does.

However, if we could find a generic method, it would be exciting to have this functionality.

Honestly though, it’s probably pretty tough to do as your ESP would have to be able to work with SSL certificates in order to submit your login information.




Hi @vin3yasukhadeve,

Are the analog reads good?

I could see an issue with the DHT read as I believe this sensor takes as much as 2 seconds to return with valid data.

Check here for how to error check your return values:




after uploading the code the device does not get connected to the dashboard .
the serial monitor output:


Hi Craig,

I’m using Arduino Uno with ESP-01, I have compiled your program without error.
Unfortunately, I cannot see my device connected to Wifi Router.

I’m sure my ESP-01 is ok, because when I use the code: AT+CWJAP=“MyRouter”,“Password” it says:

I have tried to connect ESP-01 first to the wifi, upload your sketch without error but the device didn’t connect to cayenne.
I have tried to remove connection with AT+CWJAP=" “,” " disconnect the wifi with AT+CWQAP, upload your sketch again, but no luck.
Is there any prerequisite required with AT Command to the ESP-01 before I upload the sketch?

@vin3yasukhadeve can you help me by paste your successful scripts here? I just want to double check if I was missing something. Thanks.



Have you connected any of your devices to Cayenne yet on your wifi network?

If not, try this to confirm your router isn’t blocking the outbound port.




Hi Craig,

Thanks for the response.
Yes, I have tried 2 type of devices NodeMCU and Wemos connected to Cayenne without problems.

I am sure it’s not about firewall because when I upload the script, there is no new DHCP client connected in my router. (It’s only shown in DHCP client when I am debuging the connection with AT+CWJAP=“MyRouter”,“Password”).


Hi @kreggly
Do you know how to solve this type of error? ; (I’m using an arduino one + ESP8266)

C:\Users\Ricardo\Documents\Arduino\libraries\Cayenne-MQTT-ESP8266-master\src/CayenneMQTTESP8266.h:21:25: fatal error: ESP8266WiFi.h: No such file or directory

I attach the code, greetings
exampleesp8266.txt (1.7 KB)


That sketch is not designed to use the ESP as a shield. It is designed to reflash the firmware inside the ESP with this sketch. The Uno is entirely un-necessary. If you are trying to compile it for Uno, I can see how you might get errors.

I have not seen a sketch yet that uses the ESP as a shield yet with MQTT.




And with a wifi shield if possible? What type of wifi shield should I buy to connect my arduino one by wifi to cayenne? . I’m new to this, I thought with an ESP8266 module that was enough.


The ESP modules are magical. They can actually be programmed with an Arduino sketch. You don’t need an Arduino at all.

If you do want to use an ESP with an Uno, so you have access to the IO etc, you can use the ESP as a Uno WiFi shield. You just need to use the Blynk based Cayenne library and program the ESP with an AT command set.

You can also upload the ESP MQTT sketch to the ESP - the sketch you attached earlier, and get connected to Cayenne.

I do not know of a way to use the ESP as a Uno WiFi shield with the Cayenne MQTT however.

Does this clarify things for you.




Finally after so many attempts following this conversation. I finally tried this method. After so many attempts, finally the code was successfully uploaded to Arduino. But when I opened my Cayenne Dashboard, the Arduino was still offline. The Serial Monitor displayed the following messages :
Did i miss out any steps or something. Kindly do help me asap. I’m stuck with this since long time. Your help is much appreciated.


Hi @saromarimuthu

Were you able to flash the ESP firmware with the AT command set? @kreggly may be able to help there. I’ve done it but can’t remember where I got the .bin file used for the AT set. I used a flash program I found online and used a USB to TTL card to connect to the rx and tx pins.


Yeah, I have the PlDuino talking Cayenne.

I’ll write something up showing how soon.

You can use the NodeMCU windows app to load AT SW. I put 1.3 in the PlDuino
ESP-02. The Cayenne lib supports 1.0 and above.




I finally hooked up my ESP-01 to my UNO and your code is working for me as well. One thing that I do have to point out is that “#define EspSerial Serial1” does not work on an UNO. The correct line is “#define EspSerial Serial”. Found this on another forum:

Arduino Uno doesn’t have Serial1, only Serial:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

I’m not exactly sure what they mean by Arduino Uno doesn’t have Serial1, only Serial.

Arduino Mega 2560 + ESP8266-01
Waiting (forever) for board to connect

This is true for Uno. I made that statement elsewhere. We really need a clean space to put moderated/tested solutions :stuck_out_tongue:

I’d like to figure out how to get Cayenne to support the Software serial library. Then we could drop the ESP on some generic pins and keep “Serial” for debug. The Cayenne lib doesn’t like being passed a Software serial port.




hi… my wifi module model is ESP8266 12F, FOR THIS MODULE how i connect ?


Two ways.

Program the ESP with firmware that speaks cayenne.

Program it with the AT command firmware and command it with an arduino
through the serial port.

Both ways are detailed on the forum.

When I have time, I have been asked to make better howtos on connecting the
myriad ESP devices, but I only volunteer here. My day job designing control
systems keeps me pretty busy :slight_smile:

If you don’t find the answers by searching the forum, I’ll likely get
around to some documentation this Saturday. Sunday, I’m brewing beer!


I get the following error:
Arduino: 1.8.2 (Windows Store (Windows 10), Board: “Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS), ck, Disabled, None”

C:\Users\Pavitar\Documents\Arduino\libraries\ESP8266HardwareSerial\ESP8266.cpp:22:26: fatal error: avr/pgmspace.h: No such file or directory

#include <avr/pgmspace.h>


compilation terminated.

exit status 1
Error compiling for board Generic ESP8266 Module.