Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

CumulusMX - RaspberyPi - Start|Stop|Restart Script V2.5.5.0

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
swyman18
Posts: 61
Joined: Fri Apr 24, 2009 5:27 am
Weather Station: Davis Vantage Pro2
Operating System: Ubuntu Server 14.04
Location: Honoka'a, HI

Re: Cumulus MX - Raspberry Pi - Start | Stop | Restart Scri

Post by swyman18 » Fri May 22, 2015 9:30 pm

Yes, good point about the $INSTPATH being included in the path when the exe is called, so I agree I should not need to cd prior to that. It is indeed strange.

I noticed the port 9999 in the script also, I've just removed it myself :)

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: Cumulus MX - Raspberry Pi - Start | Stop | Restart Scri

Post by slashmusic » Fri May 22, 2015 9:50 pm

water01 wrote:Cumulus MX default port is 8998, not 9999, you are forcing that with port command on the command line?
Nono, currently the Port is hardcoded in the script and I have it hardcoded on Port 9999 and currently also with the -s (Status) I give no Information on which port it is running
I want to do the following:
If the script is called without any parameter - the Script should assume to start Cumulus with the default Port, 8998.
If you call with -p9999 Cumuklus will be started on this Port.
Image

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: Cumulus MX - Raspberry Pi - Start | Stop | Restart Scri

Post by slashmusic » Fri May 22, 2015 9:54 pm

swyman18 wrote:Yes, good point about the $INSTPATH being included in the path when the exe is called, so I agree I should not need to cd prior to that. It is indeed strange.

I noticed the port 9999 in the script also, I've just removed it myself :)
Yes, changing the TCP Port by your self by modifying the Script is okay for you, but people with less experience in Linux will not see which Port I am using....so this is a big lack of incformation and I think I should give people the chance to choose the Port.
I should at least print the Port, when displaying the Status Information :-)
Image

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: Cumulus MX - Raspberry Pi - Start | Stop | Restart Scri

Post by slashmusic » Sat May 23, 2015 10:00 pm

Version 1.9 is available.

1.) It will have some cosmetical fixes

2.) On top of the script you can now modify the default TCP Port with an editor (vi or nano)

Code: Select all

#Define Name of  Screen Sessionname - and TCP Port Cumulus should listen. Default TCP Port: 8998
SERVICE='CumulusMX'   # Process Name
PORT=8998                  # TP Port CumulusMX is running
This will give you the possibillity to change the TCP Port to your needs and when called the script without Parameters, it will run Cumulus at this TCP Port.

3.) Added a new Parameter: -p 1-65535 eg: sudo ./cumulusmx.sh -p 12345 will override the TCP Port set in the Script and will start on Port 12345 instead

Available Parameters so far:
-h HELP, This screen
-r Restart CumulusMX
-q Quit CumulusMX
-s CumulusMX Status
-p 1-65535 CumulusMX TCP Port (Range: 1-65535) (Script will not check for nonsense TCP Ports yet - above 65535 or negative values, but the REGEX will come soon)

4.) Detecting IP Address on eth0 and print the IP Adress in the Status Screen and dispalying the complete URL with Port of Cumulus Dashboard (I hope this will work for most Locales)
Image

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Mon May 25, 2015 6:56 pm

Version 2.0 is available.

1.) Within the top of the script you can now modify the CumulusMX installation folder, if other than "CumulusMX" (for example "Weather") with an editor (vi or nano)

Code: Select all

#Define Name of  Screen Sessionname - and TCP Port Cumulus should listen. Default TCP Port: 8998
SERVICE='CumulusMX'   # Process Name
PORT=9999                 # TCP Port CumulusMX is running
IPATH='CumulusMX'      # Please change, if the Name of the Directory is other than CumulusMX (Don't use any / in Path)
2. Fixed a Problem, if Script finds an additional CumulusMX Folder - for example, a BAckup Folder on network Path (this caused CumulusMX to crash)

