A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => Raspberry PI => Topic started by: Simonbr on July 07, 2022, 10:24:50 AM

Title: What’s currently recommended
Post by: Simonbr on July 07, 2022, 10:24:50 AM
I have a raspberry pi that I don’t use and was wondering what is currently available to use to log and or do other tasks? I noticed there wasn’t much activity in this part of the forum so decided to ask.
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 07, 2022, 05:21:46 PM
You mean to log in to the Classic ?
There is the Classic DIY project on github
and there was another project going for awhile too that worked on a pi - forget now what it was called but should be in this heading .
The one I use is this
http://midniteftp.com/forum/index.php?topic=5741.0
Larry
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 07, 2022, 05:22:54 PM
This is the other one I was thinking of
http://midniteftp.com/forum/index.php?topic=5060.0
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 13, 2022, 12:11:14 PM
Quote from: ClassicCrazy on July 07, 2022, 05:21:46 PM
You mean to log in to the Classic ?
There is the Classic DIY project on github
and there was another project going for awhile too that worked on a pi - forget now what it was called but should be in this heading .
The one I use is this
http://midniteftp.com/forum/index.php?topic=5741.0
Larry

Hello Larry, I am very interested in this project and want to give it a shot. Currently I was hopping that I could get MM2 to work with the logging, I had set a smart plug to turn on every 3 hours for 20 minutes at camp so that my internet would turn on, update to MM2 then turn off. With my luck the classic does not keep a log of of the info sent to MM2 when its not online.

My next option was to just get a low voltage cellular router and a cheap cell pay as you go plan to have the classic update, just not sure of the data usage. Downside initial investment is about $200 cnd. https://www.inhandnetworks.com/products/inrouter300.html

The raspberry pi option looks very good too and I can still configure to be able to connect to the pi every few hours. I was looking at the wiki and was wondering if there was a getting started guide to configure the pi with the OS and the software needed? I had bought one a couple years ago for the kids with to play emulated classic games but the lag was horrible so its been sitting there for years. I have the CanaKit Raspberry Pi 3 Complete Starter Kit - 32 GB Edition, I was wondering if this is good for this project?

Any help with the initial configuration would be greatly appreciated.
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 13, 2022, 02:09:53 PM
Yes this is the easiest way to install Classic monitoring on Raspberry Pi .
That is unless something has changed - let me know if you have any problems with it.
Once  you have the Pi monitoring Classic and publishing via mqtt then there are many options to use like Grahams android app, running the Grafana on the pi , etc.
https://github.com/ClassicDIY/ClassicMQTT/wiki/3.1-Raspberry-Pi-setup-using-IOTStack
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 14, 2022, 09:42:23 PM
Quote from: ClassicCrazy on July 13, 2022, 02:09:53 PM
Yes this is the easiest way to install Classic monitoring on Raspberry Pi .
That is unless something has changed - let me know if you have any problems with it.
Once  you have the Pi monitoring Classic and publishing via mqtt then there are many options to use like Grahams android app, running the Grafana on the pi , etc.
https://github.com/ClassicDIY/ClassicMQTT/wiki/3.1-Raspberry-Pi-setup-using-IOTStack
Larry

Thank you for the link, I have everything installed and configured but I have one small problem. At the last step for Grafana, I cant seem to be able to use the MQTT data. I created the data source using the info provided in the wiki, but when I load the sample dashboard or try to use the FROM query, it says no options found.
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 12:03:51 AM
Use Portainer and go to each program - Mosquitto , Telegraf, etc and click on the logs and see if any of them have errors.
Also did you get Verified Data Source in Grafana ?
Larry
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 12:10:55 AM
Seems like Grafana must not be seeing your mqtt_consumer .
Been awhile since I set all that up so I would have to reread the instructions you just followed.
See below for my example
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 12:14:09 AM
Quote from: ClassicCrazy on July 15, 2022, 12:03:51 AM
Use Portainer and go to each program - Mosquitto , Telegraf, etc and click on the logs and see if any of them have errors.
Also did you get Verified Data Source in Grafana ?
Larry

There are no errors in any of the logs.
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 12:14:42 AM
example of Telegraf file
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 12:16:14 AM
Did you restart containers after you modified any files in them ?
after I modified Telegraf the other day I used portainer to restart that.
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 12:20:08 AM
Quote from: ClassicCrazy on July 15, 2022, 12:16:14 AM
Did you restart containers after you modified any files in them ?
after I modified Telegraf the other day I used portainer to restart that.
Larry
I rebooted the pi earlier and just tried to restart Telegraf, same error. And yes I did get the message Data source is working.
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 12:21:50 AM
Quote from: ClassicCrazy on July 15, 2022, 12:14:42 AM
example of Telegraf file

What exactly is this file, i can verify it.
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 10:07:56 AM
Quote from: Simonbr on July 15, 2022, 12:21:50 AM
Quote from: ClassicCrazy on July 15, 2022, 12:14:42 AM
example of Telegraf file

What exactly is this file, i can verify it.
https://github.com/ClassicDIY/ClassicMQTT/wiki/3.1-Raspberry-Pi-setup-using-IOTStack
You may have skipped a step ?

Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 10:16:52 AM
Quote from: Simonbr on July 15, 2022, 12:21:50 AM
Quote from: ClassicCrazy on July 15, 2022, 12:14:42 AM
example of Telegraf file

