Classic Monitoring with a raspberry pi

Started by welmore, October 26, 2017, 12:44:45 AM

Previous topic - Next topic

ClassicCrazy

#45
Matt ,
I made some progress - and have the getter running now and it says it is connnected and UI showing up .
But I don't see any data on the UI or in any of the debugs msg payload
I am wondering about this in getter for topic
ClassicMQTT/classic/stat/readings/#

When I set up the Pi for Grahams android  app I only had ClassicMQTT as the topic . Do I need to change that in the Raspberry Pi publisher to match this now ? Maybe you are collecting more data on the Pi than I am ?


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

#46
Larry,

That subscription needs to match the mqtt_root and the classic_name you used when you started the Python publisher(s).

Oh and remember, if you are in snooze mode on the classic_mqtt.py, the default is an update every 5 minutes. That is why I added --snooze_secs so I could set it to 60 so it will give you an update every minute when no one is connected.

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

ClassicCrazy

Thanks to Matt and Graham the raspberry pi  MQTT software is now working very well.
They worked out a few bugs and I tested it and now my Pi connects to the Classic , publishes the data on MQTT, and I was able to connect up two different androids to it at the same time - one an Amazon Fire tablet with custom Rom and a Samsung Galaxy S4 with custom Rom . The newest beta android  app monitors both of my Classics which are in Follow me mode .
More info here 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

Trapp

#48
Thanks welmore your code “Logging.php” works right out of the box I’ve been using it for over a year now

Clasic 200
SN # CL 12345

I want to turn on/off the relay on aux1 with $modbus->writeSingleRegister(0, 4129, $relayon, $dataTypes);

And keep the Ethernet lock on
Please help me

Nothing ????????????

malkierian

