Connection Problem on New Esp8266 Librarry

Hi guys, i am trying this new lib and i can’t connect my arduino mega + esp8266 to Cayenne dashboard. It is not giving error but it is not working. I am using offical code and lib:

#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneMQTTESP8266Shield.h>

char ssid = “********”;
char wifiPassword = “****”;

char username = “";
char password[] = "
";
char clientID[] = "
******”;

#define EspSerial Serial1

ESP8266 wifi(&EspSerial);

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

EspSerial.begin(115200);
delay(10);

Cayenne.begin(username, password, clientID, wifi, ssid, wifiPassword);
}

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

// Default function for sending sensor data at intervals to Cayenne.
// You can also use functions for specific channels, e.g CAYENNE_OUT(1) for sending channel 1 data.
CAYENNE_OUT_DEFAULT()
{
// Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
Cayenne.virtualWrite(0, millis());
// 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(“Channel %u, value %s”, request.channel, getValue.asString());
//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError(“Error message”);
}

Do you see any messages in your Arduino IDE serial monitor?

I can’t see anything on Arduino IDE serial Motor.

add this to your code and see the error in serial monitor.

 #define CAYENNE_DEBUG

I can’t see anything its maybe about my Esp 8266. Before i compile blink code to Esp8266 and after i tried to update Esp8266 but I couldn’t .

did you try this?

Yes, i tried. I can’t see anything.

so can you post for us to know what the error is.

It is not giving error but i will look one more ime.

Nope i can’t see anything.

change the baud rate on serial monitor to 9600

1 Like

What ESP module are you using?

How are you powering your ESP, note that it is a 3.3V device and not 5 like the Mega. If you connect it to 5V, it will get really hot and might let out the magic smoke?

How are you connecting it to your Mega? Are the RX and TX pins reversed?

Did you ensure your ESP pins are configured correctly for run mode, and the EN pin is high?

Can you confirm what version of the AT command set is flashed to your ESP?

Cheers,

Craig

1 Like

I am using this one: Esp8266 Seri Wifi Modül Uygun Fiyatıyla Satın Al - Direnc.net®

I am powering with 3.3V on Mega

My pinout is like this but i am just using esp8266:

http://maker.robotistan.com/wp-content/uploads/2016/03/ESP8266-bağlantı-şeması.jpg

What is EN pin?

I can’t confirm sir.

What is your advice?

EN is CH_PD or just chip enable. Already done per your schematic.

You also need to pull up GPIO0 so you boot from the flash and not into the
bootloader. Needs a reset after that.

Try that and give us a screen grab of your serial monitor and get back to
us.

If it is not working, you will probably need to load the AT program into
your ESP flash.

Cheers,

Craif

Also note that your Mega TX is driving 5V into a 3.3V input. Most ESPs can
deal with that, but I’m not sure about those. You can put a small value
resistor in line to help drop the voltage.

Cheers,

Craig

EN is CH_PD or just chip enable. Already done per your schematic.

You also need to pull up GPIO0 so you boot from the flash and not into the
bootloader. Needs a reset after that.

Try that and give us a screen grab of your serial monitor and get back to
us.

If it is not working, you will probably need to load the AT program into
your ESP flash.

Cheers,

Craif

Can you tell me more clear this chapter: You also need to pull up GPIO0 so you boot from the flash and not into the bootloader. My English is ver bad. Also i am trying to update this Esp8266 withy this program but i can’t:

Whatever state your GPIO0 is on power up is the mode you are in.

Flashing mode is Low. Run mode is High.

You are trying to flash right now, so you want Low.

You cannot flash through your Mega unless you write a program to redirect
the mega serial to your ESP board.

Best is to get a 3.3V USB to ttl serial adapter and connect directly to
your ESP.

Cheers,

Craig

I am trying this post for flashing i dpn’t have ttl serial adapter right now. İ am trying with arduino uno but it’s not working too.

Is your ESP GPIO0 tied to GND?

In your serial monitor, can you read the text when the ESP powers up?

If not, change the serial monitor baud rate until you do.

Use that baud rate to flash.

Cheers,

Craig