Page 1 of 1

Log spot values to .csv file?

Posted: Sun Apr 28, 2019 11:06 pm
by jon volk
Is there a way to datalog all spot values to a .csv file for review?

Re: Log spot values to .csv file?

Posted: Tue Apr 30, 2019 7:59 pm
by johu
So far there is not. If I get around to it I could hack up a simple python script that connects either directly via serial port or via the esp8266 module and polls selected spot values to be logged.
Also short logs could be stored in the esp8266 flash memory. I think there's about 800k left.
Any better ideas?

Re: Log spot values to .csv file?

Posted: Wed May 01, 2019 2:07 pm
by nailgg
I stream the values I want to log through CAN with 10ms canperiod, then export the values to a file through the PC software of the CAN device I'm using. I have not compared the speeds of UART vs. CAN, but I guess CAN would outperform.

If CAN is not available and logging through the web interface is a must, the easiest solution I can think of without using the flash memory of ESP8266 or an external Python script is that the plotted values on the web interface can also be written into an HTML textarea in the CSV format with some simple Javascript snippet. Then the data can easily be copy/pasted into a .csv file manually.

Re: Log spot values to .csv file?

Posted: Wed May 01, 2019 3:22 pm
by johu
Yes textarea is a very plug & play idea. I guess python scripts will generate too much support burden.
CAN will outperform uart when many values are streamed. But it is limited by the 10ms interval. So if you want to log 1 or 2 values in "real time" uart is better suited.

Re: Log spot values to .csv file?

Posted: Wed May 01, 2019 4:13 pm
by nailgg
10ms (100Hz) is a good resolution for many tasks in my opinion, one can even see the currents in a good sinusoidal shape up to 20-30Hz :)

Re: Log spot values to .csv file?

Posted: Wed May 01, 2019 11:35 pm
by jon volk
The copy and paste doesn’t seem like much of a burden if it simplifies the code part of it. I eventually would like to log over CAN but haven’t purchased any hardware to do so yet.

Re: Log spot values to .csv file?

Posted: Thu May 02, 2019 11:22 am
by johu
I added the logging function.
https://github.com/jsphuebner/esp8266-web-interface

You need to upload the files index.html, index.js, log.html, log.js via the update form.

To use the feature simply check the spot values you want to log and hit the "Show Data Logger" button.

You can choose how many samples are taken every turn. The text area is then filled with CSV data. Data is averaged and you can choose to also include min/max values

Re: Log spot values to .csv file?

Posted: Thu May 02, 2019 3:20 pm
by jon volk
Awesome! Anxious to try it out this weekend.

Re: Log spot values to .csv file?

Posted: Thu May 02, 2019 5:46 pm
by jon volk
In the interim, if anyone else gets to it before I do, this is my go-to software for reviewing datalogs from my recent ICE powered endeavors. I do love me a good scatter plot

https://www.efianalytics.com/MegaLogViewerHD/