s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266

Home Page:https://valencia.lbsfilm.at/midterm-presentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saving and uploading setting file to client

billyrudi opened this issue · comments

There is a way to save a setting file to a client and uploat it (spmartphone?)?

You mean like a cookie? Not directly no. Maybe you can save settings that you need in the EEPROM of the ESP.

I presume you intend for a mechanism for the ESP to read such data as well? Otherwise it would be useless.

The only ways a website can store persistent data on a client is either a cookie, or the Web Storage API. We haven't integrated either of these. It isn't impossible, I would imagine that something could be done by cloning the Time control that I added and using that model.

However, what are you actually trying to do?

But why do you have to store them in the phone and not in the ESP?

If you are already sending "configuration data" to the clients from the ESP, then you already have it stored in the ESP. I don't understand why you need it stored on the client as well.

Maybe it is because I don't understand what you are trying to accomplish. Even if you could send "data" to the client, what are you trying to do with that?

OK well...err...there you go. There's a way to store and load files from the ESP. If you ensure that you use ESPUI in non-SPIFFS mode the two libraries should probably coexist happily enough.

Well I don't know that library, but from a quick skim you will need to do a few things.

You can't have both on the same port. It looks like that library is hardcoded to serve on port 80. ESPUI is on 80 by default but we provide a way to change this:

ESPUI.begin("ESPUI", nullptr, nullptr, 8000); //Start on port 8000

Upload a file to the library however the library says you should do it. I don't know what URL scheme it uses but determine the URL scheme and you can create a Label control which contains a link to the file which you can just click.

ESPUI.label("A Label", ControlColor::Peterriver, "<a href='path/to/the/file/in/the/other/library'>Click me</a>");

Something along those lines.