Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.0.2 build 3052 - 13 September 2019.
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

FineWeather fixing rel pressure and USB lockups with RPi

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

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 » Thu 22 Aug 2019 2:03 pm

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: 5626
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by mcrossley » Fri 06 Sep 2019 5:39 pm

Could you share the modified Cumulus code please?

sutne
Posts: 17
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: Oregon Scientific WMR100
Operating System: Raspbian Jessie
Location: Mjølfjell, Voss, Norway

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by sutne » 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.

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 » Wed 11 Sep 2019 9:04 pm

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 » Wed 11 Sep 2019 9:12 pm

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: 5626
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: FineWeather fixing rel pressure and USB lockups with RPi

Post by mcrossley » 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.

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 » Thu 12 Sep 2019 7:19 am

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