Discarding RX frame 'unreliable content'? - After Upgrade to latest version 9.8.28

If all the nodes have the same code, I wouldn’t bet on the remainder being OK. That line can produce invalid data, and the law of natural perversity say that one day, it will.

More for my own purpose here, I want to make a note I can refer back to for future emonhub development.

Although not the case here, there could be a scenario where the node definition tries to scale the value passed through emonhub. In this instance we do not want emonhub to crash because it cannot multiply “infinity” by what ever scale is set by the user.

What does happen in that scenario will need to comply with emonhub’s global policy on handling errors without interfering with the data, perhaps we will just not do the math if it’s not possible, leaving the source data as it is. (eg infinity is infinity whether it’s multiplied by 0.01 or not).

But as emoncms still won’t accept that and emonhub needs to be robust, perhaps we will end up omitting a result (null) so the rest of that frame is accepted by emoncms, this depends on whether emoncms can handle the invalid data.

Ideally any emoncms specific casting of data should be done in the emoncms interfacer/reporter, but that adds additional processing.

or emitting?

Possibly, I guess omitting a value is the same as emitting a null. Although emonhub is actually written in Python so null is nothing more than a string, it would be None but then emoncms is PHP so the string “None” has no meaning, that’s why omitting is simpler val1,val2,,val4,val5 here we can all see val3 is empty, neither “null” or “None” and yet it’s both null and None depending on which end is looking at it, If that makes any sense whatsoever!

Just a quick update Paul & Robert -

After updating the code and reflashing the mote, all seems well. I will keep an eye on it and let you know if it keeps behaving like it is supposed to in a day or two.

Thank you both very much for your help, this is not something I would have ever caught on my own. Maybe I should have had my 13-year-old math genius daughter help with the math!

:slight_smile:

I do very much appreciate the time both of you put into helping me.

4/1/2018 - Still running great guys…

2 Likes

Paul & Robert -

Just a quick followup. The change in the math did the trick. I have not had a single problem with emonhub having to be restarted since changing the sketch.

My local emonpi still won’t log data but since I use my offsite server for all of my data gathering anyway, this is not a problem I need to address right now.

Thank you both again for your help!

Edit - removed [Solved] from thread name and marked issue as solved. BT - Moderator

2 Likes