ESP8266 periodically disconnects

Yes, I get an OK!

can you share a screen shot of it on the serial monitor.

This is the code i upload now, when I check the serial monitor, I just get “Failed to connect to WiFi” and “ESP is not responding”

let try changing the baud rate, as it worked for me. Upload the other code for AT response and send AT+CIOBAUD=9600. Then change the ESPserial.begin(115200); to ESPserial.begin(9600); and upload the code again and see if you get okay response for AT.
If you get okay, upload the cayenne code by changing EspSerial.begin(115200); to EspSerial.begin(9600); :crossed_fingers:

If I try to send “AT+CIOBAUD=9600”, I get “ERROR” in respons :thinking:

it depends on AT firmware version. try this AT+UART_DEF=9600,8,1,0,0

That worked, if I upload the Cayenne program, I get this as a response:

Cayenne says that the Arduino Uno is still offline…

does the serial monitor stop at that line or keeps on printing more stuff?

Nope, it stops at that line.

it should not stop at it. try restarting the arduino uno.

I’ve reset the arduino, uploaded the program agaiin and let it run for a minute or so, this is the serial monitor:

thats what an very unstable serial communication looks like for arduino uno. You may try a bit higher baud rate.

I tried to remove the line “Cayenne.virtualWrite(0, millis())”, and now the serial monitor shows this:
I’ll try a higher baud rate!

If I change the baud rate to 19200 or 38400, it still gives the same response as in the screenshot above…

can you add it again with baud rate 9600 and try connecting to different wifi. Also, try powering the esp with external power supply if you have.

I don’t have an external power supply I’m afraid… I did what you said and thi is the result in the serial monitor:

can you try the hardware serial port also with cayenne.

Yeah, I tried that in the beginning, it connects to Cayenne, but every 1.5 minute or so, it periodically disconnects… Is there maybe another type of Arduino which has a more stable connection?

why dont you use a esp8266 development board like nodemcu or wemos. or a ethernet shield for your arduino uno.