A Forum run by Enthusiasts of MidNite Solar

Charge Controllers and Clippers => The "KID" charge controller => Topic started by: Nomad1 on September 06, 2018, 01:44:03 PM

Title: Very simple Web page for PC Mode stats
Post by: Nomad1 on September 06, 2018, 01:44:03 PM
Hi guys!
I'm new to this forum, so before asking dumb questions I want first to present my small gift for this community: very simple web page, displaying data coming from KID in PC Mode.
It lacks fancy graphs and whistles, but that's the kind of data I expect to see from my rig while not at home.

Project page on GitHub: https://github.com/Nomad1/KIDStats

Installation
Note: it requires at least basic Linux knowledge, since the script is written in Bash and it could be tricky to port it to Windows.

Grab the code from git, put pv.php file to your favorite web server with PHP support (you might need to give it some permissions to read from /tmp/ folder), edit read_midnite.sh script to point to your serial device, and add it to your crontab.
I.e. I set it to be called every minute:
* * * * * /etc/read_midnite.sh

After that you can access http://127.0.0.1/pv.php page and see something like a picture in attachment.

That's all. Enjoy!

Update 09/08/18:
Now you can use the script on your favorite PI, or OpenWRT router without PHP. Idea is simple: add file read_midnite_ext.sh to your cron and give it valid path for pv.php file (used as a template) and for pv.html file (output page). Script uses awk and bc, so you might need to install them as well.
Title: Re: Very simple Web page for PC Mode stats
Post by: boB on September 06, 2018, 02:44:19 PM

Very cool Nomad !

Thank you for contributing this !  These are the kinds of things that make the open comms and forum so useful !

boB
Title: Re: Very simple Web page for PC Mode stats
Post by: ClassicCrazy on September 06, 2018, 07:38:42 PM
Nomad,
Which firmware version are you using for your Kid ?
Larry
Title: Re: Very simple Web page for PC Mode stats
Post by: Nomad1 on September 07, 2018, 02:22:53 AM
Quote from: ClassicCrazy on September 06, 2018, 07:38:42 PM
Nomad,
Which firmware version are you using for your Kid ?
Larry

I'm on 1864 beta, from the announcement topic in this forum. 1860 won't work because of debug issues.
Title: Re: Very simple Web page for PC Mode stats
Post by: harryn on September 20, 2018, 11:48:41 AM
Thanks for this  - we try to use Linux by default and it is annoying when we can only find win s/w.