Menu ESP8266 - Easiest way to program so far (Using Arduino IDE) 22 April 2015 on ESP8266, water heater, smart house, microcontroller, Flash, Firmware, WiFi, arduino IDE, PHP, SQL, Web-Server, Tutorial. Yep, another post on the ESP8266 is here (By the way, Have you heard about our Facebook page already? Like us and get updates! If you have some error, it has been a missing library, probably. Download the FileSystem to the board. Go to Tools-ESP8266 Sketch Data Upload. This put all the files in the flash partition of the board. Download the CatFeeder application to the board.
I'm trying to read all the available access points nearby with an ESP8266 module.
Whenever I try to read all the available data from the ESP module and write it to the Monitor Serial it truncates text. Text often also a bit messed up.
I'm using an Arduino Uno with the following scheme (I'm using pins 2 & 3 NOT 1 & 0):
The code prints something like the following:
3 Answers
As @JoseCanUC has mentioned SoftwareSerial is not reliable at 115200 baud. This is because the bytes are sometimes too close together for the Arduino to start receiving a new one when the start bit arrives, and so the byte starts being received part way through, thus corrupting it.
You should investigate setting the baud rate of the ESP8266 to 9600, although this itself comes with its own set of pitfalls. You should be prepared to re-flash the AT firmware to reset the baud rate if it all goes wrong. I would seriously suggest investing in one of the many cheap USB programming adaptors for the ESP-01 on eBay, since it makes working with these devices so much simpler. It also opens up the possibility of creating and installing your own firmware for the ESP8266 instead of using the somewhat clunky AT firmware interface.
For SoftwareSerial
, at 115200 bps data rate is not going to be reliable. Try 9600 bps.
I'm a bit confused by your diagram showing no ATmega chip on the Uno board, but you posted Uno code that should properly communicate with your ESP (except for the baud rate being too high for SoftwareSerial).
See my answer to another ESP question for how to change the ESP's baud rate, especially the code fragment at the bottom of that answer.
Changing the ESPs parameters is not difficult as long as its AT firmware is intact (which it will be if you haven't attempted to re-flash the device). Changing baud rate is only slightly tricky, in that once the Uno has told the ESP to change its baud rate, the Uno must also change its baud rate to match before you can re-establish communication with it.