Raspberry Pi, Nagios, and a Classic

Started by midnite_andy, August 29, 2013, 10:51:42 PM

Previous topic - Next topic

windyboy

Quote from: midnite_andy on September 06, 2013, 11:20:55 AM
All that is required is the Nagios open-source core and free plugins.  Really, Nagios is just one example.  I could have done this with Icinga, or Munin, or a combination.

The rPi is using a Cron script that runs every 4 minutes to call the Classic and gets a list of Modbus registers.  Nagios simply checks the list which is provided as a file that updates every 4 minutes on the rPi.  Any program could use the list and the data.

The Python source files are posted above.
Thanks Andy

I went back and read the first post properly and it seems very simply and straight forward :) With that csv file its simple for any of the front ends to be used to take in the data. I'm just looking at where I'd do it in openEnergyMonitor code...

I havn't yet got my Midnight clasic, but seeing these kind of things and understanding the charger better is one of the biggest reasons why I'm wanting to get this charger.

ClassicCrazy

I am trying to get this running on the Raspberry Pi. From the first page of instructions
Lets try running modcache_engclassic.sh to see what the cache file looks like.

pi@raspberrypi /usr/local/modcache $ sudo ./modcache_engclassic.sh
pi@raspberrypi /usr/local/modcache $ cat 192.168.1.62.csv
BATT_TEMP,266
BATT_VOLTS,511
BATT_WATTS,0
FET_TEMP,309
INFO_FLAGS_H,12800
INFO_FLAGS_L,12292
PCB_TEMP,372
PV_VOLTS,1578
Status,Success
Time,1377731093.080432

But when I run it I get this
pi@raspberrypi /usr/local/modcache $  cat 192.168.2.103.csv
BATT_TEMP,0
BATT_VOLTS,0
BATT_WATTS,0
FET_TEMP,0
INFO_FLAGS_H,0
INFO_FLAGS_L,0
PCB_TEMP,0
PV_VOLTS,0
Status,Error
Time,1391896138.290171


In the modcache.py file
PROGRAM_DESCRIPTION = 'A utility for caching Modbus TCP holding registers.'
DEFAULT_PATH = 'cache.csv'
DEFAULT_RPATH = 'registers.csv'
DEFAULT_IP = '192.168.2.103'
DEFAULT_PORT = 502
DEFAULT_ADDRESS = 4100
DEFAULT_COUNT = 1


Do I need to change the default IP to the Classic IP  ( which is what I put in there ) . Not sure what is causing the error reading . I think I had the other Classic default IP address changed in File: modcache_engclassic.sh

I am new to linux and Raspberry Pi and just starting to get an understanding of how to do these things.

Thanks for any help

Larry



system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

TomW

Larry;

I messed with that awhile but abandoned it.

I "think" the registers.csv has to have a list of the registers to retrieve.

I use RossW's application on a Pi myself but that .csv file probably needs some info included in it?

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

ClassicCrazy

Where do I find RossW's program ? Seems like I saw it talked about but that was before I started getting my feet wet in Linux stuff. 
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

TomW

Quote from: ClassicCrazy on February 08, 2014, 05:40:52 PM
Where do I find RossW's program ? Seems like I saw it talked about but that was before I started getting my feet wet in Linux stuff. 

I  poked him on this so I think he will come in with a link to the newest compiled version. He is busy and I do not have the link for it handy.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

RossW

Quote from: TomW on February 08, 2014, 05:49:12 PM
Quote from: ClassicCrazy on February 08, 2014, 05:40:52 PM
Where do I find RossW's program ? Seems like I saw it talked about but that was before I started getting my feet wet in Linux stuff. 

I  poked him on this so I think he will come in with a link to the newest compiled version. He is busy and I do not have the link for it handy.

Yeah, was out on the chainsaw, cleaning up after a tree decided to come down. (heat stress).
(About 5' dia about 60' long. Did a lot of damage to other trees, fences etc on the way down).

http://support.rossw.net/midnite/ hopefully has a binary you can just download and run.

Lets know if not so we can try to sort you out!
3600W on 6 tracking arrays.
7200W on 2 fixed array.
Midnite Classic 150
Outback Flexmax FM80
16 x LiFePO4 600AH cells
16 x LiFePO4 300AH cells
Selectronics SP-PRO 481 5kW inverter
Fronius 6kW AC coupled inverter
Home-brew 4-cyl propane powered 14kVa genset
2kW wind turbine

ClassicCrazy

#36
Quote from: RossW on February 08, 2014, 08:08:13 PM
Quote from: TomW on February 08, 2014, 05:49:12 PM
Quote from: ClassicCrazy on February 08, 2014, 05:40:52 PM


Yeah, was out on the chainsaw, cleaning up after a tree decided to come down. (heat stress).
(About 5' dia about 60' long. Did a lot of damage to other trees, fences etc on the way down).

http://support.rossw.net/midnite/ hopefully has a binary you can just download and run.

Lets know if not so we can try to sort you out!

Okay - I did a wget and have it on the Raspberry Pi now. Do I have to do anything else to make it run ?  I tried looking at it with the Leafpad viewer but just one line of nothing intelligible shows up.
Okay I don't think it downloaded correctly that other way so am using the raspberry pi browser to download it and will see if that works .

