Author Topic: Raspberry Pi Classic monitor using MQTT  (Read 481 times)

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 2670
Raspberry Pi Classic monitor using MQTT
« on: March 23, 2020, 04:08:28 PM »
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 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

mcsarge

  • Full Member
  • ***
  • Posts: 106
Re: Raspberry Pi Classic monitor using MQTT
« Reply #1 on: March 23, 2020, 05:31:17 PM »
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: 4s4p US2200 FLA 6V for 24V pack
Inverter/Charger: Trace DR2424
Call Sign: KG4EUF

schroew

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #2 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

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 2670
Re: Raspberry Pi Classic monitor using MQTT
« Reply #3 on: October 12, 2020, 07:44:14 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 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

schroew

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #4 on: October 12, 2020, 07:58:25 PM »
ohhhh, I do... I will stop the local app..

schroew

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #5 on: October 12, 2020, 08:20:28 PM »
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

  • Hero Member
  • *****
  • Posts: 2670
Re: Raspberry Pi Classic monitor using MQTT
« Reply #6 on: October 12, 2020, 08:49:48 PM »
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 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

schroew

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #7 on: October 12, 2020, 09:09:14 PM »
If I make any headway with ELK visuals in Kibana I will share the configs here.

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 2670
Re: Raspberry Pi Classic monitor using MQTT
« Reply #8 on: October 12, 2020, 09:19:36 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 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

schroew

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #9 on: October 18, 2020, 03:00:11 PM »
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

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #10 on: October 18, 2020, 03:12:03 PM »
I think they contributed power today but does anyone know if they will charge the batteries in this state?

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 2670
Re: Raspberry Pi Classic monitor using MQTT
« Reply #11 on: October 18, 2020, 06:52:09 PM »
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 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

schroew

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #12 on: October 18, 2020, 07:10:39 PM »
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

  • Newby
  • *
  • Posts: 39
Re: Raspberry Pi Classic monitor using MQTT
« Reply #13 on: October 18, 2020, 08:28:01 PM »
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

  • Hero Member
  • *****
  • Posts: 2670
Re: Raspberry Pi Classic monitor using MQTT
« Reply #14 on: October 18, 2020, 08:28:48 PM »
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 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