What exactly is this file, i can verify it.
I show where the telegraf file is in this video
https://youtu.be/xKxGaerzNKM
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 10:18:47 AM
Quote from: ClassicCrazy on July 15, 2022, 10:07:56 AM
Quote from: Simonbr on July 15, 2022, 12:21:50 AM
Quote from: ClassicCrazy on July 15, 2022, 12:14:42 AM
example of Telegraf file

What exactly is this file, i can verify it.
https://github.com/ClassicDIY/ClassicMQTT/wiki/3.1-Raspberry-Pi-setup-using-IOTStack
You may have skipped a step ?

Just verified that location and the conf file is there, opened it with nano and it has the correct db user/password also.
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 10:26:07 AM
Quote from: ClassicCrazy on July 15, 2022, 10:16:52 AM
Quote from: Simonbr on July 15, 2022, 12:21:50 AM
Quote from: ClassicCrazy on July 15, 2022, 12:14:42 AM
example of Telegraf file

What exactly is this file, i can verify it.
I show where the telegraf file is in this video
https://youtu.be/xKxGaerzNKM
Larry

Does the file need any modification from the defaults after doing the install from the wiki?
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 10:59:33 AM
Yes you need to put in the name of your Classic exactly as you have it in the compose override.
Did you try the mqtt explorer to see if it is sending out the mqtt data ?
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 11:15:08 AM
Quote from: ClassicCrazy on July 15, 2022, 10:59:33 AM
Yes you need to put in the name of your Classic exactly as you have it in the compose override.
Did you try the mqtt explorer to see if it is sending out the mqtt data ?
Larry

I am assuming you mean the circled area in the attached image? No I have not tried the mqtt explorer, could you explain how to get to it?
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 11:33:24 AM
yes what you have circled above .
At bottom of this link is mqtt tool info - called mqtt.fx  ( I think there is another called mqtt explorer)
https://github.com/ClassicDIY/ClassicMQTT/wiki/3.1-Raspberry-Pi-setup-using-IOTStack
Search on internet should find either one
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 15, 2022, 11:35:47 AM
OK after changing the name of the classic from the circled area in the image and restarting telegraf and grafana it seems that it worked. I am playing around a little to see if I can make a nice dashboard with the values I require.

I noticed from your dashboard I used the charging current, looking at the table view it only pulls info every 5 minutes, is it a bad idea to pull more info more often, i would like to have closer to a live view for some values like current and PV info.
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 15, 2022, 02:15:15 PM
I have experimented a lot with Grafana and the timings and graphs.
Just try everything and see what works best for you. I think the Classic MQTT is posting every 10 seconds ? 
Not even sure how much I have changed my graphs and ways I did stuff since the last time I posted sample stuff.
Probably a lot of changes.
I know I just changed some of my own graphs this morning from 5 minutes to 10 seconds - at the time i had a bunch of dots but there are other settings in there that fill in the graph . I mostly been figuring it all out by trial and error.
Larry
Title: Re: What’s currently recommended
Post by: Simonbr on July 21, 2022, 11:53:43 AM
Quote from: ClassicCrazy on July 15, 2022, 02:15:15 PM
I have experimented a lot with Grafana and the timings and graphs.
Just try everything and see what works best for you. I think the Classic MQTT is posting every 10 seconds ? 
Not even sure how much I have changed my graphs and ways I did stuff since the last time I posted sample stuff.
Probably a lot of changes.
I know I just changed some of my own graphs this morning from 5 minutes to 10 seconds - at the time i had a bunch of dots but there are other settings in there that fill in the graph . I mostly been figuring it all out by trial and error.
Larry

Good Morning Larry, I've been playing with Grafana and have a pretty good handle on it, making myself a nice interface. I was wondering on the interval for refreshing, it seems even if i set it lower like 20 seconds, it doesn't seem to be getting new info from the CC. Is there another setting above Grafana that pulls info more often from the CC?
Title: Re: What’s currently recommended
Post by: ClassicCrazy on July 21, 2022, 12:07:21 PM
Quote from: Simonbr on July 21, 2022, 11:53:43 AM
Quote from: ClassicCrazy on July 15, 2022, 02:15:15 PM
I have experimented a lot with Grafana and the timings and graphs.
Just try everything and see what works best for you. I think the Classic MQTT is posting every 10 seconds ? 
Not even sure how much I have changed my graphs and ways I did stuff since the last time I posted sample stuff.
Probably a lot of changes.
I know I just changed some of my own graphs this morning from 5 minutes to 10 seconds - at the time i had a bunch of dots but there are other settings in there that fill in the graph . I mostly been figuring it all out by trial and error.
Larry



Good Morning Larry, I've been playing with Grafana and have a pretty good handle on it, making myself a nice interface. I was wondering on the interval for refreshing, it seems even if i set it lower like 20 seconds, it doesn't seem to be getting new info from the CC. Is there another setting above Grafana that pulls info more often from the CC?

I was just looking at the code for Classic mqtt . It looks like it  there are various wake , snooze, and publish rates in there to get data from the Classic .
Best to ask Graham about if there is a way to speed it up - that is a bit above my knowledge.
Let us know what you find out.
It almost seems like he told me how to change some of those timings in the past.
I think the snooze time is in there so the Midnite Local Status app can butt in and take control when you want to use that .
Then when you close the Local Status app , the Classic MQTT will resume.( and if you forget to close it you will wonder why the mqtt quit working !)
Can you share a screen shot of your Grafana ? It would be nice to see what you came up with.
Larry