At present, the ESP32 firmware built with this library has been running stably for several months and can be used officially.
This library work with Espressif offical framework esp32-arduino 2.0.3. Only had tested on esp32 dev module.
This library is for beginners who want to write their own code, but don't have much foundation. This library can be your starting point for learning esp32, you can use not only all the functions of esp32-arduino, but also esp-idf function, you can learn how to develop ESP32 from simple to further.
- Built-in convenient, fast and stable OTA update feature without even one line extra code.
- Rollback firmware when new frimware error at boot state automatically(esp32-arduino library closed this function from esp-idf, this library implemented this feature without modify SDK that downloaded by Platform IO).
- Easy method to store or transfer integer, string, binary data without other format(like json), it will save more space or bandwidth when you storing those data into storage or transfer with internet.
- Built-in convenient RAM database could store key-value typed data, based on LittleFS(esp-idf has this function but it don't has wear-leveling, according to offical document).
- Stable and fast Websocket implement, transfer a great many of data with high stability.
- One line code to get SHA1 and SHA256 using ESP32 hardware acceleration with variant types of input data.
- One line code to encrypt or decrypt data with AES-256-CBC.
- Develop without connect your board to computer, only provide power supply, use built-in fully automatic OTA update, this allows you could continue developing when you use light laptop or your computer doesn't support more USB port at that time, directly connect your develop board into any power. This feature also fits in those ESP32 had embedded into another devices, cooperate with auto rollback feature, this allows you to do more things with less works.
- Transfer data from web page to serial or transfer data from serial to web page without coding, default settings use the first group of serial port, you can modify it if you like to, or transfer data from(to) more serial port simultaneously.
- More features are in development...
These features especially designed for beginners, easy to use and have strong scalability. For experts, please ignore.
IDE requirement: Visual studio code with Platform IO installed.
First you need to have a VPS, node.js 16 required. Or you could use your PC or NAS as a server.
git clone https://github.com/vidalouiswang/Abc.git
-
Use SSH connect to your VPS or NAS
-
Install package manager , suppose your OS is Ubuntu
sudo apt-get install npm
- Install n module
sudo npm install -g n
- Install Node.js
sudo n stable
- Install pm2
sudo npm install -g pm2
Now the version of node.js is lastest stable version, you could use the following command to check
node -v
If shows "v16.x" means Node.js installed correctly, if it show old version, like "v8.x", you should input command
hash -r
- If you clone the code into your personal computer, you should upload
/server/
- index.html
- ab.js
- hash.js
- create.js
- iot.js
These five files to your server
cd ~/
mkdir server
cd server
Then upload five files by any method you like to the folder "server"
This step could be omit if you clone the code directly to your server, do this:
cd Abc/server
- Install components
sudo npm install ws
- Start server
sudo pm2 start iot.js
Now the server configuration is finished, the default port is 12345 , you could modify it if you like,
in file "globalConfig.json".
Or, modify it at the bottom in file "iot.js".
Remember restart server if you modified the port.
sudo pm2 restart iot.js
Don't forget add rule to let new port could pass through in firewall.
- Use Platform IO open root folder.
- Locate to /src/app/ .
- Edit app.h and app.cpp as Arduino way.
- Compile and upload(better erase flash first).
- Use PC or phone connect to esp32 access point.
- Open browser,locate to http://192.168.8.1.
- Set arguments by tips and click reboot.
- Locate to http://your_domain_or_ip_of_your_server:port/.
- Login in with user name and password set in step 7.
- Now you could see your device online, click "@" could access built-in providers.
More information and examples refer to /examples/ , full comments in it.
The LittleFS extra component auto-selection feature has not been tested on Windows, but it should work and currently works fine on macOS 12.5.
If you still don't know how to use, I will make a video and upload to YouTube, the link will be put right here.
-
Local:
-
Header file:
- Almost all header files
- /examples/*.h
-
Source File:
- /lib/arraybuffer/arraybuffer.cpp
- /examples/*.cpp
-
-
Server:
- /server/iot.js
- /server/create.js
Thanks to the entire staff of Espressif, we have a cheap and easy-to-use ESP32 and other chips. Thanks to all the developers of Node.js, we have a convenient and easy-to-use JavaScript runtime. Thanks to all the developers of VSCode and Platform IO, we have an easy-to-use integrated development environment.
(GNU General Public License v3.0 License)
Copyright 2022, Vida Wang [email protected]
Children are the future of mankind, but there are still many children who are enduring hunger all over the world at this moment. If you are a good person and you like this lib, please donate to UNICEF. https://unicef.org