How to load a script from spiffs in JerryScript

laldana
Posts: 2
Joined: Fri Nov 27, 2020 4:48 pm

How to load a script from spiffs in JerryScript

Postby laldana » Fri Nov 27, 2020 5:13 pm

Hello:
I am trying JerryScript with the ESP32 and with esp-idf. The examples in jerryscript.net works well.
But all the examples use a string as a source file (const jerry_char_t script[] = "var str = 'Hello, World!';";).
I would like to know, how to load a script, by example: app.js , from spiffs.

Somebody knows how to do this?

Thanks

ESP_Jan
Posts: 40
Joined: Tue Dec 01, 2020 10:56 am

Re: How to load a script from spiffs in JerryScript

Postby ESP_Jan » Tue Dec 08, 2020 10:36 pm

Hi laldana,

take a look at this example:
https://github.com/espressif/esp-idf/tr ... age/spiffs

After calling fopen() use POSIX and C standard library functions to work with files.

Feel free to ask any follow-up questions.

laldana
Posts: 2
Joined: Fri Nov 27, 2020 4:48 pm

Re: How to load a script from spiffs in JerryScript

Postby laldana » Mon Jan 04, 2021 10:21 pm

Thanks a Lot !!!

Who is online

Users browsing this forum: rowifi and 64 guests