The Arduino code The Arduino code for this tutorial is very simple. The tests on the ESP32 were performed using a DFRobot’s ESP-WROOM-32 device integrated in a ESP32 FireBeetle board. To do it, we simply need to give the following command on the Windows command line: pip install pyserial The easiest way to install PySerial is by using pip, the Python package installer. In the Python program, we will use the PySerial module to be able to establish the Serial connection. The Arduino program will act as an echo program, which will return back the bytes received through serial. Introduction The objective of this post is to explain how to establish a Serial connection between a Python program and an Arduino program running on the ESP8266 and on the ESP32. The tests on the ESP32 were performed using a DFRobot’s ESP-WROOM-32 device integrated in a ESP32 development board. The objective of this esp32 tutorial is to explain how to establish a Serial connection between a Python program and an Arduino program running on the ESP8266 and on the ESP32.