At the moment working only with ESP32 with additional SPIRAM (due to high heap memory requirements)
This repository contains the code for an Internet of Things (IoT) web server implemented in MicroPython for ESP32 devices. The web server allows you to connect your ESP32 to your network and control its ports, enabling automation and remote control capabilities.
Here you can have a look of the functionalities:
Before installing and running the web server, please make sure you have the following dependencies installed on your system:
- rshell - A remote shell tool for MicroPython devices.
- rsync - A fast and versatile file synchronization tool.
- esptool - A utility for erasing and flashing MicroPython firmware onto ESP32 devices.
-
rshell: Install rshell using pip by running the following command in your command prompt or PowerShell:
pip install rshell
-
rsync: Download and install cwRsync from cwRsync Downloads to get rsync on your Windows machine.
-
esptool: Install esptool using pip by running the following command:
pip install esptool
-
rshell: Install rshell using pip by running the following command in your terminal:
pip install rshell
-
rsync: Install rsync using the package manager specific to your Linux distribution. For example, on Debian-based systems, run:
sudo apt-get install rsync
-
esptool: Install esptool using pip by running the following command:
pip install esptool
-
rshell: Install rshell using pip by running the following command in your terminal:
pip install rshell
-
rsync: Install rsync using Homebrew by running the following command:
brew install rsync
-
esptool: Install esptool using pip by running the following command:
pip install esptool
To install the latest version of MicroPython on your ESP32 device, follow these steps:
-
Connect your ESP32 device to your computer via USB.
-
Open a terminal or command prompt.
-
Erase the flash memory of the ESP32 by running the following command:
esptool.py --port /dev/ttyUSB0 erase_flash
Note: Replace
/dev/ttyUSB0
with the appropriate port identifier for your ESP32 device. -
Download the latest MicroPython firmware for ESP32 from the MicroPython Downloads page. Make sure to select the
.bin
file for the ESP32. -
Install the downloaded firmware onto the ESP32 device by running the following command:
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-20230426-v1.20.0.bin
Note: Again, replace
/dev/ttyUSB0
with the appropriate port identifier for your ESP32 device, andesp32-20230426-v1.20.0.bin
with the name of the downloaded firmware file.
To upload the web server files to your ESP32 device, follow these steps:
-
Open a terminal or command prompt.
-
Change your current directory to the location where you have the web server files.
-
Run the following command to start the rshell shell:
rshell --buffer-size=30 -p /dev/ttyUSB0 -a -e nano
Note: Replace
/dev/ttyUSB0
with the appropriate port identifier for your ESP32 device. -
Once inside the rshell shell, run the following command to synchronize the files with the ESP32:
rsync . /pyboard
This command will copy all the files from the current directory to the
/pyboard
directory on the ESP32. -
After uploading the files to the ESP32 using rsync, you can access the ESP32's REPL (Read-Eval-Print Loop) to interact with the microcontroller and debug the data. Here's how you can do it:
repl
Then press Ctrl + D to reboot the microcontroller and debug the data.
After successfully uploading the web server files to your ESP32, you can now access the web server and control the ESP32's ports. Connect your ESP32 to your network, and then open a web browser and enter the IP address assigned to the ESP32. You will be presented with a user interface where you can interact with the ports and automate their functionality.
Feel free to explore and customize the web server code according to your specific requirements.
This project is licensed under the Apache-2.0 license.