This is very simple component for working with WIFI base on ESP_IDF V4.3.
In your project root directory run:
git submodule add https://github.com/Farzinkh/wifi.git components/wifi
now import it in your main.c by #include "wifi.h"
and choice beetwen STA , AP , SMART modes.
move anything inside config & server
folder to root of your project then create server_certs
folder and run
openssl req -x509 -newkey rsa:2048 -keyout server_certs/ca_key.pem -out server_certs/ca_cert.pem -days 365 -nodes
enter server ip as common name then install server requirements once by
pip install -r requirments.txt
finally run server
python server.py
and you are done whenever you change app version in menuconfig and recompile your code by idf.py build
and restart esp32 it will update constantly.
wifi_init_sta()
station mode.
wifi_init_softap()
AP mode.
wifi_init()
smart mode.
get_rssi()
get rssi value.
initialise_mdns()
init mdns.
check_time()
update time if internet is available.
get_ip()
get ip address and wait for connection if disconnected.
wifi_scan()
scan for APs.
start_ota()
update code by ota.
ota_verify()
to verify your ota app.
ota_discredit()
to flag your ota app as invalid.
save_key_value()
save data in nvs.
load_key_value()
load data from nvs.
Sending sensor data by udp protocol using this component can be found here.
Enjoy :)