Page 1 of 1
WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 7:07 am
by throwaway123
I have setup latest CumulusMX on my PC running Linux Mint. However, no reading is happening and when I open terminal it periodically repeats:
Code: Select all
Looking for Fine Offset station
Fine Offset station found
How can I solve this? Thank you in advance!
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 1:10 pm
by mcrossley
Switch on debug logging in Cumulus and then post the latest MXdiags log file, ta.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 3:54 pm
by throwaway123
Here is the file. Just to add more details: I already tried restarting Cumulus, the PC, the station, tried disconnecting and connecting again. Also the user is added to the dialout group in order to have permission to use USB.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 4:03 pm
by mcrossley
There is no debug logging in that file?
But is does show that CMX is not able to open the file stream to the USB device.
Have you tried running CMX with sudo to minimise any permissions issues?
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 4:59 pm
by throwaway123
Well, I do not know what the debug info should look like. Anyway, I launched it with the -debug option like so:
Code: Select all
mono ./CumulusMX/CumulusMX.exe -debug
I also tried it with sudo, and it works.
Is there a list of possible permission requirements other than the mentioned dialout group?
Or more generally: how to make it run without sudo?
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 5:02 pm
by mcrossley
I'm not really the man for this - maybe @freddie?
But a quick search shows pages like -
https://ramonh.dev/2020/09/22/usb-device-linux-startup/
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 6:21 pm
by freddie
If you follow all the steps in the link @mcrossley provided (changing the references to suit your specific device) then you will be able to run unprivileged. However it is much easier just to run privileged - i.e. using sudo. What is your argument for not doing this?
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 6:38 pm
by throwaway123
First is the fact, that it needs to enter password everytime Cumulus starts. I know it should not get shut down often, but the computer is a temporarry solution, because it sometimes unexpectedly crashes. Even though that may be automated.
Next is just giving superuser privileges to a program that can do anything after that.
Also is there a way for me to find which device is used by Cumulus?
Thank you
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 6:51 pm
by freddie
throwaway123 wrote: ↑Thu 19 May 2022 6:38 pm
First is the fact, that it needs to enter password everytime Cumulus starts. I know it should not get shut down often, but the computer is a temporarry solution, because it sometimes unexpectedly crashes. Even though that may be automated.
Next is just giving superuser privileges to a program that can do anything after that.
Also is there a way for me to find which device is used by Cumulus?
Thank you
If you run Cumulus as a service then that does away with having to enter a password.
I do understand your reluctance to have a program running privileged. Do you use the computer for anything else - i.e. running a web site? Is the computer accessible from outwith your network? Does anybody who you don't trust have access to your computer? If the answer is no to these questions then I don't see the risk in running Cumulus under a privileged user. I do this (and can answer "no" to the questions).
You can run the command "lsusb" in a terminal, and you should be able to spot your device in the list. Note that the device will be your weather station (not Cumulus - Cumulus just reads data from the device via USB).
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 7:28 pm
by throwaway123
Well, I might just give in to your arguments.
I used lsusb myself and the weather station shows up, but there is no info about which file represents it in the /dev folder. Or how to refere to it in any other way.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Thu 19 May 2022 10:49 pm
by mcrossley
Ah, yes a 1080 station is a USB HID device, it will not show up in /dev. I'm not sure how Linux would refer to these devices for permissions.
Cumulus writes to the USB port to send commands to read you station, normally that sort of task is performed by an elevated process on behalf of the user.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Fri 20 May 2022 7:06 am
by throwaway123
There is a folder /dev/usb taht contains hiddevX, where X is 0, 1, 2, ... On my main computer there are hiddev0 and hiddev1 representing my mouse and keyboard. Could you give me some info about which part of source code are responsible for communication with the 1080? I would try to have a look and perhaps I'll find somthing.
Thank you.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Fri 20 May 2022 8:56 am
by mcrossley
My code just calls a library to do the HID handling. It just passes in the VID/PID of the FO station (VID = 0x1941, PID = 0x8021) and gets an object back I can use to open a Stream to read/write to the device.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Fri 20 May 2022 10:36 am
by freddie
throwaway123 wrote: ↑Thu 19 May 2022 7:28 pm
Well, I might just give in to your arguments.
I used lsusb myself and the weather station shows up, but there is no info about which file represents it in the /dev folder. Or how to refere to it in any other way.
I would use udev to do this rather than changing perms manually on anything under /dev. lsusb should give you output like this (as an example):
Code: Select all
Bus 001 Device 003: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
Take note of the vendor and product IDs relating to your weather station. In the example above, vendor ID is 090c and product ID is 1000.
Create a file (as root) under /etc/udev/rules.d/ and name it something like 60-wh1080.rules (it has to have the .rules extension). Put this in the file:
Code: Select all
SUBSYSTEM=="usb", ATTRS{idVendor}=="090c", ATTR{idProduct}=="1000", MODE:="0666"
replacing the 090c and 1000 with your weather station's vendor and product IDs. Save the file. Reboot and then try running Cumulus as an unprivileged user.
Re: WH1080 not communicating with CumulusMX on Linux Mint
Posted: Fri 20 May 2022 1:02 pm
by throwaway123
Thank you to both of you. I decided to let it run as a service, which works wonderfully.