Too bad about the trees falling over but at least you must be warmer there than in Wisconsin now !
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

RossW

Quote from: ClassicCrazy on February 08, 2014, 08:46:44 PM
Okay - I did a wget and have it on the Raspberry Pi now. Do I have to do anything else to make it run ?

./newmodbus -p 192.168.1.62    might show you something.

./newmodbus -?      should print some cryptic help.

Quote
Too bad about the trees falling over but at least you must be warmer there than in Wisconsin now ![/color][/size][/font]

39.6C outside now, 40.8C yesterday (a little over 105F). We're expecting a few warm days. The worst part is when it doesn't cool down overnight (stayed over 85F). (With no aircon, it's hard to cool down when you've been outside working)
3600W on 6 tracking arrays.
7200W on 2 fixed array.
Midnite Classic 150
Outback Flexmax FM80
16 x LiFePO4 600AH cells
16 x LiFePO4 300AH cells
Selectronics SP-PRO 481 5kW inverter
Fronius 6kW AC coupled inverter
Home-brew 4-cyl propane powered 14kVa genset
2kW wind turbine

ClassicCrazy

Well it was minus 20 F here last night and that has been common this winter and another inch of snow today . Spring will come sometime .

So I downloaded it again using the browser on Raspberry but same results. When I downloaded it on my windows computer and looked at it with notepad it showed a file.
pi@raspberrypi ~ $ ls -i1
49047 Desktop
36668 libmodbus-3.0.3.tar.gz
268027 libmodbus-3.0.5
33152 libmodbus-3.0.5.tar
36957 libmodbus-3.0.5.tar.gz
36974 linuxsucks
33309 linuxsucks.c
42476 modcache_rev-_08282013.zip
36973 newmodbus-ARM
37085 newmodbus-ARM0
49058 ocr_pi.png
48965 python_games
33312 sunsaver.c
37641 sunsavertest
32604 sunsavertest.c
pi@raspberrypi ~ $ ./newmodbus -?
-bash: ./newmodbus: No such file or directory
pi@raspberrypi ~ $ ./newmodbus -p 192.168.1.62
-bash: ./newmodbus: No such file or directory
pi@raspberrypi ~ $
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

RossW

Quote from: ClassicCrazy on February 08, 2014, 09:07:48 PM
So I downloaded it again using the browser on Raspberry but same results. When I downloaded it on my windows computer and looked at it with notepad it showed a file.

36973 newmodbus-ARM
37085 newmodbus-ARM0

pi@raspberrypi ~ $ ./newmodbus -?
-bash: ./newmodbus: No such file or directory

The file needs to be renamed from "newmodbus-ARM" to "newmodbus", but more concerning is why both your files are different sizes, and neither of them is the same size as the original!

The file should be 27125 bytes long.
The MD5 signature is f4d183a2571a2c1107da40fdf4cd7fec
3600W on 6 tracking arrays.
7200W on 2 fixed array.
Midnite Classic 150
Outback Flexmax FM80
16 x LiFePO4 600AH cells
16 x LiFePO4 300AH cells
Selectronics SP-PRO 481 5kW inverter
Fronius 6kW AC coupled inverter
Home-brew 4-cyl propane powered 14kVa genset
2kW wind turbine

ClassicCrazy

Quote from: RossW on February 08, 2014, 09:29:41 PM
Quote from: ClassicCrazy on February 08, 2014, 09:07:48 PM


The file needs to be renamed from "newmodbus-ARM" to "newmodbus", but more concerning is why both your files are different sizes, and neither of them is the same size as the original!

The file should be 27125 bytes long.
The MD5 signature is f4d183a2571a2c1107da40fdf4cd7fec

Okay success by renaming it ! Always something simple in linux that takes me a long time to figure out.
pi@raspberrypi ~ $ ./newmodbus -p 192.168.2.103
CLASSIC Display Panel 1.0.19, RossW
State Resting because PV Input Voltage lower than Battery V
Firmware 1758
ClassicTime 20:38:40  08/02/2014
    0 Watts out
25.0 Volts (Battery)
  8.7 Volts (PV)
  0.0 Amps (Battery)
  1.0 kWh today (37 amphours)
pi@raspberrypi ~ $
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ClassicCrazy

Oh - and glad I saw in another post that I had to close Local Status App to get it to work

Thanks for your help Ross - I will see if I can figure anything else out via the help file which also displays now
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Highflyer

Andy, Tom, Ross, and all:

I am new here.  I am a beta testing a Kid (or two).  I am going to get a PI or two for several functions I want at my remote solar sites.  Does the Kid have the same information available via a data dump?  I understand busses, registers, addresses and programming, or at least I have in the past. ;D

Thanks for any help.
Brian

The one thing is the one thing

ClassicCrazy

Brian - my understanding is that the Kid does not have any type of communication or monitoring other than the firmware updates and what the LCD display does.  Though I think I have read somewhere it may somehow be technically possible to get it to spit out some sort of serial output in the future nothing is on the horizon at this point.
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Highflyer

CC,
Thanks for the info.  I still need the PI for the other functions, so it will get worked on and if the KID's data becomes available, that will be even better.
Brian

The one thing is the one thing