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

File for pressure calibration settings?

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
Ulric2
Posts: 13
Joined: Mon 21 Feb 2022 11:30 am
Weather Station: FineOffset
Operating System: Ubuntu 20.04

File for pressure calibration settings?

Post by Ulric2 »

I'm running a Fineoffset WS3085. When the base station crashes as it does periodically, I've set up a serial relay and a Python script which briefly interrupts the power to the base station to reset it automatically. After each reset, I need to recalibrate the pressure sensor and I can get an accurate enough value from an API. It would be nice to add a couple of lines to the Python script and just have it recalibrate the pressure automatically using the API value. However, I'm having difficulty finding where the calibration settings are stored IN MX - can someone help me out and tell me which file I need to write to? Thanks.
User avatar
mcrossley
Posts: 12778
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: File for pressure calibration settings?

Post by mcrossley »

The offset is stored in cumulus.ini

Code: Select all

[Station]
EWpressureoffset=
You should only alter value that with Cumulus stopped.
Ulric2
Posts: 13
Joined: Mon 21 Feb 2022 11:30 am
Weather Station: FineOffset
Operating System: Ubuntu 20.04

Re: File for pressure calibration settings?

Post by Ulric2 »

Thank you! I will stop the service, edit and then restart it!
Ulric2
Posts: 13
Joined: Mon 21 Feb 2022 11:30 am
Weather Station: FineOffset
Operating System: Ubuntu 20.04

Re: File for pressure calibration settings?

Post by Ulric2 »

I'm using Python to read the .ini file and then write new values into it and save it but when Cumulus starts, it appears to delete the file and replace it with a blank one. Could that be because the line endings are wrong? Im on Ubuntu 22.04. I'm just not sure what it is about the file that Cumulus doesn't like but I'm assuming it runs some sort of validity check at startup and replaces anything it doesn't think is a valid ini?
User avatar
mcrossley
Posts: 12778
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: File for pressure calibration settings?

Post by mcrossley »

The log file will tell you if it is recreating Cumulus.ini The only time it does that is to remove old, deprecated entries, and all the remaining entries will be the same.

It sounds in your case though as though it cannot parse the file at all, so creates all new default entries and writes that back to the file.
User avatar
ConligWX
Posts: 1634
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 24.04 LTS
Location: Bangor, NI
Contact:

Re: File for pressure calibration settings?

Post by ConligWX »

have you tried using sed perhaps? just a thought.

something like:

Code: Select all

sed -i '/^EWpressureoffset=/!b;n;c\EWpressureoffset=new_value' cumulus.ini
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0

Image
Ulric2
Posts: 13
Joined: Mon 21 Feb 2022 11:30 am
Weather Station: FineOffset
Operating System: Ubuntu 20.04

Re: File for pressure calibration settings?

Post by Ulric2 »

I think it can't parse the file at all so it must be something to do with the way the Python library I used (configparser) writes the file.

Thank you, ConligWX for the sed suggestion. I will now try a sequence where I read the values I need for my calculation, stop MX, make a copy of the config file, sed the change into it and then if no errors are encountered cp the file back into place before starting MX again.
User avatar
mcrossley
Posts: 12778
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: File for pressure calibration settings?

Post by mcrossley »

Ah! I didn't release you were using an INI file parser, which is a bad idea. The MX INI file parser is customised to deal with types unique to CMX.
Ulric2
Posts: 13
Joined: Mon 21 Feb 2022 11:30 am
Weather Station: FineOffset
Operating System: Ubuntu 20.04

Re: File for pressure calibration settings?

Post by Ulric2 »

It's OK, sed works a treat :-)
Post Reply