Unsigned Long number is reported as two independent numbers in the Input dashboard (emonhub issue?)

Hi, I’m using a emonTX with a emonPi.
In the emoncms of the emonPi, appears all the variables in the Input Dashboard like: power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp5, pulse, rssi…

But, also al record name: 13 with a value 0.

The emonhug log, I saw 13 bytes.

2017-02-13 20:00:08,113 DEBUG    RFM2Pi     634 From Node : 10
2017-02-13 20:00:08,113 DEBUG    RFM2Pi     634    Values : [-10, 0, 0, 0, 115.41, 0, 0, 0, 0, 0, 0, 0, 0]
2017-02-13 20:00:08,114 DEBUG    RFM2Pi     634      RSSI : -59

It’s completely logical because the data structure defined in the firmware of the emonTx is:
11 int’s and 1 unsigned long number:

typedef struct {
  int power[4], Vrms, temp[6];
  unsigned int pulseCount;
} PayloadTX;

However the emonhub config files defines the pulse data as a long record:

[[10]]
    nodename = emontx1
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacode = h
       scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       units =W,W,W,W,V,C,C,C,C,C,C,p

so my question is is there is a bug with the emonhub?

Regards.

Can you link to the sketch you are using?

The info you provide above is conflicting

2017-02-13 20:00:08,113 DEBUG    RFM2Pi     634    Values : [-10, 0, 0, 0, 115.41, 0, 0, 0, 0, 0, 0, 0, 0]

This is 13 decoded values not bytes !

The typdef struct you display is 11 ints and an unsigned int not an unsigned Long

  unsigned int pulseCount;

I believe the typedef struct may have been copied over incorrect and it should say

  unsigned long pulseCount;
       datacode = h

this definition states the payload will be an unspecified number of signed ints

From what I can make out the incoming packet is 26 bytes as it is currently decoded as all signed ints because of the datacode = h in emonhub.conf, that is why you are seeing the extra “13:0” input as there are only 12 variable names. So the emonhub config is also incorrect, that should also account for the unsigned long eg

[[10]]
    nodename = emontx1
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h, h, h. h. h. h. h. h. h. h. h. L. 
       scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       units =W,W,W,W,V,C,C,C,C,C,C,p

Try changing the datacode = h line for datacodes = h, h, h. h. h. h. h. h. h. h. h. L. and see what that does.`

Hi Paul, thanks for your valuable help.

Please take a look at: https://github.com/ldmaroto/emontx/blob/master/voltcurr2/voltcurr2.ino

Regards.

Hi Paul, I used the NodeID 8 and the record 13 desappears.

But when I change de data code = h to h,h,h,h,h,h,h,h,h,h,h,L the emonhub log appers: WARNING MainThread RFM2Pi thread is dead

If I return to the last code, “data code = h”, every thing is ok.

Paul: I saw this: MainThread RFM2Pi thread is dead | Archived Forum

So everythig is OK, Thanks so much.