Log spot values to .csv file?

Discussion about various user interfaces such as web interface, displays and apps
Post Reply
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Log spot values to .csv file?

Post by jon volk »

Is there a way to datalog all spot values to a .csv file for review?
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Log spot values to .csv file?

Post 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?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Log spot values to .csv file?

Post 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.
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Log spot values to .csv file?

Post 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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: Log spot values to .csv file?

Post 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 :)
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Log spot values to .csv file?

Post 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.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Log spot values to .csv file?

Post 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
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Log spot values to .csv file?

Post by jon volk »

Awesome! Anxious to try it out this weekend.
Formerly 92 E30 BMW Cabrio with Tesla power
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Log spot values to .csv file?

Post 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/
Formerly 92 E30 BMW Cabrio with Tesla power
Post Reply