Home > Backend Development > C++ > body text

Download the web pages to ESPor simple programmable controller

Linda Hamilton
Release: 2024-10-22 12:45:03
Original
337 people have browsed it

In order to save the web pages in FLASH of ESP8266, I specially wrote a software tool by delphi.
This software tool reads all the web page files (including html, css, js, images, etc.) from one folder, and packages them to a binary file.

Ground the GPIO0 of the ESP8266 to start, the ESP8266 enters the serial port download mode.
Then use the download software to select the packaged web page file and command the save location, and then download it to the ESP8266 through the serial port together with the firmware file.

At the same time, the software also calculates the storage location of each file in flash according to the size of each file and automatically generates an .h file, which is used to load the corresponding web page from flash when downloading the web page.

For the newly designed simple programmable controller, the modification of the web page is also a very important, the use of serial tools to download the steps are cumbersome and slow, which affects the development speed, so I firstly designed such tool to download the web page remotely by TCP commands.

Modify the code of ESP8266 to add the function of erasing and reading flash content through TCP command.
And reserve a space of 4KByte for the flash storage location and size of each web page.

When receiving HTTP request from the browser, if the HTTP request file is a web page, it will first find out the storage location and size of the file from the flash according to the file name, if not found, it will still response the default web pages.

In the PC tool side, the codes are also added to send TCP commands to erase, write, read contents from ESP8266, and the web pages are divided to packages with 512 bytes size.

In the future, such a function can also be open to customers, so that customers can customize their own web pages.

Download the web pages to ESPor simple programmable controller

Download the web pages to ESPor simple programmable controller

Download the web pages to ESPor simple programmable controller

The above is the detailed content of Download the web pages to ESPor simple programmable controller. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!