Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

Installing .net on RPi

From Cumulus MX version 3 build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since, and has recently released Cumulus MX version 4. 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

Nottub
Posts: 202
Joined: Fri 04 Dec 2020 4:35 pm
Weather Station: Davis VP2 (Cabled)
Operating System: RPi 4 (Bookworm)
Contact:

Re: Installing .net on RPi

Post by Nottub »

Nice work Trevor. :clap:

I haven't installed CMX on my RPI yet as I was waiting for the non beta to be released. So as we stand you are a little ahead of me.

As I mentioned I will be running as a service once the full release is available and, running as a service, the same as my existing installation.


Regards

Martyn
Image
User avatar
rogerthn
Posts: 529
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Installing .net on RPi

Post by rogerthn »

flort wrote: Mon 01 Apr 2024 6:13 am So I've got .Net 8 installed and have done a fresh install of CumulusMX. I've run the conversion utility on my data files but what command do I use to run Cumulus interactively? I didn't want to install it as a service until I was sure everything was working fine.

Regards,
Trevor
You could do what I did i.e.
Install as a service but I did not enabled it

Code: Select all

sudo systemctl start cumulusmx.service
To stop it

Code: Select all

sudo systemctl stop cumulusmx.service
Once I whas happy

Code: Select all

sudo systemctl enable cumulusmx.service
and

Code: Select all

sudo systemctl start cumulusmx.service
Image
flort
Posts: 226
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia
Contact:

Re: Installing .net on RPi

Post by flort »

Hi Roger,

Thanks for that. I edited the cumulusmx.service file as I'm still running V3 as a service. Renamed it to cumulusmx-rpi.service and changed the contents as follows -

Code: Select all

[Service]
User=pi
Group=pi
WorkingDirectory=/home/pi/CumulusMX-RPI/CumulusMX.exe
ExecStart=/opt/dotnet/dotnet CumulusMX.dll -service -port 8999
Type=simple
There must be something wrong in there as I copied the file to /etc/systemd/system and ran 'sudo systemctl daemon-reload'. Tried to start it with 'sudo systemctl start cumulusmx-rpi.service' but nothing happens.

Any ideas?

Regards,
Trevor
freddie
Posts: 2505
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: Installing .net on RPi

Post by freddie »

Try this command:

Code: Select all

sudo systemctl status cumulumx-rpi.service
You should see the reason why it failed.
Freddie
Image
flort
Posts: 226
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia
Contact:

Re: Installing .net on RPi

Post by flort »

Thanks Freddie. It says the working directory is not a directory. Also /opt/dotnet/dotnet is not a directory. Gave the following -

Code: Select all

Apr 01 21:07:24 raspberrypi systemd[1]: Started CumulusMX service.
Apr 01 21:07:24 raspberrypi systemd[15002]: cumulusmx-rpi.service: Changing to the requested working directory failed: Not a directory
Apr 01 21:07:24 raspberrypi systemd[15002]: cumulusmx-rpi.service: Failed at step CHDIR spawning /opt/dotnet/dotnet: Not a directory
Apr 01 21:07:24 raspberrypi systemd[1]: cumulusmx-rpi.service: Main process exited, code=exited, status=200/CHDIR
Apr 01 21:07:24 raspberrypi systemd[1]: cumulusmx-rpi.service: Failed with result 'exit-code'.
I don't understand this because my Cumulus installation is definitely located at /home/pi/CumulusMX-RPI. Any more suggestions?

EDIT - I just did a check and there is not dotnet directory under /opt. Should that have been created automatically when .Net 8 was installed?

Regards,
Trevor
freddie
Posts: 2505
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: Installing .net on RPi

Post by freddie »

The service section of my unit file looks like this:

Code: Select all

[Service]
User=root
Group=root
WorkingDirectory=/opt/CumulusMX
ExecStart="/usr/lib/dotnet/dotnet" CumulusMX.dll -service
Type=simple
So it looks like your WorkingDirectory config is wrong. Should be /home/pi/CumulusMX-RPI - you have appended the exe file to it.

If you type

Code: Select all

which dotnet
in your Pi terminal window, it will tell you where dotnet is located.
Freddie
Image
User avatar
mcrossley
Posts: 12905
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Installing .net on RPi

Post by mcrossley »

flort wrote: Mon 01 Apr 2024 11:11 am Thanks Freddie. It says the working directory is not a directory. Also /opt/dotnet/dotnet is not a directory. Gave the following -

Code: Select all

Apr 01 21:07:24 raspberrypi systemd[1]: Started CumulusMX service.
Apr 01 21:07:24 raspberrypi systemd[15002]: cumulusmx-rpi.service: Changing to the requested working directory failed: Not a directory
Apr 01 21:07:24 raspberrypi systemd[15002]: cumulusmx-rpi.service: Failed at step CHDIR spawning /opt/dotnet/dotnet: Not a directory
Apr 01 21:07:24 raspberrypi systemd[1]: cumulusmx-rpi.service: Main process exited, code=exited, status=200/CHDIR
Apr 01 21:07:24 raspberrypi systemd[1]: cumulusmx-rpi.service: Failed with result 'exit-code'.
I don't understand this because my Cumulus installation is definitely located at /home/pi/CumulusMX-RPI. Any more suggestions?

EDIT - I just did a check and there is not dotnet directory under /opt. Should that have been created automatically when .Net 8 was installed?

Regards,
Trevor
How did you create that service file?

CumulusMX v4 can generate a correctly formatted service file for you, for example...

Code: Select all

dotnet CumulusMX.dll -install -port 8999 -user root -group root -servicename cumulusmx-v4
It will detect the CumulusMX location to set the working directory, and also detect the dotnet location.

