WifiShield with arduino uno compiling error


#64

What libraries are you loading? could you post your code?


#65

This is my code, it’s actually from examples, cayenne mqtt esp8266

// This example shows how to connect to Cayenne using an ESP8266 and send/receive sample data.
// Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling. 

//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

// WiFi network info.
char ssid[] = "ssid";
char wifiPassword[] = "wifiPassword";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "MQTT_USERNAME";
char password[] = "MQTT_PASSWORD";
char clientID[] = "CLIENT_ID";

unsigned long lastMillis = 0;

void setup() {
	Serial.begin(9600);
	Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}

void loop() {
	Cayenne.loop();

	//Publish data every 10 seconds (10000 milliseconds). Change this value to publish at a different interval.
	if (millis() - lastMillis > 10000) {
		lastMillis = millis();
		//Write data to Cayenne here. This example just sends the current uptime in milliseconds.
		Cayenne.virtualWrite(0, lastMillis);
		//Some examples of other functions you can use to send data.
		//Cayenne.celsiusWrite(1, 22.0);
		//Cayenne.luxWrite(2, 700);
		//Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);
	}
}

//Default function for processing actuator commands from the Cayenne Dashboard.
//You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_IN_DEFAULT()
{
	CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s", request.channel, getValue.getId(), getValue.asString());
	//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");
}

#66

Have you had much luck getting it to run yet?


#67

I tried just now loading cayenne onto my nodeMCU 1.0 board and got your error. I changed the old reference avr/pgmspace.h and still same error. I traced it back to a library I had installed called freeRTOS. I uninstalled it and then it compiled & uploaded fine.

Maybe try removing all your user added libraries except the necessary ones for the esp and try it?


#68

You have a node mcu board. Try selecting Node MCU instead of generic ESP8266 board.

Cheers,

Craig


#69

@kreggly tengo una pregunta soy principiante como copio el archivo en el directorio cayenneesp8266shield.log ya le cambie la extension pero nose como copiarlo en el directorio podrias ayudarme?


#70

Oh we need to write some better howtos for ESPs. I’ve been so busy with my day job, I struggle to get my hobby stuff done.

Cheers,

Craig


#71

@pavitar
Are you having any luck getting Cayenne on your esp? I thought of something. Do you by chance also have the Blynk library installed?


#72

Nope. I tried installing the blynk library as well. Please guide me.


#73

You should not have the Blynk library installed. It may conflict. Cayenne is leveraging an earlier Blynk library (open source) and having the newer library installed may confuse the compiler.

Remove it, you don’t need it.

Have you tried picking NodeMCU instead of Generic ESP from the list of boards?

Cheers,

Craig


#74

No. I will try that. Also now I have a different esp8266 - WeMos D1. Will try with that as well.

UPDATE: Working well with Wemos d1 and Wemos d1 mini


#75

Excellent to hear!


#76

I have uploaded the code in my Arduino Uno Board connected with Wifi8266 Shield on RX at 7 and TX at 8 Pin.

/*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
#include <CayenneESP8266Shield.h>

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

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(7, 8); // RX, TX
#define CAYENNE_PRINT DebugSerial  // Comment this out to disable prints and save space

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

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

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

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

How I can come to know my ESP8266 wifi module is connected to my wifi router??


#77

@er.simarpreetsingh,

How I can come to know my ESP8266 wifi module is connected to my wifi router??

Open up your Serial Monitor in the Arduino IDE, and look for the message “Connected to Wifi”.

Cheers,

Craig


#78

I am getting this on my Serial Monitor:

Please help.


#79

Can you give us the output from power on?

Thx,

Craig


#80

I attached the Arduino Uno Board to my USB Port and I opened serial Monitor and then I compiled and Upload the following code in Arduino UNO attached with ESP8266 Wifi Shield.

/*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
#include <CayenneESP8266Shield.h>

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

#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(7, 8); // RX, TX
#define CAYENNE_PRINT DebugSerial  // Comment this out to disable prints and save space

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

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

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

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

This all output I got on my Serial Monitor.
Is it possible to take remote session of my system?


#81

If you’re not seeing anything in your serial monitor the next simplest thing is to log in to your router and look at your DHCP leases.


#82

I have opened console of Router, and have checked for the DHCP leases.
I am able to find the new DHCP entry having new MAC Address with my PC hostname. I think since Arduino Uno board is connected with my PC directly through USB cable, so it is using the Internet from the PC.

If I disconnect the USB Cable from the PC and Arduino Uno Board, then I am not able to see any DHCP leases.


#83

Team, Any suggestions??