cmon Unit system mismatch

43 views
Skip to first unread message

Lucas Heijst

unread,
Feb 21, 2023, 9:48:03 AM2/21/23
to weewx-development
The Computer monitor program (cmon.py) doesn't call 'genLoopPackets' which yield loop data.
Once per archive interval 'new_archive_record' is called which in version 5.0.0a16 generates an 'Unit system mismatch' error.

Probably the default value is 'US' while cmon.py uses 'METRIC'.

Do I have to solve this in cmon.py (e.g. call  'genLoopPackets' once during init)?

Luc
cmon Unit system mismatch.txt

Lucas Heijst

unread,
Feb 21, 2023, 6:47:40 PM2/21/23
to weewx-development
As a test I replaced service ComputerMonitor with service alarm (copied from examples/alarm.py) and got a similar exception.

weewx_cmon.conf
...
    [[Services]]
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate
        xtype_services = weewx.wxxtypes.StdWXXTypes, weewx.wxxtypes.StdPressureCooker, weewx.wxxtypes.StdRainRater, weewx.wxxtypes.StdDelta
        archive_services = weewx.engine.StdArchive
        restful_services = ""
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport, user.alarm.MyAlarm


I wonder if line 1624 in units.py has something to do with the error (arbitrarily, pick the US unit system:)

    # Is the record None?
    if record_dict is None:
        # Yes. Signal a value of None and, arbitrarily, pick the US unit system:
        val = None
        std_unit_system = weewx.US
    else:
        # There is a record. Get the value, and the unit system.
        val = record_dict[obs_type]
        std_unit_system = record_dict['usUnits']

Op dinsdag 21 februari 2023 om 11:48:03 UTC-3 schreef Lucas Heijst:
alarn Unit system mismatch.txt

Tom Keffer

unread,
Feb 21, 2023, 7:01:27 PM2/21/23
to Lucas Heijst, weewx-development
The alarm example works for me without any problems.

I have not tried cmon: it's not part of weewx, and I have to draw the line somewhere!

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/d3a9ba87-b9e4-414a-ba9a-bb31855ed730n%40googlegroups.com.

Lucas Heijst

unread,
Feb 22, 2023, 6:56:06 AM2/22/23
to weewx-development
Problem solved, my fault!

I tested command 'weectl station create --no-prompt', so I got a weewx.conf file with default values.
After that I edited weewx.conf to meet the data for ComputerMonitor and forgot to change the default 'target_unit' from US to METRIC.

Op dinsdag 21 februari 2023 om 21:01:27 UTC-3 schreef Tom Keffer:
Reply all
Reply to author
Forward
0 new messages