Some more background:
On a new loop packet event, the first thing that MQTTSubscribeService does is check if the timestamp of the current packet is greater than the timestamp of the the previous packet. If it is, MQTTSubscribeService logs an error and ignores the packet.
I’ll be the first to admit that the time processing of MQTTSubscribeService needs to be reworked. But, based on this conversation, https://groups.google.com/g/weewx-user/c/_zILpHe6ptQ/m/Gi557PJ0AAAJ; while it is ‘legal’ for a driver to submit out of order packets it is probably not a good idea and depending on the data may cause problems.
I’ve thought a bit more about this and looked a bit more at MQTTSubscribeService’s code. At this time I think the best I can do is suppress this message and ignore the packet. At some point a deep dive into the time processing and perhaps add an option to ignore timestamps in loop packets (aka process out of time order packets).
rich
Some (hopefully) clarifying information.
Current when MQTTSubscribeService is ‘given’ a loop packet to augment with MQTT data, if the timestamp in the loop packet is less than the previous one.
- MQTTSubscribeService logs it as an error.
- MQTTSubscribeService ‘ignores’ the loop packet. Does not attempt to augment it with any MQTT data and ‘passes it back’ to WeeWX unchanged.
- WeeWX continues to process the loop packet as-is.
When MQTTSubscribeService (finally) receives a loop packet with a timestamp greater than or equal to the previous timestamp. It will augment it with any MQTT data received since the previous ‘good’ packet.
I’m looking at adding an option that would allow MQTTSubscribeService to update packets with timestamps less than the previous one. This would give the processing choice to the user of MQTTSubscribeService.
rich
After spending some (a lot) more time investigating this, we finally found some answers. We did some tests with Wireshark packets of predefined length, so we could recognize them in the traffic with Wireshark. Whenever there are multiple MQTT messages in the same TLS packet/frame, the MQTT would arrive out of order on the broker side. This seems to be an error in the processing of our broker. It seems that the esp32 (and maybe TLS, I am not familiar with it) prefers packets sizes of around 1500 bytes, and this seems to cause some issues with our broker. I am uncertain if this impacts any other users, as I do not know what AWS IoT core uses under the hood.
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/A56895AD-323A-4003-8862-DCC48251C683%40geddy.au.