Arduino Mega + Esp8266/or NodeMCU


#1

Hi guys i like cayenne. I am making some sketchs with NodeMCU it is working fantastic but why we can use Arduino Mega + Esp8266? I am trying to make a IOT and i really need 30-40 pin. Before the cayenne i used thingspeak and it is really work good with arduino mega and esp8266. Cayenne is better than thingspeak but i need to use arduino mega + esp8266 or arduino mega + nodemcu or just esp32. Why alll these cayenne ardino librarys are working with ethernet cable shield? Cayenne can you write better library ?


#2

@ozbayalperen1 esp8266 as a shield is not officially supported by cayenne but this will get you going


#3

Dude, i am trying this method but it’s giving an error: http://prntscr.com/hd6f2f
Why Cayenne employees don’t make a good library for arduino + esp8266? All makers have an arduino and esp8266 is the cheapest solution for wireless. This project is very important for me. Please help team Cayenne. Thanks Craig.


#4

extract the zip file and add the library into the library folder of your arduino manually.


#5

Okay i made this library thing i think but it is giving error when i clicked verify button:

Arduino:1.8.4 (Windows 10), Kart:“Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Users\mucittin\AppData\Local\Temp\arduino_modified_sketch_657397\sketch_nov21a.ino:24:34: fatal error: CayenneESP8266Shield.h: No such file or directory

#include <CayenneESP8266Shield.h>

                              ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


#6

You will need to install the attached CayenneESP8266Shield.log to your Cayenne library directory and rename it with a .h extension.


#7

If you want maybe we can use teamviewer and discord.


#8

do the above step and you will be good to go.


#9

Okay i will try again.


#10

Is this Cayenne ESP8266Shield.h file must be there? —> My Documents\Arduino\libraries\Cayenne\extras\libraries


#11

My Documents\Arduino\libraries\Cayenne. in this you will see many .h files. add there.


#12

Hi i made this folder thing but it is giving errors: http://prntscr.com/hd8i6k
We are getting close to make thanks, Craig.


#13

try this code.

/*
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();
}

#14

It is not giving an error but does not work. http://prntscr.com/hdclri


#15

it should work by now. i am not sure what this error is. @rsiegel and @kreggly tagging for this.


#16

That last screen shot seems to be connecting unless I’m missing something. What’s not working?


#17

How we can fix? Why this is so hard?


#18

@ozbayalperen1 can you follow this tutorial.https://eldontronics.wordpress.com/2017/08/28/beginning-iot-with-esp8266-01-wifi-module-and-cayenne-iot-platform/
as i am not sure abt this error. try updating your esp8266 firmware


#19

@ozbayalperen1 just follow the instructions here (linked above) It works I promise.


#20

Bumping this old thread to share that we’ve 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: