Author Topic: Classic Monitoring with a raspberry pi  (Read 3548 times)

welmore

  • Newby
  • *
  • Posts: 15
Re: Classic Monitoring with a raspberry pi
« Reply #15 on: April 22, 2018, 12:16:19 PM »
Here is an updated "Logging.php" file.

   There are some new comments added.
   The issues with the "Solar_Log.dat" file is fixed.  The old version caused multiple entries each day.
   New code to update and display the "history.txt" file was added.

At the bottom of "Solar_Monitoring_Gauges_plus.php" is the code to ready and display the history information.

<?php
//Display history
$HistoryLog = fopen ($dir."history.txt","r");
for ($a = 0; $a <= 6; $a++){
   $History[$a] = fgetcsv($HistoryLog);
}
fclose($HistoryLog);
echo('<br><table><tr><td ALIGN=Center>Date<td ALIGN=Center>S1 Peak<td ALIGN=Center>S1 kWhr<td ALIGN=Center>S2 Peak<td ALIGN=Center>S2 kWhr');
for ($a = 0; $a <= 6; $a++){
   echo('<TR>');
   $HDay=$History[$a];
   echo('<td ALIGN=Center>'.substr($HDay[0],4,2).'/'.substr($HDay[0],6,2));
        echo('<td ALIGN=Center>'.$HDay[1]);
        echo('<td ALIGN=Center>'.number_format($HDay[2],$decimals=1));
        echo('<td ALIGN=Center>'.$HDay[3]);
        echo('<td ALIGN=Center>'.number_format($HDay[4],$decimals=1));
}
echo('</table>');



?>

Feel free to rearrange as you wish.

The "history.txt" file needs to be in your "Data/" folder there the "current.txt" file is.

The existing history data is from my system.  It will rotate out in 7 days.

Each day, around midnight, the "Logging.php" program will update the "history.txt" file, add a daily record to "Solar_log.dat" and reset the daily highs and lows saved in Dlog_Data
  • .


Contact me with questions, comments, or suggestions.

Have a great day

Others interested, I will supply all required files and instructions on request.

binkino

  • Sr. Member
  • ****
  • Posts: 254
    • BinKino's PV
Re: Classic Monitoring with a raspberry pi
« Reply #16 on: April 23, 2018, 02:34:20 PM »
Thanks Wade, that makes it so complete and perfect now,
have added the code to one of my gauges page and to my Lcars page and now waiting for it collects some days data and then I will see, how I can finetune it on my Lcars page.
(see link below)
If someone want to have the code for one of my pages too, let me know in comment / post here
PV-OUTPUT: http://pvoutput.org/list.jsp?id=38617
Classic Lite 200 + Classic 200 + Westech Combi 3000 + 3x4x240Wp + 1x4x255Wp + 575 AH EPzS
http://a68k.de:81/Solar/Monitor_LC.php

Jose Miranda

  • Newby
  • *
  • Posts: 28
Re: Classic Monitoring with a raspberry pi
« Reply #17 on: May 13, 2019, 09:26:09 AM »
Hi guys. Is this code being maintained somewhere? Where can I get the latest code?

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 2113
Re: Classic Monitoring with a raspberry pi
« Reply #18 on: May 13, 2019, 01:12:40 PM »
Hi guys. Is this code being maintained somewhere? Where can I get the latest code?

If using a Pi I would move on to using Node -Red - seems a more powerful tool to use and easier too.
There is a post on Node-Red on forums here.

Larry
system one
Classic 150 , 5s4p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system two
Classic 150 ,5s 135 watt Kyocero , 16s Calb 100AH LiFePO4 , Outback VFX 3648 inverter
system three
Midnite KID MPPT 24 DC in to  12 volt AGM batterie

Steve_S

  • Newby
  • *
  • Posts: 1
Re: Classic Monitoring with a raspberry pi
« Reply #19 on: Today at 10:42:01 AM »
I'm just catching up on the forum here and saw this and I am very intrigued indeed.   

While I don't mind the software for my C-200 and it's useable, it's just a tad "lacking" shall we say.  Now I don't have a Raspberry but have been pondering getting into them over the last couple of years as I've realized they can be used for many things.  I'd like to be able to setup a Pi that could gather the stats from my C200 and if possible from my new Samlex EVO-4024 Inverter which I could then access from my PC.  Although, I'm not sure of the Samlex capabilities the spec's state the following:
Quote
RJ-45 Jacks for Communication Ports “COMM 1” and “COMM 2” - for rS-485 networking and MODbUS Serial Communication Protocol (for future use)   RJ-45 Jacks for Communication Ports “COM 3” and “COM 4” - for “CANbus” Serial Communication Protocol (for future use)

Other uses for the Pi could be to manage my heat recovery / air exchanger ventilator (fan speeds related to temps) and such.  I know that's beyond the scope of this topic but I'm hoping you would be able to recommend a good Pi bundle (there are so darned many, it's nuts!) that could / would best accommodate me.

Thanks
Steve
2080W of Canadian Solar CS-260P in 2 strings of 4, Classic-200, Rolls Surette S-550 24V/856Ah battery bank, APC-3024/120 LF Inverter/Charger (45A)

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 2113
Re: Classic Monitoring with a raspberry pi
« Reply #20 on: Today at 01:31:41 PM »
You probably want the latest and greatest Raspberry Pi 3 B + model.
If you want to wait a bit there is supposed to be a Raspberry Pi 4 coming out but I don't know details.
As to where to purchase - depends on if you want to get the complete kit with power supply, a case, the sd card, etc or just the board which is abut $35 . Get the kit if you don't have all that other stuff laying around and the case is a good idea.
Lots of places to look for what you get for the money - Amazon, Adafruit, Ebay, Ali Express. Make sure you don't get an old Raspberry Pi 3 model - it has to be 3 B+
https://www.adafruit.com/category/105
Also a good quality SD card makes a big difference


For what you want to do Node Red is the way to go so if you can figure that out you have it made . Lots of tutorials on Node Red - I like Andreas Spiess on Youtube .
here is his latest video but look back at the others
https://youtu.be/z1y6j8-V7J0

Larry

system one
Classic 150 , 5s4p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system two
Classic 150 ,5s 135 watt Kyocero , 16s Calb 100AH LiFePO4 , Outback VFX 3648 inverter
system three
Midnite KID MPPT 24 DC in to  12 volt AGM batterie