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 4021) - 04 May 2024

Legacy Cumulus 1 release 1.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

Linux Launcher

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
Darmain
Posts: 21
Joined: Wed 07 Mar 2012 10:52 pm
Weather Station: Davis VP2
Operating System: Ubuntu server 18.04 on HP DL360
Location: Chippenham, Wilts
Contact:

Linux Launcher

Post by Darmain »

Hi guys,

It's been a while since I've been on here. I have CumulusMX running on Ubuntu 18.04 server, on an enterprise server, and its running sweet.

My reason for posting is for a friend, who is attempting to run cumulusMX on a Ubuntu 18.04 laptop. He has Cumulus running from the terminal no problem, but what he wants is to create a desktop launcher, to open a terminal and run the program. It sounds quite straight forward but he, and I, have been battling with this, on our respective systems for most of the day.

I have a shell script called "starter.sh" with this -
echo cd /home/dave/cumulusMX/
echo mypassword | sudo -S mono CumulusMX.exe
Obviously "starter.sh" has been made executable and it runs fine from the command line.

So then I create "weather station.desktop" in the Desktop folder. This is the code -
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
path = /home/dave/weather-station-test/
Exec=gnome-terminal -- /home/dave/cumulusMX/starter.sh
Name=Weather Station
Comment=Starts the weather station
I made this executable and trustworthy, but this doesn't work. The terminal flashes into view and quits instantly. The reason that it doesn't work is because the terminal is not in the right directory, even though I've specifically instructed it to be.

Does anyone have a solution for this that works? The reason for this is my friend would like to be able to ask his wife to start the weather station if necessary, so this de-skills the process.

Many thanks,

Dave
User avatar
mcrossley
Posts: 12816
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Linux Launcher

Post by mcrossley »

Shouldn't your starter.sh script be...

Code: Select all

#!/bin/bash
cd /home/dave/cumulusMX/
echo mypassword | sudo -S mono CumulusMX.exe
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Linux Launcher

Post by Vegit8 »

Its me who needs spousal support...

added the line as suggested
Now get a terminal window - with the following at the top, not as terminal text, but in some sort of box..
Along with 2 buttons, Preferences and Relaunch
There was an error creating the child process for this terminal
Failed to execute child process “/home/geoff/CumulusMX/starter.sh” (No such file or directory)
User avatar
mcrossley
Posts: 12816
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Linux Launcher

Post by mcrossley »

Ah, I see now you are using gnome-terminal, sorry I don't know anything about that. Why not just run the bash script direct from a shortcut?

Code: Select all

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
path = /home/dave/cumulusMX
Exec=/home/dave/cumulusMX/starter.sh
Name=Weather Station
GenericName=Weather Station
Comment=Starts the weather station
Categories=Application;
Though if you are specifying the path in the shortcut, then you don't need it in the script as well. Your shortcut has the path being set to "/home/dave/weather-station-test/" but the location of Cumulus and the script appears to be "/home/dave/cumulusMX/" ?
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Linux Launcher

Post by Vegit8 »

So....

I modified starter.sh to look like this

Code: Select all

#!/bin/bash
echo <password> | sudo -S mono CumulusMX.exe
I then modified the desktop launcher file to look like this.

Code: Select all

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
path = /home/geoff/CumulusMX
Exec=/home/geoff/CumulusMX/starter.sh
Name=Weather Station
GenericName=Weather Station
Comment=Starts the weather station
Categories=Application;
When double clicking the desktop launcher icon I get.. a popup Window saying
There was an error creating the child process for this terminal
Failed to execute child process “/home/geoff/CumulusMX/starter.sh” (No such file or directory)
.

Which is the same as the previous iteration

However if I open a terminal window from the CumulusMX directory and run the code from the starter.sh file, MX runs with no problem.

