Hello,
I am seeking assistance with running scripts on the ESP32 using the ESP-IDF framework. My goal is to develop an application that can host a web server to provide various settings to users. This application will include JavaScript (JS), Cascading Style Sheets (CSS), and Hypertext Markup Language (HTML) files. Additionally, I would like to incorporate configuration files for controlling RGB LEDs. The main objective is to enable the ESP32 device to detect any updates in the JS, CSS, HTML, or configuration files, download them, and store them in the device's flash memory without resorting to an Over-The-Air (OTA) update.
In simpler terms, I want to update the frontend and configuration files on the ESP32 without making any changes to the backend code.
I have a few questions:
Is it possible to achieve the mechanism described above using the ESP32 and ESP-IDF?
What scripting language does the ESP32 support for running scripts?
It would be greatly appreciated if you could provide an example code demonstrating this process.
How to run scripts for esp32 in esp-idf
Re: How to run scripts for esp32 in esp-idf
It is possible to achieve the mechanism you described using the ESP32 and ESP-IDF framework. The ESP32 supports executing JavaScript (JS) code using the Duktape library, which is included in the ESP-IDF framework. Duktape is an embeddable JavaScript engine that allows you to run JS scripts on the ESP32.
-
- Posts: 1688
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: How to run scripts for esp32 in esp-idf
Easily possible. You can use a dedicated partition in flash and read/write/HTTP-serve files from there as desired via VFS, see e.g. https://github.com/espressif/esp-idf/tr ... age/spiffs and https://github.com/espressif/esp-idf/tr ... le_servingI want to update the frontend and configuration files on the ESP32 without making any changes to the backend code
Do you need that? From what you wrote, only the frontend (running in a browser) needs to be so flexible. Embedding a whole scripting language in your application would be pretty resource-hungry, compared to interpreting some configuration files at runtime in C.What scripting language does the ESP32 support for running scripts?
Who is online
Users browsing this forum: Baidu [Spider] and 77 guests