3. Added new Parameter -d (will resume detached Screen session) - This will switch to the "unscreened session - Can be screened again with CTR-A and D

Available Parameters so far:
-h HELP, This screen
-r Restart CumulusMX
-q Quit CumulusMX
-s CumulusMX Status
-d Resume Screened CumulusMX Session
-p 1-65535 CumulusMX TCP Port (Range: 1-65535) (Script will not check for nonsense TCP Ports yet - above 65535 or negative values, but the REGEX will come soon)
Image

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Fri May 29, 2015 8:44 am

Version 2.0.2 is available.
(to check over the weekend)

New Options
sudo ./cumulusmx.sh -b for backup in combination with Option -z (zip) -t (tar.gz) and -d (dd Backup)
Name of the Backup files are: date_time_CumulusMX.zip

Example:
sudo ./cumulusmx.sh -b -z will create a ZIP Backup
sudo ./cumulusmx.sh -b -t will create a tar.gz Backup
sudo ./cumulusmx.sh -b -d will create a *.img Backup

It will find out if ZIP is installed and offering to install if not.
The Backup destination folder can be defined in the head of the Script
Also the amount of backup files which should be kept in the backup folder can be defined

Code: Select all

BACKUPFOLDER="/Backup_CumulusMX" 
BACKUPTIME=5                     
DDBACKUPFOLDER=""               
DDBACKUPTIME=3                
BACKUPFOLDER for zip and tar.gz backup destination (if not present, will be created by thescript)
BACKUPTIME will define how many Backups will be kept - older files will be deleted
DDBACKUPFOLDER is the external destination where a dd Backup will be stored (Image Files which can be created directly on a new SD Card in case the SD Card is damaged - use Win32 Disk Imager)
DDBACKUPTIME amount of dd backups kept at this external destination (older files will be deleted)

See a list of available options by typing sudo ./cumulusmx.sh -h
CumulusMX_Backup.jpg
...more to come
You do not have the required permissions to view the files attached to this post.
Image

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Tue Jun 02, 2015 10:23 am

Version 2.0.6 is available.

