I got this shield below which fits great with my Arduino Uno. Moreover, I have managed to upload code to the shield with a serial adapter and send/receive UDP messages. As the picture shows this shield goes right on top of the Arduino UNO.
The problem is that the communication between Arduino and the Shield is very slow.
For example, I use the code below to Arduino to write something using Serial (115200).
void loop() {
writeString("Hello!");
delay(1000);
}
Then I use a simple code to the ESP8266 shield to read the data from Arduino and send it via UDP (writeString is just a simple converter).
Udp.beginPacket(ip, localUdpPort);
writeString(Serial.readString());
Udp.endPacket();
void writeString(String stringData) {
for (int i = 0; i < stringData.length(); i++) {
Serial.write(stringData[i]);
// Push each char 1 by 1 on each loop pass
}
}
It works fine, the "Hello!" string is read from the ESP8266 shield and sent using UDP. The problem is that if I put anything below 1,000 ms of delay in the Arduino, the ESP shield does not read anything, which is strange considering that the shield is on the top of the Arduino with no restrictions between serial communication.
writeString()
, you might be interested to know about Serial.print(). – per1234