ESP8266 Part 5

UDP CLIENT + SERIAL COM

The ESP8266 has the ability to interact with peripherals and send information over a WiFi connection to remote computers or devices. However, it can also be used to enable other microprocessors to have access to networks and send/receive information over WiFi.

The goal with this article is to show how you can use the ESP8266 as a network shield to be used by any microprocessor that has UART communication capability. This example can be used to transmit data being acquired by the ESP8266 serial port to a remote UDP server. Have in mind that you might lose data during transmission. If your application cannot afford to lose packets or data, you should use a different approach (for example a TCP connection).

Below you can find the block diagram of the system that we will be using in this article.

It consists of an Arduino UNO board that will be sending the value of a counter at a certain rate over a serial port to the ESP8266 board. On the other end, the ESP8266 will forward any message received on the serial port and forward it over a UDP socket to a remote server.

To program the ESP8266, follow Part 1a (if you want to use the Arduino UNO board) or Part 1b (if you want to use the serial-USB interface) to program the board.

ESP8266 UDP Client

Arduino UNO Serial Code

UDP Server (in Python)

GitHub Repository

  • ESP8266 UDP Client Serial Code (Link)
  • Arduino UNO Code (Link)
  • UDP Server Python Code (Link)

Leave a Reply

Your email address will not be published. Required fields are marked *

Index