A WEB server on the Microcontroller with MicroPython
Introduction
In the 2019 AFNOG course we have seen how to connect to sensors and actuators through Cayenne and MQTT. This works fine if the amount of data to be passed over the Internet is small. If however we want to transfer a bigger amount of data, e.g. an image stream from a WebCam, then this solution is not viable. In this case, running a WEB server on the microcontroller is the better solution.
In the following pages we will install a WEB server on an ESP32 running MicroPython.
Several WEB servers are available for MicroPython:
Since picoweb is used in a tutorial on
how to make a WebCam work on ESP32 MicroPython we will start with the
installation of picoweb and a few tests.
The most powerful and evolved Web server available under MicroPython is probably MicroWebSrv2. Here are
step by step instructions to bring up MicroWebSrv2 on an ESP32.
A WEB-cam
The esp32-cam is a tiny micro-controller module, featuring an esp32 micro-controller, 4 MByte external PSRAM, an SD card socket, a camera interface and a tiny OV2640 camera. You can buy this card on aliexpress for less than 5 Euros, camera included. The goal of this project is to convert this hardware into a WEB-cam using MicroPython.
A camera driver is available for the esp-idf development environment and the WEB-cam code is available for the Arduino SDK as well as for esp-idf. A few people have also tried to integrate the camera driver into MicroPython but the complete WEB-cam code for MicroPython does not exist.
Here is a description on how to
integrate the camera code into MicroPython.
--
Uli Raich - 2020-01-14
Comments