New Option: -u (Update
Usage: sudo ./cumulusmx.sh -u
You will be asked for the path CumulusMXDist3xxx.zip update zip file, and the script will uipdate your CumuluxMX installation.
You will be able to exclude directories fomr the ZIP to be extract, for example if you aresuing your own web templates, you can explude the /web folder to be extracted to not overwrite you own web template files.

Example:

Code: Select all

 sudo ./cumulusmx.sh -u
Enter path and filename of the Cumulus Update file - use tab for completion: /home/pi/CumulusMXDist3025.zip

I found this file: /home/pi/CumulusMXDist3025.zip - Size: 6327770 Bytes

Do you want to stop CumulusMX and extract /home/pi/CumulusMXDist3025.zip into /CumulusMX/ ? [Y/n]y
Any folder in the Update Archive file which should not be extracted to /CumulusMX/? Insert name of the folder (example: web ): web

Folder <web> in the zip  will not be extracted to /CumulusMX/

Beginning with Update  - File: /home/pi/CumulusMXDist3025.zip will be extracted to /CumulusMX/
Press any key to continue... or CTRL+C to quit
CumulusMX is being stopped - extracting Update File now

Archive:  /tmp/cumulusmx_update.zip
replace /CumulusMX/acknowledgements.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: /CumulusMX/acknowledgements.txt
  inflating: /CumulusMX/Alchemy.dll

Update successfully installed, do you want to start CumulusMX again ? [Y/n]y
Starte Cumnulus
CumulusMX is not running...trying to  start CumulusMX now

<<<<<<<<< Cumulus Status >>>>>>>>
Starting CumulusMX now
CumulusMX is listening on TCP Port: 8998 (http://192.168.193.6:8998)
ProcessID (PID) of CumulusMX is 1640
System Uptime of HOSTNAME is: 28 days, 17 hours, 33 minutes.
Path to CumulusMX is /CumulusMX

Image

Ross
Posts: 6
Joined: Mon Jun 13, 2011 7:50 pm
Weather Station: VP2
Operating System: Windows 8.1, Raspbian
Location: Near Halifax, Canada

Re: Cumulus MX - Raspberry Pi - Start | Stop Script

Post by Ross » Wed Jun 03, 2015 8:33 pm

swyman18 wrote: I have CumulusMX installed in /home/CumulusMX, and I put the cumulusmx.sh file in the same directory and made it executable. When I try to execute it using sudo ./cumulusmx.sh or sudo /home/CumulusMX/cumulusmx.sh I get the following:

sudo: unable to execute ./cumulusmx.sh: No such file or directory
or
sudo: unable to execute /home/CumulusMX/cumulusmx.sh: No such file or directory
I just downloaded and installed cumulusmx_2.0.6 with the same results as quoted. CumulusMX.exe runs OK when I initiate it. I have made cumulusmx.sh executable (chmod). It is located in the /home/CumulusMX directory.

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Thu Jun 04, 2015 6:55 am

Hi Ross
Yes, it Looks like it happened again.
In this Script there are accidently CRLF instead of LF. See Post 9 on page 1.
I checked the Script before Upload,but I did not found it.
Unfortunately my raspberry pi, or Debian don't care about these CRLF .
I will Upload a new fixed version soon.

EDIT: I found 2 of them and removed these obsolete CRLF. Unfortunately, my Debian Wheezy seem to ignore them and don't care about it.

I have some other Linux Boxes, but unfortunately also these OS don't care....I will check how Suse Enterprise 11 will behave when these sings are in the script.
OKay, however, Version 2.0.7 is online and it should do it.
Image

Ross
Posts: 6
Joined: Mon Jun 13, 2011 7:50 pm
Weather Station: VP2
Operating System: Windows 8.1, Raspbian
Location: Near Halifax, Canada

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by Ross » Thu Jun 04, 2015 12:00 pm

slashmusic wrote: OKay, however, Version 2.0.7 is online and it should do it.
It's working OK now. Thanks

slashmusic
Posts: 219
Joined: Sun Jan 10, 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Thu Jun 04, 2015 12:14 pm

Ross wrote:
slashmusic wrote: OKay, however, Version 2.0.7 is online and it should do it.
It's working OK now. Thanks
Thanks. Please let me know, if anything is missing or not working
Image

aurion45
Posts: 32
Joined: Sun Jan 22, 2012 5:30 am
Weather Station: WH3081
Operating System: Windows 8.1, Raspbian
Location: Australia
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by aurion45 » Fri Jun 05, 2015 12:49 am

I've sudo chmod +x sudo /home/pi/CumulusMX/cumulusmx.sh
chmod: cannot access `sudo': No such file or directory

I've No idea what going on?

Then try:
sudo /home/pi/CumulusMX/cumulusmx.sh -u
sudo: unable to execute /home/pi/CumulusMX/cumulusmx.sh: No such file or directory

As you can see there a problem.


Anyway my weather station is working correctly.

sudo mono CumulusMX.exe
Current culture: English (United Kingdom)
Serial: 74FECEABEB2DA94ECB5EBA0CD11A7137
Cumulus MX v.3.0.0 build 3025
This is pre-release beta software
Today.ini = data/today.ini
Last update=4/06/2015 4:57:03 PM
Fine Offset station found
Connected to station
Cumulus running at: http://*:8998/
(Replace * with any IP address on this machine, or localhost)
Starting web socket server on port 8002
05/06/2015 00:38:55
Type Ctrl-C to terminate

Ross
Posts: 6
Joined: Mon Jun 13, 2011 7:50 pm
Weather Station: VP2
Operating System: Windows 8.1, Raspbian
Location: Near Halifax, Canada

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by Ross » Fri Jun 05, 2015 1:15 am

aurion45 wrote:I've sudo chmod +x sudo /home/pi/CumulusMX/cumulusmx.sh
chmod: cannot access `sudo': No such file or directory

I've No idea what going on?
I don't know too much about this stuff but I'd say you got one too many 'sudo's. Try:
sudo chmod +x /home/pi/CumulusMX/cumulusmx.sh

aurion45
Posts: 32
Joined: Sun Jan 22, 2012 5:30 am
Weather Station: WH3081
Operating System: Windows 8.1, Raspbian
Location: Australia
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by aurion45 » Fri Jun 05, 2015 2:00 am

Ross wrote:
aurion45 wrote:I've sudo chmod +x sudo /home/pi/CumulusMX/cumulusmx.sh
chmod: cannot access `sudo': No such file or directory

I've No idea what going on?
I don't know too much about this stuff but I'd say you got one too many 'sudo's. Try:
sudo chmod +x /home/pi/CumulusMX/cumulusmx.sh

I see my typo error will try again.
I'm having a poor day. :cry:

Edit:
I just try that and it worked: sudo chmod +x /home/pi/CumulusMX/cumulusmx.sh

aurion45
Posts: 32
Joined: Sun Jan 22, 2012 5:30 am
Weather Station: WH3081
Operating System: Windows 8.1, Raspbian
Location: Australia
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by aurion45 » Fri Jun 05, 2015 5:27 am

So I've chmod +x cumulusmx.sh in last post.
So I try to run the script, I've edit the script to point to IPATH='/home/pi/CumulusMX'

Also ran it from root!
root@raspberrypi:/home/pi/CumulusMX# ./cumulusmx.sh
bash: ./cumulusmx.sh: /bin/bash^M: bad interpreter: No such file or directory

So I try sudo
root@raspberrypi:/home/pi/CumulusMX# sudo ./cumulusmx.sh
sudo: unable to execute ./cumulusmx.sh: No such file or directory

Running 2.07 script?

I've edit crontab -e with the following:
@reboot sudo /home/pi/CumulusMX/cumulusmx.sh >> /dev/null 2>&1

0 6 * * 1 sudo /home/pi/CumulusMX/cumulusmx.sh -b -z >> /dev/null 2>&1

The weather station run perfectly with sudo mono CumulusMX.exe from the CumulusMX folder and nowhere else?

If I try the following this happens:
sudo mono /home/pi/CumulusMX/CumulusMX.exe

Current culture: English (United Kingdom)
Serial: 74FECEABEB2DA94ECB5EBA0CD11A7137
System.IO.DirectoryNotFoundException: Directory 'MXdiags' not found.
at System.IO.Directory.ValidateDirectoryListing (System.String path, System.String searchPattern, System.Boolean& stop) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in <filename unknown>:0
at System.IO.Directory.GetFiles (System.String path) [0x00000] in <filename unknown>:0
at CumulusMX.Cumulus. (System.String ) [0x00000] in <filename unknown>:0
at CumulusMX.Cumulus..ctor (Int32 HTTPport, Int32 WSport) [0x00000] in <filename unknown>:0
at .Main (System.String[] args) [0x00000] in <filename unknown>:0
**** An error has occurred - please zip up the MXdiags folder and post it in the forum ****
Press Enter to terminate

I looking in MXdiags and No files at all.

If I do this it work properly:
pi@raspberrypi ~/CumulusMX $ sudo mono CumulusMX.exe
Current culture: English (United Kingdom)
Serial: 74FECEABEB2DA94ECB5EBA0CD11A7137
Cumulus MX v.3.0.0 build 3025
This is pre-release beta software
Today.ini = data/today.ini
Last update=05/06/2015 15:00:00
Fine Offset station found
Connected to station
Cumulus running at: http://*:8998/
(Replace * with any IP address on this machine, or localhost)
Starting web socket server on port 8002
05/06/2015 15:26:08
Type Ctrl-C to terminate

Post Reply