WifiShield with arduino uno compiling error

Hi @andreijrs,

You don’t have a separate serial port on the UNO, so you need to disable the debug port and use Serial to connect to the ESP shield. You don’t need to define pins as it is knows them already. They are the ones labelled RX and TX on the board. Just note when programming that you disconnect the ESP from the UNO so there are no confilcts, then reconnect after programming.

You can try adding a second serial port with the software serial library if you want to keep debug, but note that the UNO doesn’t have much program space if you plan on adding more user code.

See here:

/*
Cayenne ESP8266 Shield WiFi Example
Adapted from Blynk's ESP8266_Shield_HardSer Example

This sketch connects to the Cayenne server using an ESP8266 WiFi module as a shield connected
via a hardware serial to an Arduino.

You should install the ESP8266HardwareSerial.zip library via the Arduino IDE (Sketch->Include Library->Add .ZIP Library)
from the Cayenne extras/libraries folder (e.g. My Documents\Arduino\libraries\Cayenne\extras\libraries) to compile this example.

NOTE: Ensure a stable serial connection to ESP8266!
      Firmware version 1.0.0 (AT v0.22) or later is needed.
      You can change ESP baud rate. Connect to AT console and call:
          AT+UART_DEF=115200,8,1,0,0

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Channels, data
should be sent to those channels using virtualWrites. Examples for sending and receiving
Virtual Channel data are under the Basics folder.
*/

//#define CAYENNE_DEBUG         // Uncomment to show debug messages
//#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneESP8266Shield.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "";
char ssid[] = "";
char password[] = "";


// Set ESP8266 Serial object
#define EspSerial Serial
ESP8266 wifi(EspSerial);

void setup()
{
	//Serial.begin(9600);
	delay(10);
	// Set ESP8266 baud rate
	EspSerial.begin(115200);
	delay(10);

	Cayenne.begin(token, wifi, ssid, password);
}

void loop()
{
	Cayenne.run();
}

Cheers,

Craig