Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

RaspberryPi script to display weatherstation values via ssh - Version 2.0 (May 2022)

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

RaspberryPi script to display weatherstation values via ssh - Version 2.0 (May 2022)

Post by jank »

Hi all

New Version available 16.05.2022
This script was never adopted to the newer version of CumulusMX. Since I had some spare time the past days, I adopted this old BAsh Script to work with newer versions of CumulusMX now.
cumulusnow.zip
The Script will read the most current values like: temperature,humidity, pressure..... and display these values in the SSH Session.
The Values are being updated in a 5 minute loop (can be changed) and the most current values will be compared with the values 15 minutes ago to find out, if values are increasing or decreasing.
Depending on this result, the colors of the values should change. Also todays min/max values will be displayed.
Should automatically detect your locale units (Fahrenheit or Celsius etc....)

The script can be stopped by pressing CTRL+C

Instruction:

- Download the ZIP File from this post and transfer (Copy) it into the CumulusMX folder (FTP or WINSCP).
- Login to your Raspberry Pi as user pi (or whatever) using SSH and insert the commands in blue
- This script can also be downloaded directly when starting the CumulusMX Start|Stop Script with option -n

1. If not already unzipped: unzip cumulusnow.zip
2. Make the script executable: sudo chmod +x cumulusnow.sh
3. Start the script sudo ./cumulusnow.sh or /home/pi/CumulusMX/cumulusnow.sh
cumulusnow.jpg

If you also have running the CumulusMX Start|Stop Script, you can download and start cumulusnow.sh with sudo /home/pi/CumulusMX/cumulusmx.sh -n


Important: This script is not a replacement for Steve's great CumulusMX program. It will not work without a well configured ComulusMX and it will not show any current value, if CumulusMX is not running.
If you have any problems, please let me know.



V1.4: In Version prior 1.4 I mixed up UV Index and Radiation. This is fixed in V1.4
You do not have the required permissions to view the files attached to this post.
Last edited by jank on Tue 17 May 2022 12:15 pm, edited 21 times in total.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi script to display weatherstation values via

Post by jank »

Hello Steve

I hope it is okay, if I am placing CumulusMX related Scripts here into your Forum ?
Jan
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: RaspberryPi script to display weatherstation values via

Post by steve »

Yes, that's fine - thanks.
Steve
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Very nice Jank!!!

Testing your script here now. Here my CumulusMX is located in the root drive of the RPi2.

Here doing automation software on another RPi2.

I can today run CumulusMX and the automation software on the same RPi2.

IE: /CumulusMX

Changed these lines to show:

Code: Select all

#!/bin/bash
export LANG=en_US.UTF-8
#Version 1.0 - 20.07.2015
# playing updated - 23.07.2015 - modded lines 1-13

LOOP=5 #Reload time in Minutes
echo ".....please be patient. Collecting some initial information....."

if [ ! -f "/CumulusMX/CumulusMX.exe" ];then
      INSTPATH=$(sudo find / -path "/mnt/*" -prune -o -type d -name "CumulusMX" -print |head -n1) > /dev/null
    else
      INSTPATH="/CumulusMX/"
fi
Not working yet and wondering if there are some more static lines that I need to change?

This is what I see right now without or with the modifications using Putty from a Wintel machne.