I am not even a novice at Linux / Ubuntu (i'm less than that) which is why I initially got assistance from Darmain.
Why is this so difficult?
In the much derided windows world all I would have needed to would be to make a shortcut to the starter file, put it on the desktop. Job done!
No faffing with command line instructions etc...

Any suggestions gratefully recd please.
zoomx
Posts: 65
Joined: Sat 15 Mar 2014 4:50 pm
Weather Station: Froggit GW1000
Operating System: Windows-Linux
Location: Italy

Re: Linux Launcher

Post by zoomx »

Try

Exec=gnome-terminal -e "/home/geoff/CumulusMX/starter.sh"

Got from here
https://askubuntu.com/questions/436891/ ... a-terminal
User avatar
mcrossley
Posts: 12816
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Linux Launcher

Post by mcrossley »

If the above does not work then...

And the starter.sh script is definitely in /home/geoff/CumulusMX - all matching case as well?

And bash is in /bin/bash (not / - btw I *think* it should be "#! /bin/bash" - not sure if that makes any difference?

From the 'tinternet...
imo the simplest answer is -
  1. Check that the .sh file works if clicked or run from its own directory.
  2. If it works there, right-click on it in Files aka Nautilus, select 'Make Link'
  3. This produces a file named 'link to xxxx.sh' in the same directory
  4. Drag this onto the desktop
  5. Rename it how you wish eg clean off 'link to' and 'sh', just leave the name, it will still work.
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Linux Launcher

Post by Vegit8 »

Hi again
I checked the syntax of #!/bin/bash it is now correct

OK... some sort of progress..

My starter script looks like this

Code: Select all

#!/bin/bash
echo <password> | sudo -S mono CumulusMX.exe
If I drop that into a Terminal window cd'd to CumulusMX it runs CumulusMX

If I open a terminal window at the default location, Root?
And add the path into the starter script, I then get a missing file CumulusMX.exe - despite the script changing directory as part of the run.
This is effectively what the desktop script is saying once run

Code: Select all

geoff@Linux:~$ #!/bin/bash
geoff@Linux:~$ echo cd /home/geoff/CumulusMX
cd /home/geoff/CumulusMX
geoff@Linux:~$ echo <password> | sudo -S mono CumulusMX.exe
[sudo] password for geoff: Cannot open assembly 'CumulusMX.exe': No such file or directory.
geoff@Linux:~$
freddie
Posts: 2490
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Linux Launcher

Post by freddie »

Vegit8 wrote: Mon 20 Apr 2020 5:29 pm Hi again
I checked the syntax of #!/bin/bash it is now correct

OK... some sort of progress..

My starter script looks like this

Code: Select all

#!/bin/bash
echo <password> | sudo -S mono CumulusMX.exe
If I drop that into a Terminal window cd'd to CumulusMX it runs CumulusMX

If I open a terminal window at the default location, Root?
And add the path into the starter script, I then get a missing file CumulusMX.exe - despite the script changing directory as part of the run.
This is effectively what the desktop script is saying once run

Code: Select all

geoff@Linux:~$ #!/bin/bash
geoff@Linux:~$ echo cd /home/geoff/CumulusMX
cd /home/geoff/CumulusMX
geoff@Linux:~$ echo <password> | sudo -S mono CumulusMX.exe
[sudo] password for geoff: Cannot open assembly 'CumulusMX.exe': No such file or directory.
geoff@Linux:~$
You need to remove the echo before the cd command. Like this:

Code: Select all

#!/bin/bash
cd /home/geoff/CumulusMX
echo <password> | sudo -S mono CumulusMX.exe
Freddie
Image
Darmain
Posts: 21
Joined: Wed 07 Mar 2012 10:52 pm
Weather Station: Davis VP2
Operating System: Ubuntu server 18.04 on HP DL360
Location: Chippenham, Wilts
Contact:

Re: Linux Launcher

Post by Darmain »

freddie wrote: Mon 20 Apr 2020 6:35 pm You need to remove the echo before the cd command. Like this:

Code: Select all

#!/bin/bash
cd /home/geoff/CumulusMX
echo <password> | sudo -S mono CumulusMX.exe
And that is the solution! Getting too carried away with my "echos" it would appear. Result!!!

Many thanks to everyone who has posted. We have a solution.

:D :D :D :D :D
User avatar
mcrossley
Posts: 12816
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Linux Launcher

Post by mcrossley »

mcrossley wrote: Sun 19 Apr 2020 10:52 pm Shouldn't your starter.sh script be...

Code: Select all

#!/bin/bash
cd /home/dave/cumulusMX/
echo mypassword | sudo -S mono CumulusMX.exe
;)
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Linux Launcher

Post by Vegit8 »

So......
After many attempts to get this working and taking up far too much of my chum Darmain's time, I overcame the problem.

Basically, despite all efforts and lots of terminal command typing the .desktop launcher repeatedly failed with 'file not found'.
Time and time again we checked the pathing and naming and the file was definitely where it was supposed to be.

Now... What dave didnt know, and I didnt tell him because I did'nt think it important was that the .sh file and the .desktop file were both created using notepad++.

For years and years I have been using NP++ on Mac's and PC's to create any sort of file that needed to work in a code environment, for the precise reason that when saving it did not create a file with additional hidden attributes.

Dave showed me how to use nano, yet another interface from the '80's.
Even after editing my originals in nano they still failed to run.

In a fit of pique I recreated both from scratch in nano, did all the other command line stuff and booyah... they worked as intended.

It has taken approximately 20 man hours, not including input from this forum to achieve something that I could do in Windows or a Mac environment in less than 3 minutes.

I am new to Linux, but I have to say it leaves me cold. I have been involved in IT for more than 40 years and I find it amazing that in this day and age there is an OS that is so awkward to achieve anything.

The moral of this tale? - Take nothing for granted, stuff that has worked for years does not necessarily work in Linux.
Post Reply