-->
Page 1 of 1

Serial communication between ESP8266 and Arduino Uno

PostPosted: Thu Jul 13, 2017 4:31 am
by DigitalMeth
Hi guys, I have one quick question.

I am sending data from Arduino to ESP8266, and then sending them to server. Everything works OK except for this part:

The "int" variable on Arduino is 2 bytes long and the "int" on ESP8266 is 4 bytes. If the number that I am sending through the serial line can be fit in 1 byte it works OK, but for larger numbers the data is shorter for 512 or 1024.

What is the best way to send float values from the Arduino to the ESP8266? Also I tried casting them into array of bytes and using Serial.write(buffer,length) and Serial.Readbytes

Re: Serial communication between ESP8266 and Arduino Uno

PostPosted: Thu Jul 13, 2017 9:06 am
by martinayotte
Since the data will be sent to server via HTTP, why not using plain text or JSON to communicate between Arduino and ESP, as the speed doesn't matter here.