Problem with data from MQTT feed seeming to be "lost"

It looks as if it’s behaving exactly as designed (PHPFINA, or Fixed Interval TimeSeries in the latest emonCMS, that is).

Think of the emonCMS PHPFINA Feed as a line of boxes moving along a conveyor. If there’s a box going past every 5 s but data falls onto the conveyor every 15 s, two boxes out of three will move on empty, with no data in them (a NULL value). You need to tweak the timing of any device sending to emonCMS to be just slightly less than one of the intervals you can choose. If there’s already data in the box and it hasn’t moved on, it will overlay the data already in there, which is lost. But you won’t have null values in the Feed.

The same applies to any Feed and any timebase - and the boxes move on the Internet minute, or multiples or sub-multiples thereof. i.e., a 10 s feed happens on the minute and at 10, 20 etc seconds past.

If you can always guarantee that the source will send the data in the middle of a time slot by Internet time, you can safely match the rates exactly.

Where the sender, the emonTx for example, depends on a crystal tolerance for its timebase, or there might be transmission delays, we set it to send every 9.96 seconds and use a 10 s feed interval.

1 Like