Post topics, source code that relate to the Arduino Platform

User avatar
By maptor
#5989 Got what is probably a stupid question for most people- though one I can't find the answer to on the web- but how do I properly capture the data returned from the ESP on an Arduino?

My setup is:
    -SoftwareSerial on pins 10 and 11 for the ESP (both the module and the interface running at 9600)
    -Serial connection is left free for USB debugging messages.

What happens:
I'm able to communicate just fine with the ESP, both input and output, up until the point that it returns the data requested from a GET. For some reason I can't get anything when attempting to readBytes() or even just read(). readString() returns gibberish... sort of. While I don't have my stuff with me at the moment to give an exact output, something like "This is a test" becomes "ths s a es".

What's going on here? Only the contents of the doc I'm receiving gets garbled. The rest of the message (header info, etc.) is completely legible. I once tried sending a string of numbers and parseInt() iterating through the entire message wound up with a string of a bunch of nonsense integers (of course) but concluded by the correct number string sequence. My guess is that I'm misusing readString() and am just being too lazy, but I'd love to be told that from someone who knows better before I make things a bit more complicated.

(Note: When I have the ESP connected directly via serial to my computer, the message is correctly received. Is this a SoftwareSerial limitation?)
User avatar
By alonewolfx2
#5990 Software serial very slow and buggy for esp. You need hardware serial. It's not working correctly with software serial
User avatar
By FeK9
#6001
maptor wrote:Got what is probably a stupid question for most people- though one I can't find the answer to on the web- but how do I properly capture the data returned from the ESP on an Arduino?

My setup is:
    -SoftwareSerial on pins 10 and 11 for the ESP (both the module and the interface running at 9600)
    -Serial connection is left free for USB debugging messages.

What happens:
I'm able to communicate just fine with the ESP, both input and output, up until the point that it returns the data requested from a GET. For some reason I can't get anything when attempting to readBytes() or even just read(). readString() returns gibberish... sort of. While I don't have my stuff with me at the moment to give an exact output, something like "This is a test" becomes "ths s a es".

What's going on here? Only the contents of the doc I'm receiving gets garbled. The rest of the message (header info, etc.) is completely legible. I once tried sending a string of numbers and parseInt() iterating through the entire message wound up with a string of a bunch of nonsense integers (of course) but concluded by the correct number string sequence. My guess is that I'm misusing readString() and am just being too lazy, but I'd love to be told that from someone who knows better before I make things a bit more complicated.

(Note: When I have the ESP connected directly via serial to my computer, the message is correctly received. Is this a SoftwareSerial limitation?)


GDay maptor

Read a post on this forum a month or two ago...
viewtopic.php?f=8&t=244&start=10

"...RX buffer on the ESP is 256... SoftwareSerial RX buffer is 64..."

I also came across an article on HobbyTronics Ltd UK, on howto modify/add a 256 buffer to the Arduino IDE...
http://www.hobbytronics.co.uk/arduino-s ... uffer-size

I've not tried it myself, as I'm still experimenting directly with my little esp8266...