Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.0.0 build 3050 - 1 May 2019.
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

barriers to not using root for MX?

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.

Moderator: mcrossley

User avatar
GlueGuy2
Posts: 27
Joined: Fri 16 Jan 2015 5:39 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 8.1
Location: US - California

barriers to not using root for MX?

Post by GlueGuy2 » Thu 01 Oct 2015 9:50 pm

We just switched our VP2 weather station monitoring over to MX, and it seems to be working well on a raspberry pi (Model B Revision 2.0).

I created a user "cumulus" to store all the MX files and data (excepting mono). I have not tried running mono/MX as that user, but thought I would canvas the collective on what the barriers are toward running MX as something other than root.

I presume the issues are with mono, and not with MX, but I really have no clue at this point. I do run other types of web server stuff on linux systems, and all of those run the web GUI (apache) as a special user apache.apache. Those all work great, so my assumption is that the issue is not with the web server, but in fact with mono, or something beyond that.

I'm thinking about this, because what I want to do is to make the pi accessible over the internet, and I'm planning on opening up a port to go through our router/firewall.
bp

jank
Posts: 319
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: barriers to not using root for MX?

Post by jank » Fri 02 Oct 2015 3:24 pm

GlueGuy2 wrote: I'm thinking about this, because what I want to do is to make the pi accessible over the internet, and I'm planning on opening up a port to go through our router/firewall.
Open your firewall to access the Raspberry Pi on Port 8998 ?
alternatively you can install a apache Webserver and copy the files locally instead of using the build in FTP.
In this case, you are allowing access to the apache directory and not to the Cumulus Webinterface which is only for the Admin.
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: barriers to not using root for MX?

Post by steve » Sat 10 Oct 2015 10:31 am

I think the issue is with the HttpListener which MX uses for the web interface - this is the issue on Windows, and it can be run in non-admin mode by allowing access to the URL that it listens on. From what I read, on Linux it should only be an issue when trying to listen on port 80, and MX doesn't do that. Have you tried running it as non-root (making sure that all of the files and directories have the necessary permissions for your user)?

Note that if you allow access to the MX user interface over the internet, you will also be allowing access to the configuration interface.
Steve

WetCoast
Posts: 23
Joined: Tue 12 May 2015 6:00 am
Weather Station: WS-2095
Operating System: Vista (Debian Linux)
Location: Surrey, BC, Canada

Re: barriers to not using root for MX?

Post by WetCoast » Sun 11 Oct 2015 8:44 pm

I just tried running CumulusMX.exe as a 'regular' user and it seems to run but says it can't find my weather station.

gord@server:~/Cumulus$ mono CumulusMX.exe -lang en-CA
Current culture: English (Canada)
Serial: CF1E8C14E54505F60AA10CEB8D5D8AB3
Cumulus MX v.3.0.0 build 3031
This is pre-release beta software
Today.ini = data/today.ini
Last update=2015-10-11T12:10:00
Fine Offset station not found
Cumulus running at: http://*:8998/
(Replace * with any IP address on this machine, or localhost)
Starting web socket server on port 8002
2015-10-11 1:38:28 PM
Type Ctrl-C to terminate

I'm not at all sure how it communicates with the weather station (that's connected via USB) perhaps there is something I could do to allow this??

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: barriers to not using root for MX?

Post by steve » Mon 12 Oct 2015 7:19 am

You need to change the permissions on the device so that it can be accessed from non-root. Create a file called 99-hid.rules and put it into /etc/udev/rules.d/

The file should contain the following line:

KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="1941", ATTRS{idProduct}=="8021", MODE="0666"

(The vendor and product IDs shown are correct for Fine Offset stations only).

Then unplug your station, plug it in again, and start MX.
Steve

WetCoast
Posts: 23
Joined: Tue 12 May 2015 6:00 am
Weather Station: WS-2095
Operating System: Vista (Debian Linux)
Location: Surrey, BC, Canada

Re: barriers to not using root for MX?

Post by WetCoast » Mon 12 Oct 2015 8:36 pm

wow Steve, you opened a whole new area for me! I never knew much about udev and now I know just enough to be dangerous. Well not too dangerous because I still don't understand much.

One thing I found when researching this udev stuff was the following:
Files in /etc/udev/rules.d/ are parsed in lexical order, and in some circumstances, the order in which rules are parsed is important. In general, you want your own rules to be parsed before the defaults, so I suggest you create a file at /etc/udev/rules.d/10-local.rules and write all your rules into this file. from (http://www.reactivated.net/writing_udev_rules.html)

I'm not at all sure the implications of timing of when the rules are run or, in our case, if it really makes any difference.
Do you have an opinion?

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: barriers to not using root for MX?

Post by steve » Mon 12 Oct 2015 8:44 pm

Everywhere that I have seen instructions for changing the permissions on HID devices, they have used 99- as the start of the rules file.
Steve

User avatar
mcrossley
Posts: 5581
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: barriers to not using root for MX?

Post by mcrossley » Tue 13 Oct 2015 10:49 am

Makes sense as you want your rules to over-ride the defaults, so they need to be processed last.

WetCoast
Posts: 23
Joined: Tue 12 May 2015 6:00 am
Weather Station: WS-2095
Operating System: Vista (Debian Linux)
Location: Surrey, BC, Canada

Re: barriers to not using root for MX?

Post by WetCoast » Wed 14 Oct 2015 4:51 pm

I agree.
I've added what you suggested and now I can run CumulusMX as a non-root user.

Thanks!

richard_newberry
Posts: 300
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Buster
Location: Leicester
Contact:

Re: barriers to not using root for MX?

Post by richard_newberry » Wed 02 Dec 2015 5:26 pm

I have done what Steve suggested it doesn't work for me. I have rebooted the vmware host and removed the USB and re added it back but still only works with root by doing su within user cumulus.
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: barriers to not using root for MX?

Post by steve » Wed 02 Dec 2015 5:48 pm

More details, please - "doesn't work" is not helpful. What happens when you run it non-root? Are all of your file and directory permissions set correctly for the non-root user that you're using?
Steve

richard_newberry
Posts: 300
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Buster
Location: Leicester
Contact:

Re: barriers to not using root for MX?

Post by richard_newberry » Thu 03 Dec 2015 2:23 pm

Sorry Steve,

I was on about the script called ./cumulusmx.sh only works with root or sudo.

Yes cumulus does work with mono CumulusMX.exe however using a ftp server on my machine. the ftp only accepts root access trying to find a way of using cumulus as a user to only use the ftp server on the machine cumulus is installed on.
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

User avatar
mcrossley
Posts: 5581
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: barriers to not using root for MX?

Post by mcrossley » Thu 03 Dec 2015 2:32 pm

Why would you FTP to same machine, a simple copy would be more reliable and efficient?

richard_newberry
Posts: 300
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Buster
Location: Leicester
Contact:

Re: barriers to not using root for MX?

Post by richard_newberry » Fri 04 Dec 2015 9:05 am

If i dont use FTP how can i upload updated data which updates every minute to the /var/www without using a FTP client?
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

water01
Posts: 1535
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: barriers to not using root for MX?

Post by water01 » Fri 04 Dec 2015 9:51 am

If it on the same machine just use Cumulus to copy the files to the /var/www directory.

Post Reply