Page 4 of 6

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Fri 17 Mar 2017 11:08 pm
by dazza1223
sorry guys i updated my pi fimware and now the tft lcd ant working now so i can test it

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Sun 19 Mar 2017 11:11 pm
by dazza1223
hi ok i got the lcd to work and no when i run this export TERM=xterm;cd /home/pi/usb/davis;./cumulusnow.sh it ony run in ssh not the lcd

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Mon 20 Mar 2017 5:18 pm
by rogerthn
Please try the command below on the LCD including ssh pi@raspberry.
Replace raspberry with your CumulusMX IP

Code: Select all

ssh pi@raspberry 'export TERM=xterm;cd /home/pi/CumulusMX;./cumulusnow.sh'

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Mon 20 Mar 2017 5:42 pm
by dazza1223
ssh pi@10.0.0.6 'export TERM=xterm;cd /home/pi/CumulusMX;./cumulusnow.sh'


what like this?

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Mon 20 Mar 2017 7:22 pm
by rogerthn
dazza1223 wrote:ssh pi@10.0.0.6 'export TERM=xterm;cd /home/pi/CumulusMX;./cumulusnow.sh'


what like this?
Yes, please try.

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Mon 20 Mar 2017 9:13 pm
by dazza1223
it still ony run oh the ssh not the lcd mate

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Tue 21 Mar 2017 8:41 pm
by rogerthn
Are you running the command on the LCD?

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Tue 21 Mar 2017 9:45 pm
by dazza1223
bingo done it it runing on lcd now so how can i auto srart on the lcd mate

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Wed 22 Mar 2017 7:43 am
by rogerthn
dazza1223 wrote:bingo done it it runing on lcd now so how can i auto srart on the lcd mate
Since I don't know what your setup is like, please Google.
Leaving for 2 weeks on Mauritius shortly :D :D :D

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Wed 22 Mar 2017 9:00 am
by dazza1223
O yh well i did google it but as i said i got it to auto start on the lcd but it start on ssh as well and i dont want that only on lcd ps thank u

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Fri 10 May 2019 11:47 pm
by SunDial
Hi,

Apologies, I posted the following message on the Cumulus restart script post but here looks more appropriate.

I am trying to set up the cumulusmx.sh script,Init.d system start-up script and CumulusNow. So far I've got cumulusmx.sh running and my init.d startup done, but I'm struggling a bit with the last item. Helpfully, as there doesn't appear to be advice on setting up CumulusNow that I could find, cumulusmx.sh advised me that I did not have CumulusNow installed and suggested running cumulusmx.sh -n to automatically download and set it up, which I did. The following is the screen output after running cumulusmx.sh again, as the script advises once it's installed and set up.

.....please be patient. Collecting some initial information.....
find: ‘/run/user/1000/gvfs’: Permission denied

CumulusMX configuration file /usr/local/bin/CumulusMX/web/graphconfig.json is missing but it is located in /usr/local/bin/CumulusMX/graphconfig.json
Newser versions of CumulusMX having this file in the web subfolder. Please copy the file manually into this folder

sudo cp /usr/local/bin/CumulusMX/graphconfig.json /usr/local/bin/CumulusMX/web/graphconfig.json

Quit
sa@orangepilite:/usr/local/bin/CumulusMX$

If I then run "sudo cp /usr/local/bin/CumulusMX/graphconfig.json /usr/local/bin/CumulusMX/web/graphconfig.json" it tells me the file doesn't exist in the parent directory, which I can confirm it doesn't. So at this point I'm looking for this missing file. :? Presumably the script creates this file as it's not in the CumulusNow.zip so I'm wondering if there might be an access failure here.

Any suggestions?
Thanks

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Sat 11 May 2019 12:45 pm
by jank
Hello Sundial

indeed, this script is getting some information/values from the file: graphconfig.json
Normally, this file is located in: /web/graphconfig.json subfolder of CumulusMX.
Based on the output of the error message, I assume, your CumulusMX installation is located in this folder: /usr/local/bin/CumulusMX/ or am I wrong

You wrote:
If I then run "sudo cp /usr/local/bin/CumulusMX/graphconfig.json /usr/local/bin/CumulusMX/web/graphconfig.json" it tells me the file doesn't exist in the parent directory, which I can confirm it doesn't. So at this point I'm looking for this missing file. :? Presumably the script creates this file as it's not in the CumulusNow.zip so I'm wondering if there might be an access failure here.
The graphconfig.json file is not being created by the Cumulusmx Script, it is part of the CumulusMX installation.....and if it is NOT in the ZIP File, I assume, it is being vreated when CumulusMX is starting.
This file contains some unit information I need to display is in cumulusnow.sh.....so please try to find out, where this file is located.
So please run the following command to locate this file on your orangepilite: sudo find / -name graphconfig.json

once you found it, please copy it to /usr/local/bin/CumulusMX/web/graphconfig.json
If you can not find it anyway on your system.....as I already mentioned it only contains some shema information and it lookl like this ....at least on my system:

