IoT local HTTPS development using the Computado Rita
HowTo
To have the IoT device GET and POST a URL to a HTTPS web server over WiFi.
Create a PKI certificate authority and server certificate
Create a WiFi Access Point (AP) (Hotspot)
Install and configure nginx web server and time server
Install esp-idf, a ESP32 deveopment system
Clone this repository
Setup ESP32 to connect to Wifi
Setup ESP32 to connect to https server
Computado Rita as server ; RAM 4G or 8G
Seeed Xiao ESP32C3 or just change the configurations other ESP32,
USB-A to USB-C cable
There are many HowTos on installing and using Arduino IDE, but the Arduino IDE doesn’t give the developer the power needed to make a advance IoT applications. This HowTo uses esp-idf to develop a Wifi connected application to the Computado Rita. The Seeed Xiao ESP32C31 is good choice of processor because of the many features it uses and is Arduino compatiable. The ESP32C32 has Wifi, BlueTooth, I2C, SPI and serial.
Started with the https_request example from the esp-idf repository. ( examples/protocols/https_request). Because this is a closed IoT network, I wanted to isolate it from the internet for security. This means the Computado Rita needs to handle all network services for the IoT network.
A POST request is a way for a client to send information to the web server. Usually there is a special web server program to accept POST data. Nginx has a echo module that we can use for testing a POST request.
First install the mod-http-echo module
$ sudo apt install nginx-extra
This command install many different modules including the echo.
Edit /etc/nginx/sites-enabled/default and add a POST echo location
location /echo {
echo_read_request_body;
echo_request_body;
default_type application/json;
chunked_transfer_encoding off;
}
Restart nginx
$ sudo systemctl restart nginx