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 4019) - 03 April 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

FineWeather fixing rel pressure and USB lockups with RPi

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
axierr
Posts: 6
Joined: Mon 19 Aug 2019 11:59 am
Weather Station: Velleman WS3080
Operating System: Raspberry PI 3 b+

FineWeather fixing rel pressure and USB lockups with RPi

Post by axierr »

Hi community,
this is my first post. I have been playing with Cumulus MX and a WS1080/WS3080 Velleman station for a couple of weeks and I want to share my approach to solve two issues:

- First issue, USB lockups, they happen sometimes, I have the station connected to RPI USB port ( no hubs ). I run a cronjob to detect if today.ini was updated within 300s ( I log every 60s ) if not, I restart the pi. The station also shutsdown. I have another script for initializing mono/cumulusmx on reboot, it waits 300s for the station to sync and get the data and then starts cumulus.

- Second issue. On every restart, the relative pressure on the station changes to 1013.2, so it's useless, it makes some guess with some value in memory. I think CumulusMX shouldn't take into account the rel pressure of the station. The parameter EWpressureoffset wasn't correctly used, so I modified the code in CumulusMX to send the absolute pressure. Then you can correct it on cumulus on pressure offset or leave it since the most important data is the pressure change and not the value itself.

If you guys found this valuable, I can share the small scripts and the modified cumulus.
User avatar
mcrossley
Posts: 12763
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by mcrossley »

Could you share the modified Cumulus code please?
sutne
Posts: 377
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by sutne »

axierr wrote: Thu 22 Aug 2019 2:03 pm - First issue, USB lockups, they happen sometimes, I have the station connected to RPI USB port ( no hubs ).
It is a known problem with the USB ports of the RPi. You need a powered USB hub between the RPi and the weather station.
axierr
Posts: 6
Joined: Mon 19 Aug 2019 11:59 am
Weather Station: Velleman WS3080
Operating System: Raspberry PI 3 b+

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by axierr »

sutne wrote: Fri 06 Sep 2019 6:29 pm
axierr wrote: Thu 22 Aug 2019 2:03 pm - First issue, USB lockups, they happen sometimes, I have the station connected to RPI USB port ( no hubs ).
It is a known problem with the USB ports of the RPi. You need a powered USB hub between the RPi and the weather station.
AFAIK, the problem is not the USB port. The powered USB hub is only used to power cycle the station to fix the lockups without powering off the rpi. The issue has some explanations, voltage spikes of the usb cable, data syncs problems between cumulus and the station and so on, but not a real fix.
Last edited by axierr on Wed 11 Sep 2019 9:16 pm, edited 1 time in total.
axierr
Posts: 6
Joined: Mon 19 Aug 2019 11:59 am
Weather Station: Velleman WS3080
Operating System: Raspberry PI 3 b+

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by axierr »

mcrossley wrote: Fri 06 Sep 2019 5:39 pm Could you share the modified Cumulus code please?
The mod is pretty simple, I discarded the internal offset of the Fine Weather Station, and just use the absolute pressure.
FOStation.cs
Line 836
double pressure = (data[7] + ((data[8] & 0x3f)*256))/10.0f + pressureOffset;
to
double pressure = (data[7] + ((data[8] & 0x3f)*256))/10.0f;
And you get the absolute pressure. pressureOffset variable is calculated using a guess of the Fine Weater Station and it's resetted everytime to 1013.2 when the station power cycles, it's just useless, so it doesn't make any sense to log that value. Instead of that, use the offset of cumulusmx if you want the correct relative pressure.
User avatar
mcrossley
Posts: 12763
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by mcrossley »

OK, thanks. I understand what you are doing, however...

That would be a breaking change for many people, so what I propose is to implement the EWpressureoffset cumulus.ini file setting from Cumulus1
If that is set it will override the calculated offset. It does mean that for FO stations there are two pressure offset settings. But it maintains compatibility with existing stations where the current calculated value does work, and also works the same way as Cumulus1.
axierr
Posts: 6
Joined: Mon 19 Aug 2019 11:59 am
Weather Station: Velleman WS3080
Operating System: Raspberry PI 3 b+

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by axierr »

mcrossley wrote: Wed 11 Sep 2019 10:55 pm OK, thanks. I understand what you are doing, however...

That would be a breaking change for many people, so what I propose is to implement the EWpressureoffset cumulus.ini file setting from Cumulus1
If that is set it will override the calculated offset. It does mean that for FO stations there are two pressure offset settings. But it maintains compatibility with existing stations where the current calculated value does work, and also works the same way as Cumulus1.
Yes, that's a good idea. In fact, that was my first attemp to fix it before modifyng the code, but it wasn't working on C2. So I just made it simple.
Post Reply