Community
OpenEnergyMonitor

Community

emonESP addition - file download

emonesp
Tags: #<Tag:0x00007f1fe3ab33a8>

(Daniel Bates) #1

I’m working on making a change to the emonESP web interface, by making a file download button to take a file from an SD card.

I’ve had a close look at an existing sketch, SDWebServer, to find how to do this in the code… I’ve integrated much of the SDWebServer sketch into my version of emonESP however am having trouble finding the html/javascript trigger for a file download in a browser.

Can anyone advise a simple method?

I think what would be useful in the long term in storing data on SD card for bulk transfer also, looking at that afterwards.

here the github: https://github.com/danbates2/emonDC/tree/master/emonDC-ESP_SD/esp-12s%20-%20to%20merge
where the srcDC is the modification of the emonESP src folder.


(Jeremy Poulter) #2

To download a file it is just a case of adding a link to that file in the HTML.

However I would advise you to hold off on your changes, as there are quite large architecture changes coming to the HTML/JS and the web server, see PR #24.

FYI: Here is an adaption of SDWebServer for ESPAsyncWebServer, https://github.com/boblemaire/ESPAsyncSDWebServer


(Daniel Bates) #3

Ah, seems like you’ve already done it. With AsyncWebServer too. I’ll wait to see what you’ve done before I do anything more.
Thanks