Raspberry Pi Classic monitor using MQTT

Started by ClassicCrazy, March 23, 2020, 04:08:28 PM

Previous topic - Next topic

ClassicCrazy

Thanks to Graham and Matt who have been working on Classic Monitoring App - you can now use a Raspberry Pi to monitor mulitple Classics . It reads the Classic via Modbus over IP , then acts as MQTT Publisher so that any other device can get the Classic data. In the past there was the frustrating limit of only one IP network connection to Classic at a time, but using the MQTT you can connect up multiple devices or do whatever you want with the data .  There is also the software to use and Esp32 to talk to the Classic and publish the MQTT data. The MQTT will work without any port forwarding . You can either use an outside MQTT broker or just use the Raspberry Pi locally on your own network .
What I have right now is a Raspberry Pi 3B+ running the software - it gets the data from both my Classics which are in follow me mode. I monitor the data on an old Android phone using Grahams Monitoring app ( the new version available on link) . It reads combines some of the data from both Classics on one screen for a system view.
Here is the detailed forum topic
http://midniteftp.com/forum/index.php?topic=4817.0

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

mcsarge

Thanks for the good press Larry!

I am also working on a couple of other projects that will use the data sent to the MQTT broker:

   1. An ESP32 driven RGB LED Panel that will display selected data from the Classic (SOC, Battery voltage, current, etc). Suitable for mounting on a wall to keep tabs on the status of your system.
   2. A web-based display that will show the data from the classic similar to Graham's Android App. This could be displayed on any smart phone, computer or tablet.

If anyone out there is more adept at writing a web site linked to an MQTT broker and needs information on the nature of the data that is published, sing out - I would love to have some help on that.

Matt
Off Grid Island in Ontario Canada (Beaverstone Bay)
Primary: Classic 150 + wbjr; 3s2p HES 270watt
Winter: SolarBoost 50 MPPT (into wbjr); 2 x Sharp NE-80EJEA 80watt
Pack: 4s2p ROLLS S6-460AGM 6V for 24V pack
Inverter/Charger: Trace DR2424
Call Sign: KG4EUF

schroew

I am trying this out on a Ubuntu system and I can get it to connect and I have this error. What would cause that?

2020-10-12 16:45:48,281:DEBUG:classic_mqtt:Opening the modbus Connection
2020-10-12 16:45:48,391:ERROR:classic_mqtt:MODBUS isError H:192.168.1.126 P:502
2020-10-12 16:45:48,391:ERROR:classic_mqtt:MODBUS data not good, skipping publish

ClassicCrazy

Quote from: schroew on October 12, 2020, 05:49:47 PM
I am trying this out on a Ubuntu system and I can get it to connect and I have this error. What would cause that?

2020-10-12 16:45:48,281:DEBUG:classic_mqtt:Opening the modbus Connection
2020-10-12 16:45:48,391:ERROR:classic_mqtt:MODBUS isError H:192.168.1.126 P:502
2020-10-12 16:45:48,391:ERROR:classic_mqtt:MODBUS data not good, skipping publish

The Classic can only do one network modbus connection at a time - do you have anything else connected like the local status app ?

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

schroew

ohhhh, I do... I will stop the local app..

schroew

looks better
{"BatTemperature":19.7,"NetAmpHours":0,"ChargeState":0,"InfoFlagsBits":-1308610300,"ReasonForResting":5,"NegativeAmpHours":0,"BatVoltage":25.5,"PVVoltage":7.4,"VbattRegSetPTmpComp":27.5,"TotalAmpHours":400,"WhizbangBatCurrent":0.0,"BatCurrent":0.0,"PVCurrent":0.0,"ConnectionState":0,"EnergyToday":0.2,"EqualizeTime":3600,"SOC":100,"Aux1":false,"Aux2":false,"Power":0.0,"FETTemperature":26.4,"PositiveAmpHours":0,"TotalEnergy":127.9,"FloatTimeTodaySeconds":733,"RemainingAmpHours":400,"AbsorbTime":7200,"ShuntTemperature":-50.0,"PCBTemperature":33.5}


ClassicCrazy

Matt and Graham have it so the local status app can break in whenever you turn that on because it polls on intervals. Then when you disconnect the Local Status app the MQTT data will resume. Works good that way because you can write changes to settings  no problem without disconnecting anything on the mqtt program.

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

schroew

If I make any headway with ELK visuals in Kibana I will share the configs here.

ClassicCrazy

Quote from: schroew on October 12, 2020, 09:09:14 PM
If I make any headway with ELK visuals in Kibana I will share the configs here.

great - thanks - and also  get in touch with Graham and Matt and see if they can add you to the github Slack developer group
https://github.com/ClassicDIY

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

schroew

I just got up to my place today and 2/3 controllers are saying Got Comm. I think the MQQT script has something to do with this.

schroew

I think they contributed power today but does anyone know if they will charge the batteries in this state?

ClassicCrazy

Got comm is just communication between controller and MNGP I believe. It shouldn't effect the Classics operation.
I have never seen any issues while using MQTT.
Did you change any of the Classic addresses ?

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

schroew

Hmm, I did when I was here last weekend. I changed the mod buss address. They were all at the same address. Was that bad?

schroew

It was something I did when I changed the modus address from 10 to 9 and 8 respectively. I think the MNGP couldn't talk to the classic anymore.

ClassicCrazy

I think maybe there are two addresses to set . There was just a discussion about this recently - I will see if I can find it.

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