Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: ESP8266

Home Forums Mayfly Data Logger ESP8266 Reply To: ESP8266

#12795
Sara Damiano
Moderator

    Yes, I’ve had problems with the Mayfly receiving data at 115200. The Mayfly is only running at 8MHz and Atmel says the error rate at that baud and crystal combination is 8.5%. The error is a much bigger problem on the receiving end than the sending end. So the serial port monitor and the ESP8266 understand what the Mayfly is saying at 115200, but the Mayfly has a hard time hearing back from the esp at that speed. And it gets especially bad when running a program like yours that’s trying to synchronously write and read from both serial ports at the same time. So when the Mayfly said “AT” to the ESP8266, the esp actually echoed “AT” and then said “OK” but the Mayfly misheard and it got garbled into that “au?” (AT) and “C?j5” (OK). After AT+RST you’ll always see some junk because the ESP8266 prints out some notes when it boots at a different baud rate than it’s normal talk speed.

    So.. in short:
    – If you just want to talk to the ESP8266 and don’t care about what it says back, you’re fine doing just as you are

    – If you want to talk to the ESP and can handle listening to it in your program without simultaneously printing it to Serial, you’re probably also alright, but somethings might be garbled

    – If you want to talk to the ESP and echo its responses and make sure they’re always correct, you need to slow the ESP down.

    To change the baud rate of the ESP8266: (for 9600, 8N1)
    “AT+UART_DEF=9600,8,1,0,0”