Problem in connecting with cayenne dashboard i have check the telnet port its ok, and also by esp8266 get connected to network ssid through AT commands not by the program

bblem

(WifiShield with arduino uno compiling error - #10 by adam) link of a program from cayenne community

how do you have your esp connected to your arduino?

I have connected it with tx and rx pin of ardunio

On a uno right? Are you viewing the serial data via USB it looks like as I see a AT command 2nd line down? If you are, that’s one problem. On a uno you need to use a software serial and print the data to that so it doesn’t interrupt the esp rx/tx stream on serial.

I use serial
communication to moniter data

Thru the USB correct?

Yes

That won’t work. That’s why your getting the initial connection but then fails to disable echo and errors out. You need to disable prints & debug(if its enabled) and can’t open the serial port at all.

Basically on the uno, the USB and rx/tx are the same. Do you have a mega by chance and a ttl adaptor?

I dont have mega but i have an adaptor can u tell me plz what are the changes i should do in program taken from cayenne community.

try running this code. Put in your token, wifi network, and password. Verify you ESP baud rate is 9600 or enter the correct speed.

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


char token[] = "token";
char ssid[] = "wifi";
char password[] = "passwrd";

#define EspSerial Serial
ESP8266 wifi(EspSerial);

void setup()
{
  EspSerial.begin(9600);
	delay(10);

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

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

if you want to see your prints, run this code and hook up your ttl adaptor to pins 2 and 3. Your prints should go to that “software” serial port and not interrupt your esp communications.

//#define CAYENNE_DEBUG         // Uncomment to show debug messages


#include <CayenneESP8266Shield.h>
#include <SoftwareSerial.h>

char token[] = "token";
char ssid[] = "wifi";
char password[] = "passwrd";

#define EspSerial Serial
ESP8266 wifi(EspSerial);

SoftwareSerial mySerial(2, 3); // RX, TX
#define CAYENNE_PRINT mySerial 

void setup()
{
  EspSerial.begin(9600);
	delay(10);
  
  mySerial.begin(9600);

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

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

Ok tq sir i will try this …

Let us know how it goes. Good luck :slight_smile:

@vapor83 i kindly want to know which program should be upload to esp8266 & which on uno board so that i will get connected to dashboard through wifi, & how to check on serial monitor. I have esp-01, uno, ext, power supply, usb cable & pc only! I have connected uno’s tx to esp’s rx & uno’s rx to esp’s tx, Thank you!

Hi…i am a new user here. I want to know something if you are Uno, are you viewing the serial data via USB it looks like as I see a AT command 2nd line down? If you are, that’s one problem. On a uno you need to use a software serial and print the data to that so it doesn’t interrupt the esp rx/tx stream on serial.

1 Like