If you want to run CumulusMX v4 interactively, it is just...

Code: Select all

dotnet CumulusMX.dll [-port <port_num>]
flort
Posts: 226
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia
Contact:

Re: Installing .net on RPi

Post by flort »

Hi Mark,

I used the supplied service file and manually renamed and edited it. I then copied it to /etc/systemd/system and reloaded the service definitions. From your original instructions about running two services I didn't think I could create it automatically without affecting the existing service.

I've now used the automatic generation of the service file and both services are happily running side by side. I also tested running it interactively and that worked fine also. I now have V4 running on both Linux (buster) and Windows 10 without any issues.

Thanks to everyone who helped me sort this out.

Regards,
Trevor
Nottub
Posts: 202
Joined: Fri 04 Dec 2020 4:35 pm
Weather Station: Davis VP2 (Cabled)
Operating System: RPi 4 (Bookworm)
Contact:

Re: Installing .net on RPi

Post by Nottub »

Great work trevor..... :D

As far as the commands I need to run (after running the V3 to V4 data conversion) are:

Note: the original RPi username is 'Pi', the new Rpi is 'Pi2' so the Pi2 in the code below would be just 'pi' for the old RPi!

Code: Select all

sudo dotnet CumulusMX.dll -install -user Pi2
To physically install CumulusMX V4 version, with the copied across files already in place. Presume I don't need to be in the /home/pi/CumulusMX directory to run this install?


Secondly:

Code: Select all

sudo systemctl enable cumulusmx
To run CMX at boot.


One question though. If the CMX is running off an SSD which I can move across to a newer RPi, I presume I need to run the install again on the second RPi to ensure the appropriate files are created on that Rpi?

Many thanks for any feedback.

Martyn
Image
flort
Posts: 226
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia
Contact:

Re: Installing .net on RPi

Post by flort »

Hi Martyn,

I think you will need to be in the /home/pi/CumulusMX directory to run the install otherwise the command won't find the CumulusMX.dll file. You will also need to use the -servicename flag so it knows what to call the service file to be created and the -group flag.

Your command to run CMX at boot is correct.

My Rpi only runs off an SD Card so I've had no experience using it with an SSD. Someone else might be able to give you some guidance as to what you need to do.

Regards,
Trevor
Nottub
Posts: 202
Joined: Fri 04 Dec 2020 4:35 pm
Weather Station: Davis VP2 (Cabled)
Operating System: RPi 4 (Bookworm)
Contact:

Re: Installing .net on RPi

Post by Nottub »

I think you will need to be in the /home/pi/CumulusMX directory to run the install otherwise the command won't find the CumulusMX.dll file. You will also need to use the -servicename flag so it knows what to call the service file to be created and the -group flag.
Just when I thought I had gasped what I needed to do. Changing the directory is ok, I can do that.

What I don’t know is where i get/ or put the -service name flag, nor the group flag. Didn’t see any mention of that!

Oh well back to the drawing board :groan:

Been plucking up the courage to bite the bullet and thought I was mentally prepared. Have to go through the instructions again to work out what I’ve missed.

Thanks
Martyn
Image
freddie
Posts: 2505
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: Installing .net on RPi

Post by freddie »

Nottub wrote: Tue 02 Apr 2024 12:48 pm What I don’t know is where i get/ or put the -service name flag, nor the group flag. Didn’t see any mention of that!
Mark covered that last night in his reply to this topic:
CumulusMX v4 can generate a correctly formatted service file for you, for example...

Code: Select all

dotnet CumulusMX.dll -install -port 8999 -user root -group root -servicename cumulusmx-v4
It will detect the CumulusMX location to set the working directory, and also detect the dotnet location.
Freddie
Image
Nottub
Posts: 202
Joined: Fri 04 Dec 2020 4:35 pm
Weather Station: Davis VP2 (Cabled)
Operating System: RPi 4 (Bookworm)
Contact:

Re: Installing .net on RPi

Post by Nottub »

The original guide from Mark to install as a service reads:

Code: Select all

sudo dotnet CumulusMX.dll -install -user <username> [-group <groupname>] [-port port_num] [-lang <lang-code>]
So in my simple thinking I was leaving off the group name, leaving it to default to Pi2 (the username in my case), also leaving the the port number off so it would use the default 8998, and also leaving the language code off as that too defaults.

I'm then left with:

Code: Select all

sudo dotnet CumulusMX.dll -install -user Pi2

Perhaps I'm over simplifying the installation and that my simple code is not complete? :?

And that I need to use this instead:

Code: Select all

dotnet CumulusMX.dll -install -port 8998 -user pi2 -group Pi2 -servicename cumulusmx-v4
Will the service code not default to cumulusmx if the service name is left blank? I presume adding it gives the CMX-service file a different name i.e. in this case 'cumulus-V4'?

Is this version for those occasions where there are V3 and V4 on the same Rpi, keeping separate CMX-services, for V3 (MONO), and V4 (dotnet).


Forgive my primitive knowledge :mrgreen: but i'm trying to understand the mechanics behind the instructions.

Apologies for what might appear to be a stupid question.

Thanks again for your input.

Martyn
Image
freddie
Posts: 2505
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: Installing .net on RPi

Post by freddie »

If you're not changing the name of the service or the port or the group then you were correct in that you can just use

Code: Select all

sudo dotnet CumulusMX.dll -install -user Pi2
Freddie
Image
Nottub
Posts: 202
Joined: Fri 04 Dec 2020 4:35 pm
Weather Station: Davis VP2 (Cabled)
Operating System: RPi 4 (Bookworm)
Contact:

Re: Installing .net on RPi

Post by Nottub »

Thanks for the sanity check Freddie. :D
Image
Post Reply