On an emonPi I am editing in the EmonHub Config Editor to set up an additional node. Below is what I typed into the emonhub.conf area but this did not work.
[[11]]
nodename = emonGLCD
firmware = HomeEnergyMonitor.ino
hardware = emonglcd
[[[rx]]]
names = temp
datacode = h
scale = 0.01
units = F
Looking at the Nodes page I see this (with the word "temp" split up):
If I add two names and two units in the emonhub.conf area, then the Nodes page looks correct.
[[11]]
nodename = emonGLCD
firmware = HomeEnergyMonitor.ino
hardware = emonglcd
[[[rx]]]
names = temp,junk
datacode = h
scale = 0.01
units = F,C
Is this something I am configuring incorrectly or an issue with the emonhub within the emonPi?
Jon
Re: Issue creating new Node on emonPi
Hi Jon
What is most likely happening there is the emonHub code is trying to split the list of "names", but since there is only one item it is splitting the string. This is incorrect behavior from emonhub that you have side stepped by defining a second value.
I would need to look closer at how the names and units are parsed in the "emon-pi" variant of emonhub to be sure, but you may be able to make emonhub comprehend a "list of one names" by adding just a comma rather than a second "names".
Does your sketch have just one value? I would of expected a different error if you defined a second value when there is only one, but that seems to have slipped through.
Also the use of datacode rather than datacodes and scale rather than scales is open ended, the singular term datacode (or scale) denotes all the variables of an undefined quantity are the same datacode (or scale), where as the plural term denotes each variable's datacode (or scale) is explicitly defined and therefore the number of values is implied and must match (eg 5 datacodes for 4 values will fail) emonhub's use of the plural term becomes a little odd when there is only one value.(thankfully a rare occurrence) "data code = h" is undefined number of ints where as "datacodes = h" would actually mean explicitly one integer value.
There is no problem with using the singular datacode or scale, but I thought I would explain the singular/plural is not directly linked to the number of values but to "single global" or "one per value".
This intended behavior may not be consistent with the names or units as they were not written in at the same time as the original datacode(s) and scale(s). I will take a closer look to see how it's been done when I can though. I the meantime I hope this (rather confusing?) explanation helps you find an acceptable work around.
Paul
Re: Issue creating new Node on emonPi
Hi Paul,
Thank you for your quick reply! Yes, there is only one value from the emonGLCD (the temp). I had actually started out with "list of one names" by adding the comma.
[[11]]
nodename = emonGLCD
firmware = HomeEnergyMonitor.ino
hardware = emonglcd
[[[rx]]]
names = temp,
datacode = h
scale = 0.01
units = F,
That worked of for receiving the data from the emonGLCD, but in the Nodes page showed a blank name for RX ID 2. (See attached image).
And I believe I understand the datacode(s) and scale(s). I'll know for sure when I add a multi-value Node.
If code does change, please let me know if there is something I can test or assist with. I am happy to help!
Jon