Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By WereCatf
#39405
thoskins7 wrote:I have installed the ESP8266UDP libraries and opened the ESP8266UDP example sketch. When I try to upload it to my UNO, it stops. There is no error.


These libraries are for using the ESP8266 itself as an Arduino-device, not for connecting an ESP8266 to another Arduino. You can't run ESP8266-specific code on an UNO. If you have an ESP8266 connected to your UNO and you want to use the UNO as the main-device and the ESP8266 just for WiFi then these libraries are not what you need.
User avatar
By KevinA
#57432
gerardwr wrote:Now that the bug in the UDP library is fixed (ref http://www.esp8266.com/viewtopic.php?f=29&t=2390) here's a basic working sketch for bidirectional UDP communication. The ESP displays the content of the received packet in the Serial Monitor and sends a confirmation message back to the UDP sender.
---snip

Simplicity is beauty.
I had to comment out
if (len > 0) packetBuffer[len-1] = 0;
What was that for? I would sent 1234 and get 123 at the server. Does a MAC add something my client doesn't?