# Definition of inputs MSG, Missed, and Missedprc

**URL:** <https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537>\
**Category:** Emoncms\
**Tags:** datafeed, inputs\
**Created:** [9 February 2024 23:30 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537 "2024-02-09T23:30:03Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![grod55](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/grod55/32/26153_2.png) [@grod55](https://community.openenergymonitor.org/u/grod55)\
**Post date:** [9 February 2024 23:30 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/1 "2024-02-09T23:30:03Z")

</div>

I’m looking for some definitions of inputs MSG, Missed, and Missedprc. I did see part of the answers in this [post](https://community.openenergymonitor.org/t/documentation-of-data-keynames/24867), but I’m looking for a more expanded explanation.

Specifically when using the emonPi2:

MSG - this is a count of messages but where are they originating from and going to?  
Missed - I am assuming it is the difference between messages sent vs messages received - related to my question above.  
Missedprc - what is this and how is it different from Missed?

My goal is to clean up my inputs and feeds and feel that the three inputs above are good as diagnostic tools if I am missing data, but not really sure what it is telling me.

Any insight is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [10 February 2024 00:22 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/2 "2024-02-10T00:22:35Z")

</div>

See [Which emontx4 inputs to create feeds for? - #2 by Robert.Wall](https://community.openenergymonitor.org/t/which-emontx4-inputs-to-create-feeds-for/23544/2)  
also  
[Null Data and Wireless - #6 by Robert.Wall](https://community.openenergymonitor.org/t/null-data-and-wireless/24780/6)  
and  
[Documentation of data keynames? - #2 by Robert.Wall](https://community.openenergymonitor.org/t/documentation-of-data-keynames/24867/2)

---

<div class="post-metadata">

**Author:** ![grod55](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/grod55/32/26153_2.png) [@grod55](https://community.openenergymonitor.org/u/grod55)\
**Post date:** [10 February 2024 10:56 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/3 "2024-02-10T10:56:59Z")

</div>

Robert thank you for the links.

@TrystanLea Am I correct in concluding the following:

- MSG is the number of messages originating from the probes (eg CT, Temp, etc, both onboard an emonPi or an emonTX) being sent to emonHub and emonCMS

- Missed is the number of received by emonHub from a 433Mhz TX unit (eg emonTX4) subtracted from the number of messages sent from probes and/or TX units.

- Missedprc is the number of messages that failed to get processed by emonHub or emonCMS

If the above is true, are there equivalent messages from the local emonCMS (on emonBase or emonPi2) when sending inputs/feeds to [emonCMS.org](http://emonCMS.org)?

Thanks,

Gordon

---

<div class="post-metadata">

**Author:** ![rupert](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rupert](https://community.openenergymonitor.org/u/rupert)\
**Post date:** [10 February 2024 11:24 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/4 "2024-02-10T11:24:05Z")

</div>

I don’t know if I’m correct, but I’ve always assumed from the name that missedprc is the percentage of messages that were not received correctly?

If that is correct, I don’t know what period missedprc is calculated over - it doesn’t seem to be 100\*(missed/MSG), but must be over a shorter period, i.e. over some number of the most recent messages?

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [19 February 2024 18:14 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/5 "2024-02-19T18:14:30Z")

</div>

Hello @grod55

- MSG is the message count on the emonTx4 since last power cycle.
- Missed is a count of missed messages in the expected sequence. E.g If we receive MSG 10 but the next message received is MSG 12 then we know we have missed one message.
- Missedprc is the same expressed as a percentage e.g 100 x (Missed / MSG)

Hope that helps!

---

<div class="post-metadata">

**Author:** ![grod55](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/grod55/32/26153_2.png) [@grod55](https://community.openenergymonitor.org/u/grod55)\
**Post date:** [19 February 2024 19:01 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/6 "2024-02-19T19:01:16Z")

</div>

Trystan,  
thanks for the info. Still need to understand the message count a bit deeper.

What are the messages from and to? Is this the input messaging to the emonTX4 or is it the emonTX4 messaging to the emonHub?

Is there any message count from the emonhub to [emoncms.org](http://emoncms.org)?

Thanks,

Gordon

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [19 February 2024 20:23 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/7 "2024-02-19T20:23:29Z")

</div>

> [@grod55](#):
>
> is it the emonTX4 messaging to the emonHub?

This. The count originates in the emonTx.

> [@grod55](#):
>
> Is there any message count from the emonhub to [emoncms.org](http://emoncms.org)?

Not that I’m aware of.

---

<div class="post-metadata">

**Author:** ![grod55](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/grod55/32/26153_2.png) [@grod55](https://community.openenergymonitor.org/u/grod55)\
**Post date:** [19 February 2024 20:47 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/8 "2024-02-19T20:47:21Z")

</div>

> [@Robert.Wall](#):
>
> This. The count originates in the emonTx.

Ok, to belabor this a bit longer to make sure I fully understand. Is the following correct?

If the emonTx has one CT attached and is collecting data every 10 seconds, then the emonTx would generate 6 messages per minute or 8,640 messages per day.  
Each additional device (CT, temperature probe, or emonTH) would generate the same number of messages each (assuming 10-second intervals as well).

Further, I suspect the major reason for missed messages is the RF environment (433 or WiFi). Therefore, with CTs and Probes directly connected to the emonPi2 the opportunity for missed messages is minuscule.

Thanks,

Gordon

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [19 February 2024 20:51 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/9 "2024-02-19T20:51:53Z")

</div>

The emonTx4 message count is independent of the number of CT sensors and temperature sensors attached, it is a device level message count.

The emonTH does not provide a message count field and therefore it does not have these associated inputs.

The device e.g emonTx4 has to have a message count field defined.

This is what the code looks like in emonhub for reference:

```
    if len(names) and names[0].upper()=="MSG":
        msg = rxc.realdata[0]
        if not node in self.last_msg: 
            self.first_msg[node] = msg
            self.last_msg[node] = msg-1
            self.missed[node] = 0
            
        if self.last_msg[node]>msg:
            self.first_msg[node] = msg
            self.last_msg[node] = msg-1
            self.missed[node] = 0

        self.missed[node] += msg - self.last_msg[node] - 1
        self.last_msg[node] = msg
        
        msgcount = msg - self.first_msg[node]
        if msgcount:
            missedprc = 100.0 * self.missed[node] / msgcount;
        else: 
            missedprc = 0

```

and is located here: [emonhub/src/emonhub\_interfacer.py at master · openenergymonitor/emonhub · GitHub](https://github.com/openenergymonitor/emonhub/blob/master/src/emonhub_interfacer.py#L422)

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [19 February 2024 20:59 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/10 "2024-02-19T20:59:29Z")

</div>

> [@TrystanLea](#):
>
> it is a device level message count.

Even more specifically, all sensor data from the emonTx is packaged into a single message, the count is the serial number of the message before it is passed to the radio library (ISM band radio) or the WiFi module for transmission.  
Therefore, any automatic re-transmission that happens entirely within the library or WiFi module due to failed messages or collisions does not affect the count.

---

<div class="post-metadata">

**Author:** ![grod55](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/grod55/32/26153_2.png) [@grod55](https://community.openenergymonitor.org/u/grod55)\
**Post date:** [19 February 2024 21:07 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/11 "2024-02-19T21:07:59Z")

</div>

@Robert.Wall @TrystanLea  
thank you both for helping to educate me. It is greatly appreciated.  
So, am I correct that I should expect 8,640 messages per day as a reference point?  
Thanks,

Gordon

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [19 February 2024 21:14 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/12 "2024-02-19T21:14:53Z")

</div>

From an emonTx? Unfortunately, no.

## Explanation of Fixed Interval TimeSeries.

Think of the emonCMS FITS Feed as a line of boxes moving along a conveyor. The speed of the conveyor - the time it takes a box to go past a fixed point - is the “Feed Interval” If there’s a box going past every 10 s but data falls onto the conveyor every 30 s, two boxes out of three will move on empty, with no data in them (a NULL value). The device sending data to emonCMS needs to send it just slightly more frequently than the Feed interval you choose when you create the Feed. 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. Similarly, the emonTH is set to send every 58 s approximately and uses a 60 s interval.

---

<div class="post-metadata">

**Author:** ![grod55](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/grod55/32/26153_2.png) [@grod55](https://community.openenergymonitor.org/u/grod55)\
**Post date:** [19 February 2024 22:11 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/13 "2024-02-19T22:11:09Z")

</div>

@Robert.Wall  
Great analogy. I get it now.  
Thanks so much for taking the time to explain this.  
Best regards,  
Gordon

---

<div class="post-metadata">

**Author:** ![rupert](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rupert](https://community.openenergymonitor.org/u/rupert)\
**Post date:** [19 February 2024 22:24 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/14 "2024-02-19T22:24:11Z")

</div>

I am still a bit mystified by the numbers here - from my emonBase, for different nodes:

```auto
MSG missed missedprc 100*(missed/MSG)
205343 27899 26.16 13.59
195584 10825 9.91 5.53 
211192 3249 2.98 1.54
 34962 3515 10.05 10.05
249743 4073 3.71 1.63

```

A bit of nit-picking here, but only the 10.05% result is consistent?

The only thing that comes to mind is a power failure at either or both the TX and the RX. I can see from the Arduino code that after a restart, the TX will reset MSG to zero.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [21 February 2024 11:21 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/15 "2024-02-21T11:21:50Z")

</div>

Hello @rupert

The missed count is reset in a couple of different situations:

- EmonTx4 or other radio node power cycle - emonHub detects that MSG has reset to zero and therefore resets the missed count.

- emonHub service restart, missed count is also reset in this instance even if e.g MSG count form the emonTx4 has not reset and could be 100000 and climbing.

If we take your first result there:

```auto
205343 27899 26.16 13.59

```

emonHub was likely restarted at some point after the first node power cycled. It has therefore only been counting missed packets over 27899/0.2616 = 106647 packets or from message 205343 - 106647 = 98696 onwards.

A good way to illustrate this is if you restart the emonHub service now but do not power cycle your nodes. You will notice that missed and missedprc reset to zero.

---

<div class="post-metadata">

**Author:** ![rupert](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/r/f14d63/32.png) [@rupert](https://community.openenergymonitor.org/u/rupert)\
**Post date:** [21 February 2024 11:47 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/16 "2024-02-21T11:47:48Z")

</div>

Hi @TrystanLea

Thanks very much for the explanation. I think I did restart emonHub a few times lately!

It’s nice to know how the numbers are derived!

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [21 February 2024 12:40 UTC](https://community.openenergymonitor.org/t/definition-of-inputs-msg-missed-and-missedprc/25537/17 "2024-02-21T12:40:13Z")

</div>

> [@TrystanLea](#):
>
> The missed count is reset in a couple of different situations:

Might we worth adding to the docs?