{"temp":{"units":"C","decimals":1},"wind":{"units":"km/h","decimals":0},"rain":{"units":"mm","decimals":1},"press":{"units":"hPa","decimals":1},"hum":{"decimals":0},"uv":{"decimals":1}}
If these values are correct for your country (metric values) just copy and paste the above green code and create the file on your installation......
please let me know if this works for you....
Jan

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Sun 12 May 2019 12:16 am
by SunDial
Hi Jan,

Thank you for replying to my message. I like your helpful scripts - thank you. :)

Yes, my CumulusMX folder is under /usr/local/bin/ as you say. I was advised by an Armbian adviser that this location was the most appropriate location for binary archive software. I edited the file location in your scripts to the same location and it seems to be okay albeit with perhaps some permission denied messages that I am not sure of the cause of. Do you envisage problems with this location? Is there any chance of having the location set as the variable $INSTPATH at the top of the CumulusNow script to make it easier to change rather than editing the if/then statement as I think this is better practice and less likely to introduce errors? Just my initial thought.

I am wondering now though if the .json file might be missing as I had my WMR928N disconnected at the time I was setting up the three scripts (perhaps CumulusMX needs the connection for the file to be created?) I couldn't have it connected at the time as it was impossible to have the two together while I set up the scripts. In any event, I will try the cumulusnow.sh script with the WMR928N connected to see if it resolves this issue.

BTW, there is a bug at line 314 of the cumulusmx.sh (case 2) - the shutdown command is misspelled "shuttdown -h" so the shutdown case fails to execute.

Thanks again for your helpful scripts. :)

Adam

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Sun 12 May 2019 10:11 am
by jank
Hello Adam
SunDial wrote: Sun 12 May 2019 12:16 am it seems to be okay albeit with perhaps some permission denied messages that I am not sure of the cause of.
I assume, you are running the Scripts without sudo ? in this case, my script is searching in some directories where a non root user account does not have permissions....but this is okay...
Do you envisage problems with this location? Is there any chance of having the location set as the variable $INSTPATH at the top of the CumulusNow script to make it easier to change rather than editing the if/then statement as I think this is better practice and less likely to introduce errors? Just my initial thought.
No it is absolutely no problem where you install both scripts......
And regarding the $INSTPATH you are right, at thetop of the script, there are 2 options:
Cumulusmx.exe is either in /home/pi/CumulusMX/ or my script is searching the complete filesystem to find this file
---> INSTPATH=$(sudo find / -type d -name "CumulusMX" -print |head -n1) > /dev/null <----- to finally set the variable $INSTPATH
This can take a long time, if there is a large SD Card or Large Harddisk installed.......
So finally, YES, you can set the variable INSTPATH by yourself and everything will be a little bit faster when starting.
Modify the the script at the top like this:

#if [ ! -f "/home/pi/CumulusMX/CumulusMX.exe" ];then
# INSTPATH=$(sudo find / -type d -name "CumulusMX" -print |head -n1) > /dev/null
# else
# INSTPATH="/home/pi/CumulusMX/"
#fi
INSTPATH="/usr/local/bin/CumulusMX/"

The line in red is the new line....the others can be deleted or qouted with #
I am wondering now though if the .json file might be missing as I had my WMR928N disconnected at the time I was setting up the three scripts (perhaps CumulusMX needs the connection for the file to be created?) I couldn't have it connected at the time as it was impossible to have the two together while I set up the scripts. In any event, I will try the cumulusnow.sh script with the WMR928N connected to see if it resolves this issue.
You are absolutely right, the graphconfig.json is NOT in the original cumulusmx.zip file and to be honest, I don't know where it comes from or if this file is being created by CumulusMX while a stationis connected.....maybe someone else can shade a light on this ?
But anyway, the only reason why I need this file is, I am getting the units from it.....unfortunately I did not find any other file which contains information about the local units used in users country like: °C or °F or km/h or Miles/h .....so I would suggest the following
Here is my graphconfig.json attached at this post, please feel free and copy it to your /web folder and you are done......maybe you need to modify some units to fit to your country.....
graphconfig.zip
BTW, there is a bug at line 314 of the cumulusmx.sh (case 2) - the shutdown command is misspelled "shuttdown -h" so the shutdown case fails to execute.
Thank you very much, you are right there is a typo.........
So next time, when I update this script the bug fill be fixed......

cheers Jan

Re: RaspberryPi script to display weatherstation values via ssh - Version 1.7

Posted: Sun 12 May 2019 11:16 am
by freddie
jank wrote: Sun 12 May 2019 10:11 am Hello Adam
SunDial wrote: I am wondering now though if the .json file might be missing as I had my WMR928N disconnected at the time I was setting up the three scripts (perhaps CumulusMX needs the connection for the file to be created?) I couldn't have it connected at the time as it was impossible to have the two together while I set up the scripts. In any event, I will try the cumulusnow.sh script with the WMR928N connected to see if it resolves this issue.
You are absolutely right, the graphconfig.json is NOT in the original cumulusmx.zip file and to be honest, I don't know where it comes from or if this file is being created by CumulusMX while a stationis connected.....maybe someone else can shade a light on this ?
But anyway, the only reason why I need this file is, I am getting the units from it.....unfortunately I did not find any other file which contains information about the local units used in users country like: °C or °F or km/h or Miles/h
graphconfig.json is very likely to be generated when you first run Cumulus and select the units that you wish to use.