As the title says... Chat on...

User avatar
By Help
#34259 I am currently trying to develop a program using Lua script and NodeMCU firmware. The program is required to take temperature readings at set intervals and display the readings on the webpage. All of this has been accomplished already however I am struggling to find any information on how to download a text file which the temperature readings are stored in.
The logged data is stored in “dataLog.txt”. The following code has been written:

Code: Select all"<a href=\"dataLog.txt\" download=\"data.txt\">Download</a>";

This code does not access the dataLog.txt file correctly, the browser just downloads the Page Source instead. Hence, once the download button is pressed a text file is saved with the source code rather than saving the dataLog file containing the temperature readings.
User avatar
By JeremiahLandi
#36876 I haven't come across a method to do this yet. I'll keep it in my back burner.

I did (a while ago) come across a post that allows you to email the file. This might be able to aid in the rabbit hole search or not. If you have solved it already let us know!

ESP8266 Well Power Monitor
http://benlo.com/esp8266/esp8266Projects.html#powerMonitor

or

POWER MONITOR
http://www.esp8266.com/viewtopic.php?f=19&t=602
User avatar
By Help
#37034 I have now found a way to download a HTML <div> using JavaScript, however it doesn't keep the formatting used on the webpage. This is annoying as I am trying to make it so that it can be downloaded as a .csv file to be used in Excel. Emailing is not an option as the ESP8266 WiFi module is required to be a server not a client.
User avatar
By forlotto
#37036 Mind sharing your method maybe someone could improve on it and maybe parse the data with java as well you never know....

Anyhow interesting thread and idea.

I believe thingspeak logs your data if this is what you are looking to do might just want to look into that to some degree.