Hey, so I tried installing this and running it (with Mosquitto, though I don't think that makes a difference). I'm having a problem (that I think I've been having for a while) where the Classics I have won't communicate over the ethernet, despite using DHCP and having an IP assigned and listed on the Classic's control panel. It also won't communicate with Classic Monitor on Android, even when I manually set the IP address. It was more intermittent before, with only one of them going unresponsive, but now, for some reason, they just won't work at all. My Pi and the Classics are connected to the same switch on the same network. I wasn't sure where else to go on this, it seems like I'd get more help here in a development forum than in the general discussion forum.
1st System: 12.5kw on 5 Classics (3 150s, 2 250s), 1 classic 250 with wind turbine, 2 stacked Magnum 4024PAE inverters.

2nd System: 1250W solar on 1 Classic 150, two DIY3024 running separate breaker boxes, one hooked up to Magnum output for AC charging.

ClassicCrazy

#50
Quote from: malkierian on April 16, 2020, 10:29:49 PM
Hey, so I tried installing this and running it (with Mosquitto, though I don't think that makes a difference). I'm having a problem (that I think I've been having for a while) where the Classics I have won't communicate over the ethernet, despite using DHCP and having an IP assigned and listed on the Classic's control panel. It also won't communicate with Classic Monitor on Android, even when I manually set the IP address. It was more intermittent before, with only one of them going unresponsive, but now, for some reason, they just won't work at all. My Pi and the Classics are connected to the same switch on the same network. I wasn't sure where else to go on this, it seems like I'd get more help here in a development forum than in the general discussion forum.

What version of firmware is in your Classic ?
last time I had problem with Classic not showing up it was because of problem with my cat 5 cable .
Are you looking at the connected lan  list in your router or just what is showing up on local status app ?
You mentioned a switch - or are they plugged into a router ? What kind of router is it ?
Also have you ever restarted the Classic and seen if that makes the Classics work again ?
You mentioned DHCP - have you ever tried making a static address ?
just some quick thoughts here

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

malkierian

I just recently updated to the latest firmware version on both, but the classic app was working before and after that. I have tried restarting, to no avail. I did recently change the router that the switch was plugged into, but the Classics have never shown up in the active device list of any router I've had them plugged into, even when Classic Monitor was picking them up. The new router is an ASUS RT-AC56U with ASUSWRT-Merlin custom firmware. As far as static vs DHCP, once it's been assigned an IP address from the router, it shouldn't make any difference to it being static as long as the router isn't reset (they hang onto MAC addresses and try to assign them the same IP address when they reconnect).
1st System: 12.5kw on 5 Classics (3 150s, 2 250s), 1 classic 250 with wind turbine, 2 stacked Magnum 4024PAE inverters.

2nd System: 1250W solar on 1 Classic 150, two DIY3024 running separate breaker boxes, one hooked up to Magnum output for AC charging.

ClassicCrazy

When you did the firmware updates did you do VMM reset on the Classics ?
can you plug your classics directly into the router to see what happens ?

Seems like if it started having problems when you got a new router then that is the place there is an issue.

Also I believe when you make changes on the networking on Classic MNGP you need to restart Classic.

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

malkierian

Man, I hate technology sometimes. I unplugged the ethernet cables from the switch and put the feeding one into a different port and they're working now.

Anyway, I don't know if I'm missing something. I have Mosquitto installed. I'm running classic_mqtt.py with mqtt_root of "classic_mqtt", and I'm running mosquitto_sub with a topic of "classic_mqtt", but whenever your script transmits (I assume that's what it's doing when it says "Enter encodeClassiCdata_readings", etc), nothing shows up on the subscription. Is there a third step somewhere that I'm missing?
1st System: 12.5kw on 5 Classics (3 150s, 2 250s), 1 classic 250 with wind turbine, 2 stacked Magnum 4024PAE inverters.

2nd System: 1250W solar on 1 Classic 150, two DIY3024 running separate breaker boxes, one hooked up to Magnum output for AC charging.

ClassicCrazy

Quote from: malkierian on April 17, 2020, 01:35:14 PM
Man, I hate technology sometimes. I unplugged the ethernet cables from the switch and put the feeding one into a different port and they're working now.

Anyway, I don't know if I'm missing something. I have Mosquitto installed. I'm running classic_mqtt.py with mqtt_root of "classic_mqtt", and I'm running mosquitto_sub with a topic of "classic_mqtt", but whenever your script transmits (I assume that's what it's doing when it says "Enter encodeClassiCdata_readings", etc), nothing shows up on the subscription. Is there a third step somewhere that I'm missing?
To be clear - I am not the guy who wrote the code - Graham and Matt did - I am just the tester and helper !
Are you using this as a guide ?
https://github.com/ClassicDIY/ClassicMQTT/wiki/3.-Raspberry-Pi-Classic-MQTT-Publisher
Not sure how long ago you downloaded any of the files - there have been some updates along the way.
Anyway on the wiki go to Step 3  - Using Docker Compose and follow those instructions .
it will install mosquitto and the other things needed if you just folllow those steps.
Let me know if you have any problems following that - I made some notes for myself last time I did my install on fresh raspberry pi.
It helps to install Portainer to see what is going on with the Docker Containers which is how this works.

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

After you give it another go, let us know what is happening and we will help you out. It is a bit complicated. I am in the process of adding some additional logging so that it might be easier to know what is happening in the code and where stuff is being published.

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

malkierian

I don't see anything about Mosquitto on there, and that is what I was following. I just barely started this project this week (been working on getting the Magnum logger working first).

And docker/docker-compose isn't necessary for me because I run VNC and keep desktop running all the time.

Thanks for checking in, Matt. Still have the issue of not getting publish data on mosquitto_sub. To be clear, I'm running python3 classic_mqtt.py --classic 192.168.1.165 --classic_name North --mqtt_root classic_mqtt --snooze_secs 15 in one terminal window and mosquitto_sub -d -t classic_mqtt in a second terminal. First terminal is logging "Got data", "Enter encodeClassicData_readings" and "Enter encodeClassicData_info", and the second one is just a bunch of "sending PINGREQ, received PINGRESP", but never gets any data from classic_mqtt.py. Do I still not have a broker running at this point? Is that my problem?

Also, is there no way to set this thing running for all available Classics on the network, or do I have to run separate instances of the script for each Classic I have connected?
1st System: 12.5kw on 5 Classics (3 150s, 2 250s), 1 classic 250 with wind turbine, 2 stacked Magnum 4024PAE inverters.

2nd System: 1250W solar on 1 Classic 150, two DIY3024 running separate breaker boxes, one hooked up to Magnum output for AC charging.

ClassicCrazy

Quote from: malkierian on April 17, 2020, 07:21:06 PM
I don't see anything about Mosquitto on there, and that is what I was following. I just barely started this project this week (been working on getting the Magnum logger working first).

And docker/docker-compose isn't necessary for me because I run VNC and keep desktop running all the time.

Thanks for checking in, Matt. Still have the issue of not getting publish data on mosquitto_sub. To be clear, I'm running python3 classic_mqtt.py --classic 192.168.1.165 --classic_name North --mqtt_root classic_mqtt --snooze_secs 15 in one terminal window and mosquitto_sub -d -t classic_mqtt in a second terminal. First terminal is logging "Got data", "Enter encodeClassicData_readings" and "Enter encodeClassicData_info", and the second one is just a bunch of "sending PINGREQ, received PINGRESP", but never gets any data from classic_mqtt.py. Do I still not have a broker running at this point? Is that my problem?

Also, is there no way to set this thing running for all available Classics on the network, or do I have to run separate instances of the script for each Classic I have connected?

if you follow the instructions I suggested it will install everything you need , mosquitto included. Once installed you only need to add the .env file with your info , then it will publish via mqtt to the Android app. And it will show both classics .

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

malkierian

Alright, I gave it a try, despite still not wanting to use docker or docker-compose. I still didn't see anything in there about specifying more than one Classic (.env only has one Classic host variable), but, since I had to uninstall mosquitto from my system in order for docker-compose's one could run, I don't know how to connect to the broker with a sub to verify what's actually being sent.
1st System: 12.5kw on 5 Classics (3 150s, 2 250s), 1 classic 250 with wind turbine, 2 stacked Magnum 4024PAE inverters.

2nd System: 1250W solar on 1 Classic 150, two DIY3024 running separate breaker boxes, one hooked up to Magnum output for AC charging.

ClassicCrazy

did you make a .env file for the classic you have and try that using the Android App ? 
Yes you need a different .env file to do both Classics - I have to look at my notes

Make you .env file like this
CLASSIC_NAME1=CLASSIC1 ( whatever you have you classic named )
CLASSIC1=192.168.x.xx
CLASSIC_PORT1=502
CLASSIC_NAME2=Classic 2 ( whatever you have your classic named)
CLASSIC2=192.168.x.xx
CLASSIC_PORT2=502
MQTT_ROOT=ClassicMQTT
MQTT_USER=ClassicPublisher( or whatever you want )
MQTT_PASS=ClassicPub123 ( whatever you want )

I forget now if you need to run a separate container for the other classic - I will look and see

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