./cumulusnow.sh: line 72: [: 23/07/1510:40,838,48,62.0,1.8,5.0,190,0.00,0.00,29.985,13.04,70.3,52,2.0,83.8,84.5,0.0,0,0.000,0.000,86.8,808,0.0,204,0.00,0.00: integer expression expected
You do not have the required permissions to view the files attached to this post.
- Pete
Automator
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi script to display weatherstation values via

Post by jank »

Hello Pete

thank you for trying out my small Script........
...and, why is my language/locales so different from yours ? :bash:

.....but, there is always something I can improve......so here are the facts.
The script is start failing in the very beginning.
When I was trying to find out, what is the most current CumulusMX Logfile I am using this Command

ls -t /CumulusMX/data/*log.txt | head -1 |xargs tail -n1 |cut -d ";" -f1

This Command will list all Logfiles in the data folder, Sort is by Data and the
.log file on top of the list is the most current Logfile. --> ls -t /CumulusMX/data/*log.txt
Than I am going down to the last line in this log --> xargs tail -n1
...and the Date Info is the first value in this line. and the values are seperated by Semicolon ---> cut -d ";" -f1
But, only my german locale seem to use the semicolon seperator

24.07.15;15:35;27,4;50;16,1;11;29;106;0,0;0,0;1009,1;1244,7;25,5;52;29;27,4;27,8;0,0;0;0,00;0,00;27,4;1003;0,0;112;0,0;0,0

But yours, I think english locale is using comma as a seperator. (Based on your Screenshot)

Anyway, I am able to find out which locale is being used, so I need to modify the script by finding out, what seperators are being used by people to automatically use the seperator for each locale.

Pete, I am sorry, currently this scirpt is only being usable by Germans.......I will modify it as soon as possible.

By the way, are you able to send me your July Logfile (/data/Jul15log.txt) that I am able to test on it?
I am sure, if you zip it, it should be small enough.

Thanks for your testing
Jan
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi script to display weatherstation values via

Post by jank »

Pete

as I mentioned in my last post, it was my fault that the script is not working in any other language than mine :-)
I looked into my german logfiles and I have ";" as a delimiter, but most of the other countries are having "," as a delimiter.
In the first post, there is a fixed verion which now should work for you and all other languages.

I fixed the problem now by looking into the most current CumulusMX/data/Jul15log.txt logfile and searching for the 9th character in the first line which is the delimiter which is seperating the date from the time.
This is how I try to find out, what's your delimiters.

Regarding the first 13 lines you changed.....I think you don't need to modify anything here, because ...... ( I will explain how I get the install path of CumulusMX)

if [ ! -f "/home/pi/CumulusMX/CumulusMX.exe" ];then (If CumulusMX.exe can not be found in the location most users are using (/home/pi/CumulusMX) then)
INSTPATH=$(sudo find / -path "/mnt/*" -prune -o -type d -name "CumulusMX" -print |head -n1) > /dev/null (I am searching on the complete RaspberryPi for a folder called CumulusMX)
else
INSTPATH="/home/pi/CumulusMX/"
fi

So normally, It should find the CumulusMX folder also, if you have installed it directly in the root (I did the same on my RaspberryPi)
So nothing to change by your side....the script should run without modifying anything.
The only Parameter which might be changed (if you like) is the Loop interval which is currently 5 Minutes until the script will read new values.

Please test the script again and let me know if it is working for you.
thanks Jan
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Hello Jan.

Thank-you for providing the SSH script to the Cumulus community.

I am using the RPi2 close to Chicago here.

Yup; here installed CumulusMx in the root directory. (well recently on another RPi2 testing automation software which I installed to the root directory).

I think I did this to mostly just save typing time.

I see the first post has been updated with most current version of the script so will download it and give it a try.
Please test the script again and let me know if it is working for you.
I will test the script again and let you know if it is working for me.
- Pete
Automator
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Hello Jan,

Script looks good. Thank you.

I did not change anything in lines #1 to #13.

Just see a couple of things which you will see in the attached JPG.

- date in US is presented as 07/26/15 versus 26/07/15

- Refressh ==> Refresh

- Min/Max Pressure is in % versus in - unless this is the way you want to present it.

- CPU Temperature is 33.6'C instead of 33.6 °C

Very nice.
cumulusnow.jpg
You do not have the required permissions to view the files attached to this post.
- Pete
Automator
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi script to display weatherstation values via

Post by jank »

Hello Pete, thank you very much for helping me, finding some of the bugs.
pete_c wrote: Just see a couple of things which you will see in the attached JPG.

- date in US is presented as 07/26/15 versus 26/07/15
This is the way, Steve logs the date into the Logfiles
use this command to check it: ls -t /CumulusMX/data/*log.txt | head -1 |xargs tail -n1
pete_c wrote: - Refressh ==> Refresh
Fixed
pete_c wrote: - Min/Max Pressure is in % versus in - unless this is the way you want to present it.
----> Percentage makes no sense :-) Fixed
pete_c wrote:- CPU Temperature is 33.6'C instead of 33.6 °C
This is just how Raspbian write it into a system file I am reading.
The Command is:

vcgencmd measure_temp
I am only removing the text in front of the temperature with: vcgencmd measure_temp | cut -d= -f2

but now I changed it to: vcgencmd measure_temp | cut -d= -f2 |cut -c -4 and added °C into my text.
Unfrtunately, this temperature will only be logged in Celsius and not in Fahrenheit. And, wihthout an additional program it's not easy to convert Celsius into Fahrenheit (bc command seem to be needed.

Pete, I say thank you very much again......a fixed Version is again in the first post.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Hello Jan,

Thank you!

Yup; here typically monitor CPU temps in C only.

BTW noticed you have installed CumulusMX on a quad core arm based little computer.

Here while still playing with the RPi's have started to play with a tiny Intel Baytrail computer called the PiPoX7.

It runs Ubuntu 64 bit pretty fast and comes stock with 2Gb of Ram and motherboard includes WLAN, NIC and Bluetooth plus it comes with 32Gb MMC and I have added another 32Gb of OS disk space.
- Pete
Automator
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi script to display weatherstation values via

Post by jank »

Hi Pete

Pipo X7 - Super energy efficient...indeed, I am looking for such a kind of computer to move my Windows 2003 Server which is currently hosting a MailServer to a more efficient device.
This looks promising......but I think, this is too much for a simple Weatherstation Software......a Raspberry Pi / BananaPi is a very good choice for Cumulus MX

Btw: here is a photo of my Bananapi.
Bananapi.jpg
...which is currently my most important Server in my Home Network.....I know, I am crazy to trust such a device and I am not sure, what happens to me, when this device crashes.
It is my: Squid Proxy, Apache Webserver with MYSQL, Owncloud Server, OpenVPN Server, Pyload, Sabnzbd, DNS Server .....and CumulusMX Test Server.......
Maybe, migrating to a device like Pipo X7 is more secure :-)

Jan
You do not have the required permissions to view the files attached to this post.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Very nice!

Here many boxes used to run Wintel Server. Switching mostly to Linux / BSD.

Currently testing the PiPoX7 as a console for automation with connectivity to a multitouch monitor and a Kinect for non touch input. Application running on device connects to the automation mothership running on Ubuntu 14.04.

Well that and now playing with the Amazon Echo stuff.
- Pete
Automator
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Hello Jan,

Wow....you have me looking at the Banana Pi - like that SATA port on it....

Ok tested the script. See you did the calculations on the top to convert termperature..

Here is what I saw the first time I ran the script.

Code: Select all

Linux ICS-Cumulus 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv                                                                              7l
Last login: Tue Jul 28 15:43:38 2015 from 192.168.244.236
Uptime: 5 days 25 minutes
CPU Speed: 900 Mhz - Load Average: 1min 0% 5min 1% 15min 1% - Cores: 4
Free Memory: 881 Mb
Free Disk Space rootfs: 10G
SD Card: Written 5957M Read 0G
Network Traffic eth0: Sent 959.3 MiB Received 195.3 MiB
root@ICS-Cumulus:~# cd /CumulusMX
root@ICS-Cumulus:/CumulusMX# ./cumulusnow.sh
-bash: ./cumulusnow.sh: /bin/bash^M: bad interpreter: No such file or directory
Ok so I edited the top of the script (well I know I should not have) and saw this. (temperature conversion)

Code: Select all

#Version 1.2 - 27.07.2015

# tm=`/opt/vc/bin/vcgencmd measure_temp`
# tc=`echo $tm| cut -d '=' -f2 | sed 's/..$//'`
# tf=$(echo "scale=2;((9/5) * $tc) + 32" |bc)
# echo temp = $tc\°C \($tf\°F\)
# exit

LOOP=5 #Reload time in Minutes
echo ".....please be patient. Collecting some initial information....."

if [ ! -f "/CumulusMX/CumulusMX.exe" ];then
      INSTPATH=$(sudo find / -path "/mnt/*" -prune -o -type d -name "CumulusMX" -print |head -n1) > /dev/null
    else
      INSTPATH="/CumulusMX/"
fi

Code: Select all

root@ICS-Cumulus:/CumulusMX# ./cumulusnow.sh
temp = 34.7°C (94.46°F)
I then edited out the temperature conversion and got the following. (BTW see the percent sign for the Max PRESS.)
You do not have the required permissions to view the files attached to this post.
- Pete
Automator
jank
Posts: 239
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: FineOffset WS3080
Operating System: Debian Buster - Raspbian - Raspb
Location: Germany - nearby Kassel

Re: RaspberryPi script to display weatherstation values via

Post by jank »

pete_c wrote:Hello Jan,
Wow....you have me looking at the Banana Pi - like that SATA port on it....
Yes, thats the reason why I like the old BananaPi more than the new one. On the new BananaPi, they don't have the SATA Port anymore
pete_c wrote: Ok tested the script. See you did the calculations on the top to convert termperature..
Here is what I saw the first time I ran the script.

Code: Select all

root@ICS-Cumulus:/CumulusMX# ./cumulusnow.sh
-bash: ./cumulusnow.sh: /bin/bash^M: bad interpreter: No such file or directory
Ok so I edited the top of the script (well I know I should not have) and saw this. (temperature conversion)

Code: Select all

 tm=`/opt/vc/bin/vcgencmd measure_temp`
 tc=`echo $tm| cut -d '=' -f2 | sed 's/..$//'`
 tf=$(echo "scale=2;((9/5) * $tc) + 32" |bc)
 echo temp = $tc\°C \($tf\°F\)
 exit
Yes, this was my try to convert Celsius to Fahrenheit because the CPU temperature output only available in Celsius on th Raspberry Pi.
But I gave up because an additional command is needed to to a little bit math (bc) and I think the effort is too high, to let the script first install bc before it can be used.
I did something similar on my other Script (CumulusMX start Stop Script) but I think this is okay, because this one is doing a lot of more stuff than this small script.
I forgot to remove the "Temperature Conversion part" from the top of the script. Thanks for testing and letting me know.
pete_c wrote: I then edited out the temperature conversion and got the following. (BTW see the percent sign for the Max PRESS.)
Yes....it was a simple typo in a variable is wrote: %PRESS instead of $PRESS.
Please download the Version 1.3 in the first post one more time and test again.
It should be fixed now :-) and once again, sorry to all downloaders that I need 10 fixes before everyhting is okay :-)
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
pete_c
Posts: 228
Joined: Wed 12 Oct 2011 11:22 pm
Weather Station: Davis Vue-Pro2 - Fine Offset
Operating System: W2003-XPSP3-Linux
Location: Time Traveler

Re: RaspberryPi script to display weatherstation values via

Post by pete_c »

Hello Jan,

All is working well now. Thank-you.
cumulusnow.jpg
You do not have the required permissions to view the files attached to this post.
- Pete
Automator
Post Reply