Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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: CumulusMX init.d System Startup Script

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

Post Reply
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: CumulusMX init.d System Startup Script

Post by jank »

Hello John

since you only can send me the SD Card, it is necesarry tocopy the CumulusMX folder onto the SDCard first.
Please read my Last mail how you can do it.
Instead of copying it to /tmp/CumulusMX you can copy it directly into the root of th SD Card or into /home/pi/CumulusMX
Once this is done, please change the password of the user pi.
passwd will ask for the current password and 2 times for a new one. (Don't forget to change the password back later, when the image is being created.

Now it is time to create a DD Image which is possible, since you connected an external drive.
While this is done, you don't need to stop your current CumusluMX weather software.
How to create a DD Image:
Option 1: Not sure, if you configred the path for diskimages in the cumulusmxsh.conf file ? Search
DDBACKUPFOLDER="/mnt/SSD/CumulusMX_Backup"
(Create hits folder first: mkdir /mnt/SSD/CumulusMX_Backup)
Now use the commandline option of cumulusmx.sh: sudo /mnt/SSD/CumulusMX/cumulusmx.sh -b -d

Option2: Use the commandline option:
sudo mkdir /mnt/SSD/CumulusMX_Backup
sudo dd if=/dev/mmcblk0 of=/mnt/SSD/CumulusMX_Backup/raspberry_pi4gb.img bs=1MB

the system will not be stopped, while this command run. If you are interested, you can login on a second terminal and look, while the image file growth -> watch -n 1 'ls -al /mnt/SSD/CumulusMX_Backup/'

Once this is done, the file raspberry_pi4gb.img shuold be created and ready for upload.

Now I have no idea so far, where and how we can share it (Hopefully also your upload speed is 40 MB/s. Mine is just 6 but the download speed is 120Mbit/s which is okay.
If you have no Idea where to upload, I will create an account on my fileshare server and send it via PM

Please don't forget to change you pi password back, after the image was created.
Jan
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
jpsc
Posts: 179
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Bullseye
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jpsc »

Sorry about the length of time this has taken, I've been away and the Pi stayed up all the time
jank wrote: sudo cp -rp /mnt/SSD/CumulusMX/ /tmp/CumulusMX
This will make a copy of the complete CumulusMX folder from your external device to the SD Card
Now please change the path information in file /etc/init.d/cumulusmx

CumulusMX_HOME=/CumulusMX
I think, no other file need to be changed.
Disconnect the Externla drive with the original CumulusMX folder (Because my cumulusmx scirpt will search for folders with name CumulusMX and I have no idea which one will be found first /tmp or external drive)

Once this is done, please try again if this change is able to boot.
It did boot (had to change to home from tmp because that does not survive a boot, and renamed the CumulusMX directory since I can't unplug the SSD...).

Don't know what it proves though.

Next thing I'll do is send you the dd
John Cooper

Cumulus 3 on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image
User avatar
jpsc
Posts: 179
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Bullseye
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jpsc »

jank wrote:Now it is time to create a DD Image which is possible, since you connected an external drive.
While this is done, you don't need to stop your current CumusluMX weather software.
How to create a DD Image:

Option2: Use the commandline option:
sudo mkdir /mnt/SSD/CumulusMX_Backup
sudo dd if=/dev/mmcblk0 of=/mnt/SSD/CumulusMX_Backup/raspberry_pi4gb.img bs=1MB

Code: Select all

3997+1 records in
3997+1 records out
3997171712 bytes (4.0 GB) copied, 300.481 s, 13.3 MB/s
Here it is https://drive.google.com/file/d/0B-2L2a ... sp=sharing

The CumulusMX directory is in /home/pi/CumulusMX you can see the successful start at boot of it there.

The password is raspberry
John Cooper

Cumulus 3 on RPi3 with SSD

http://weather.mountpleasanthouse.uk

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: CumulusMX init.d System Startup Script

Post by jank »

jpsc wrote:Sorry about the length of time this has taken, I've been away and the Pi stayed up all the time
It did boot (had to change to home from tmp because that does not survive a boot, and renamed the CumulusMX directory since I can't unplug the SSD...).
Don't know what it proves though.
Next thing I'll do is send you the dd
I need to double check it: Once you copied CumulusMX folder fomr the SSD to the SD card, the init.d Script worked and CumulusMX is being started ?
Please answer because this is important. In this case, I should plug a USB Stick to my Raspberry to reproduce the problem.
Btw: Ihave successfully downloaded the DD IMage, not sure if it isn't better to remove the Image again or delete you post with the download link and password :-)
I will check it as soon as possible when I have time (I am close to my vacation)
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
jpsc
Posts: 179
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Bullseye
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jpsc »

jank wrote:I need to double check it: Once you copied CumulusMX folder fomr the SSD to the SD card, the init.d Script worked and CumulusMX is being started ?
Please answer because this is important. In this case, I should plug a USB Stick to my Raspberry to reproduce the problem.
Yes, the 4GB does successfully run the script at boot time when it is on the SD card, but not when it is on the SSD, no other changes.
jank wrote: Btw: Ihave successfully downloaded the DD IMage, not sure if it isn't better to remove the Image again or delete you post with the download link and password :-)
There is nothing else on there except the weather station, so no worries, but I'll delete it now
jank wrote: I will check it as soon as possible when I have time (I am close to my vacation)
Have a good holiday, I hope the weather is kind to you.
John Cooper

Cumulus 3 on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image
User avatar
jpsc
Posts: 179
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Bullseye
Location: Wye valley, Herefordshire, UK
Contact:

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by jpsc »

jank wrote:I need to double check it: Once you copied CumulusMX folder fomr the SSD to the SD card, the init.d Script worked and CumulusMX is being started ?
Please answer because this is important. In this case, I should plug a USB Stick to my Raspberry to reproduce the problem.
Yes, the 4GB does successfully run the script at boot time when it is on the SD card, but not when it is on the SSD, no other changes.
jank wrote: Btw: Ihave successfully downloaded the DD IMage, not sure if it isn't better to remove the Image again or delete you post with the download link and password :-)
There is nothing else on there except the weather station, so no worries, but I'll delete it now
jank wrote: I will check it as soon as possible when I have time (I am close to my vacation)
Have a good holiday, I hope the weather is kind to you.
John Cooper

Cumulus 3 on RPi3 with SSD

http://weather.mountpleasanthouse.uk

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: CumulusMX init.d System Startup Script

Post by jank »

jpsc wrote:Have a good holiday, I hope the weather is kind to you.
well, lets say the weather in germany will get worse next week but I am going to north east Italy....what should I say...I am expecting hot temperatures.......but maybe I find the time to check your image before I leave.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

jank

Thank you for for the very useful scripts. I installed them tonight and I can auto-start CumulusMX on a reboot and use all the other commends in the start stop file. I had tried crontab before without success. Now I can go through a power failure and come back on line.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
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: CumulusMX init.d System Startup Script

Post by jank »

VTHokie74 wrote:jank

Thank you for for the very useful scripts. I installed them tonight and I can auto-start CumulusMX on a reboot and use all the other commends in the start stop file. I had tried crontab before without success. Now I can go through a power failure and come back on line.
Hello, Thank you very much for this update. Question: you are running cumulusmx from the SD Card and not from an external USB Device?
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

jank wrote: Hello, Thank you very much for this update. Question: you are running cumulusmx from the SD Card and not from an external USB Device?
I am running it on an SD card.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

I ran into an issue today. I mounted a Windows network share to use instead of the default back folder in CumulusMX.sh. The new backup folder is /home/pi/WiindowsShare/Backup (Not the actual name but you get the picture). Then I edited /etc/fstab to add a line to mount the drive at bootup. After doing this the drive was mounting manually OK but not on a reboot. I found a few mentions of this problem but the easy solution was to change the raspi-config settings to wait on network to boot. Apparently, if OS tries to mount the drive before the network is running it doesn't mount. This worked and my Windows share drive was there.

Then I edited the cumulusmxsh.conf file to put in the new backup path. After saving I rebooted and CumulusMX would not start. I checked the log file and it appeared the script was telling CumulusMX to quit. It would start fine with the -r parameter on the script. I looked at several things and finally I changed the user in the /etc/init.d/cumulusmx back to root from pi. This worked and CumulusMX started on reboot.

Any idea why this change was required?
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
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: CumulusMX init.d System Startup Script

Post by jank »

VTHokie74 wrote:Apparently, if OS tries to mount the drive before the network is running it doesn't mount. This worked and my Windows share drive was there.
Yes, I remember, this was an issue and it was fixed some month ago from in the OS
VTHokie74 wrote:Then I edited the cumulusmxsh.conf file to put in the new backup path. After saving I rebooted and CumulusMX would not start. I checked the log file and it appeared the script was telling CumulusMX to quit.
No this quit signal cam not form the boot. All statscripts in /etc/init.d can be executed in so called "runlevels". Runlevel 0 - 6
Most of these Scripts will also executed when runlevel 0 is reached and the program will be stopped. So it will be executed runlevel 3,5,6 and 0
This is, where the Quit in the logfile comes form. [/quote]
VTHokie74 wrote: It would start fine with the -r parameter on the script. I looked at several things and finally I changed the user in the /etc/init.d/cumulusmx back to root from pi. This worked and CumulusMX started on reboot. Any idea why this change was required?
The cumulusmx.sh is checking if the owner of ALL files in the CumulusMX folder belong to the same user.
When you usually start Cumulusmx with sudo (root) some files will have the owner root. this is not a problem. But when you switch back to user pi, it will not have access to the files created by sudo (root) therefor, I am checking this and in case, there are different file owners cumulusmx.sh will not start.
But this should be prompted on the command line and also a solution, how to check which file belongs to a different user

You can check with this command, the other user will be shown at the end: sudo find /CumulusMX -type f -printf '%u %p\n' |sort |more
You can change the owner of all files in your folder by using this command: sudo chown -R pi:pi /CumulusMX
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

Thanks for the reply jank. I think the "quit" was coming because of the reboot command during shutdown which is what I think you were explaining. It was followed in a few seconds by an entry that Cumulus was trying to start. I think you are correct that it might have been a permissions issue. I was using sudo for all the edit commands. As long as there is nothing wrong with running as root CumulusMX I will leave it.
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
User avatar
VTHokie74
Posts: 113
Joined: Tue 10 Apr 2012 12:58 am
Weather Station: Davis Vantage Pro 2
Operating System: Rasbian
Location: Ashland, KY

Re: RaspberryPi: CumulusMX init.d System Startup Script

Post by VTHokie74 »

OK, here are some log files. First a reboot with user=root in the init.d file
pi@raspberrypi:~/CumulusMX $ tail cumulusmxsh.log
2016-07-10 14:26:58 - System - CumulusMX is successfully being started
2016-07-10 14:28:26 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 14:28:29 - CumulusMX Script is being called with -s (Status)
2016-07-10 15:48:32 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:48:39 - System - CumulusMX is being Stopped with -q
2016-07-10 15:48:52 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:48:56 - CumulusMX trying to start with these parameters /home/pi/CumulusMX/CumulusMX.exe -port 8998
2016-07-10 15:49:41 - System - CumulusMX is successfully being started
2016-07-10 15:51:17 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:51:20 - CumulusMX Script is being called with -s (Status)
pi@raspberrypi:~/CumulusMX $
I changed the user back to PI and it would not start
pi@raspberrypi:~/CumulusMX $ tail cumulusmxsh.log
2016-07-10 15:48:39 - System - CumulusMX is being Stopped with -q
2016-07-10 15:48:52 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:48:56 - CumulusMX trying to start with these parameters /home/pi/CumulusMX/CumulusMX.exe -port 8998
2016-07-10 15:49:41 - System - CumulusMX is successfully being started
2016-07-10 15:51:17 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:51:20 - CumulusMX Script is being called with -s (Status)
2016-07-10 15:56:28 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:56:31 - CumulusMX Script is being called with -s (Status)
2016-07-10 15:56:43 - CumulusMX 2.5.2.0 (2016-05-02) Script is being called with some Parameter
2016-07-10 15:56:50 - System - CumulusMX is being Stopped with –q
This is the listing of the CumulusMX directory with ls -l:
pi@raspberrypi:~/CumulusMX $ ls -l
total 6584
-rw-r--r-- 1 pi pi 35328 Jun 29 2014 Alchemy.dll
-rw-r--r-- 1 root root 16077 Jul 10 15:56 Cumulus.ini
-rw-r--r-- 1 pi pi 560 Mar 30 2015 CumulusMX Licence.txt
-rw-r--r-- 1 pi pi 760320 Mar 13 15:23 CumulusMX.exe
-rw-r--r-- 1 pi pi 553 Dec 29 2014 CumulusMX.exe.config
-rw-r--r-- 1 pi pi 1347072 Mar 13 15:23 CumulusMX.pdb
-rwxr-xr-- 1 pi pi 20973 Jul 8 22:11 CumulusMX_2.5.2.0.zip
-rw-r--r-- 1 pi pi 531456 Apr 8 2015 Devart.Data.MySql.dll
-rw-r--r-- 1 pi pi 274432 Apr 8 2015 Devart.Data.dll
-rw-r--r-- 1 pi pi 15360 May 21 2015 ExportMySQL.exe
-rw-r--r-- 1 pi pi 187 Apr 27 2015 ExportMySQL.exe.config
-rw-r--r-- 1 pi pi 92672 Dec 16 2015 HidSharp.dll
-rw-r--r-- 1 pi pi 14336 Dec 28 2014 LinqToTwitter.AspNet.dll
-rw-r--r-- 1 pi pi 479232 Dec 28 2014 LinqToTwitterPcl.dll
drwxr-xr-x 2 pi pi 4096 Jul 10 16:00 MXdiags
-rw-r--r-- 1 pi pi 520192 Oct 26 2015 Newtonsoft.Json.dll
drwxr-xr-x 2 pi pi 4096 Dec 30 2014 Reports
-rw-r--r-- 1 pi pi 81408 Nov 14 2014 System.Net.FtpClient.dll
-rw-r--r-- 1 pi pi 22224 Nov 14 2014 System.Net.Http.Extensions.dll
-rw-r--r-- 1 pi pi 21720 Nov 14 2014 System.Net.Http.Primitives.dll
-rw-r--r-- 1 pi pi 255656 Dec 24 2014 System.Net.Http.dll
-rw-r--r-- 1 pi pi 114896 Nov 14 2014 System.Reactive.Core.dll
-rw-r--r-- 1 pi pi 24272 Nov 14 2014 System.Reactive.Interfaces.dll
-rw-r--r-- 1 pi pi 708816 Nov 14 2014 System.Reactive.Linq.dll
-rw-r--r-- 1 pi pi 38600 Nov 14 2014 System.Reactive.PlatformServices.dll
-rw-r--r-- 1 pi pi 81408 Oct 26 2015 Unosquare.Labs.EmbedIO.dll
-rw-r--r-- 1 pi pi 634 Mar 3 2015 acknowledgements.txt
drwxr-xr-x 13 pi pi 4096 Jul 10 16:00 backup
-rwxr-xr-x 1 root root 67693 May 3 14:30 cumulusmx.sh
-rw-r--r-- 1 root root 2981 Jul 10 13:30 cumulusmxsh.conf
-rw-r--r-- 1 root root 3479 Jul 10 16:02 cumulusmxsh.log
drwxr-xr-x 3 pi pi 4096 Jul 7 15:32 data
-rw-r--r-- 1 pi pi 37376 May 22 2015 fastJSON.dll
-rw-r--r-- 1 root root 106017 Jul 8 08:14 ftplog.txt
drwxr-xr-x 8 pi pi 4096 Nov 1 2015 interface
-rw-r--r-- 1 pi pi 299520 Jul 29 2014 log4net.dll
-rw-r--r-- 1 root root 6053 Apr 10 13:35 readme.txt
-rw-r--r-- 1 root root 270 Jul 10 15:56 realtime.txt
-rw-r--r-- 1 pi pi 6259 Jan 13 17:04 samplestrings.ini
-rw-r--r-- 1 root root 32 Jul 10 16:00 serial.txt
-rw-r--r-- 1 pi pi 645592 Apr 3 2014 sqlite3.dll
drwxr-xr-x 2 pi pi 4096 Jul 8 07:52 web
drwxr-xr-x 5 pi pi 4096 Mar 4 2015 webfiles
-rw-r--r-- 1 root root 55 Jul 10 16:03 wxnow.tx
Station: Davis Vantage Pro 2/CumulusMX/Raspberry Pi 3
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: CumulusMX init.d System Startup Script

Post by jank »

Hi
...als I already mentioned. Some files are owned by User Pi and others by Root.(based on your last Screenshot)
-rw-r--r-- 1 root root 3479 Jul 10 16:02 cumulusmxsh.log
As you can See,file permissions for the cumulusmxsh.log are
Owner: root
Root is allowed to Read Write
All others only Read.
Pi is not allowed to Write into this file

Root will not have problems but Pi can not access root's files for writing.
If you want to use Pi from now on, use this command
sudo chown -R pi:pi /home/pi/CumulusMX
This will change the user and group owner to pi.
Do want a Managing Dashboard for CumulusMX on RaspberryPi? cumulusmx.sh
viewtopic.php?f=40&t=17907
Image
Post Reply