Missing/Duplicated MQTT Messages

edited October 2022 in Local MQTT

I'm having some issues with the local MQTT, mostly the feed works fine, supplying an electricity reading every 10s which is great. When I switched to parsing the timestamp data though I noticed gaps in the feed, this is demonstrated in the following sample of 10s readings (some data deleted to make it a bit more readable):

{"electricitymeter":{"timestamp":"2022-10-28T11:08:05Z","energy":{<...>,"import":{"cumulative":14803.247,<...>,"power":{"value":0.080,"units":"kW"}}}

{"electricitymeter":{"timestamp":"2022-10-28T11:08:15Z","energy":{<...>,"import":{"cumulative":14803.247,<...>,"power":{"value":0.088,"units":"kW"}}}

{"electricitymeter":{"timestamp":"2022-10-28T11:08:15Z","energy":{<...>,"import":{"cumulative":14803.247,<...>,"power":{"value":0.088,"units":"kW"}}}

{"electricitymeter":{"timestamp":"2022-10-28T11:08:35Z","energy":{<...>,"import":{"cumulative":14803.248,<...>,"power":{"value":0.079,"units":"kW"}}}

Notice that instead of a new message being sent at 11:08:25, the 11:08:15 message is resent a second time at 11:08:25. Does anyone else have this issue? Note that if you don't parse the timestamp and just use the message arrival time this will hide the error, but you're using an invalid power reading for that duplicated timestamp.

I'm using mosquitto_sub to output these messages, so there's really nothing between the CAD and the printout that could be causing this error, seems to be a bug in the meter or CAD, depending on which one generates the timestamp?

Comments

  • Confirmed with QoS 2 by the way, so it's definitely the CAD putting out the wrong message, though this may be caused by the meter depending on how it's implemented? I have an Elster AS300P with AM110R comms unit.

  • edited April 2023

    Resurrection.

    Yes, I have exactly the same problem.

    After filtering out the duplicates, here is what I'm left with (I only keep the timestamp and value):

    2023-03-31T00:01:16Z 4.233

    2023-03-31T00:01:30Z 4.234

    2023-03-31T00:01:36Z 4.234

    2023-03-31T00:01:46Z 4.235

    sometimes I'm getting 3 new messages per minute, other times are 6 per minutes.

    2023-03-30T20:44:11Z 0.025

    2023-03-30T20:44:17Z 0.036

    2023-03-30T20:44:26Z 0.023

    2023-03-30T20:44:42Z 0.012

    2023-03-30T20:44:46Z 0.022

    2023-03-30T20:44:58Z 0.023


    I'm keeping copies of my unique deconstructed messages:

    $ wc -l *

     5414 meter-2023-03-28.out

     5400 meter-2023-03-29.out

     5966 meter-2023-03-30.out

     6631 meter-2023-03-31.out


    So a large amount of variability in the number of messages I'm processing per day, and something like 16 seconds on average between messages.


    L+G meter, WNC comms.

Sign In or Register to comment.