Skip to content

MQTTSubscribe throws ValueError: start time is greater than stop time when MQTT message timestamp equals loop packet timestamp #10

@n7qnm

Description

@n7qnm

WeeWX crashes with an unrecoverable exception when an MQTT message arrives with a dateTime exactly equal to the current loop packet timestamp, causing get_accumulated_data() to build a zero-width TimeSpan.
Environment:
WeeWX 5.3.1
MQTTSubscribe 3.1.1
Binding: loop
Driver: WeatherFlowUDP (hardware record generation)
MQTT sources: rtl_433 individual-type messages
weewx.conf
ignore_start_time = true
adjust_start_time = 2

Error in sylog:
ValueError: start time (1777676342) is greater than stop time (1777676342)

With some help from claude, this looks like an OK workaound
if start_ts >= end_ts:
start_ts = end_ts - 1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions