Delete part in a node allowed?

As I’m pushing slowly my investigations further …

on my emonpi in the emonhub config editor you have several nodes pre-configured

In my case node 8 is used to communicate with my emontx with 4 CT’s attached and an AC adapter

[[8]]
nodename = emontx3
[[[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.0092,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

In this node I’m basically adding quite some ‘null’ data since not used. Is it possible to alter the node so to only include the necessary data strings only like below without breaking it . Knowing that I send data straight to an online emoncms ? And if I alter, will emoncms adapt or do I have to alter things in there ?

[[8]]
nodename = emontx3
[[[rx]]]
names = power1, power2, power3, power4, vrms
datacodes = h,h,h,h,h,h
scales = 1,1,1,1,0.0092
units =W,W,W,W,V

In emonhub.conf you are providing a definition of the connected/remote node for emonhub and emoncms to recognize and decode the incoming packets. You are not defining the packet structure itself, that is done in the sketch. If you were to change the conf as you suggest above emonhub would compare the actual packet received with what you have told it to expect and discard the packet as it doesn’t match the definition provided.

Ok
I have to leave it as is. Was wondering if by reducing the packet it was possible to avoid corrupt packages … the shorter they are, less chance they get corrupt over wifi. But I’m not yet in the mood/capability to go fool with sketches :slight_smile:
Plus it would have to be redone each upgrade …
maybe over time add some code to recognise not used parts and deactivate them ?

I prefer the way you describe and that is how emonhub was supposed to work, originally the emontx sketches would count how many temp sensors were connected and the packet size would reflect that, so in your case with no temp sensors

[[8]]
    nodename = emontx3
[[[rx]]]
    names = power1, power2, power3, power4, vrms, pulse
    datacodes = h,h,h,h,h,h,L
    scales = 1,1,1,1,0.0092,1
    units =W,W,W,W,V,p

would have been acceptable (the default?) and then as users plug in more temp sensors they would have to add them to the conf too, simples! However the decision was made that every node firmware would have a fixed number of 6, no more no less, so that users didn’t need to edit the conf, this is a legacy of the now retired nodes module that made defining the nodes mandatory.

It shouldn’t require much of a change to the sketch to implement that behaviour. The size of the struct is fixed, but it isn’t necessary to send all of it - the call to JeeLib specifies the number of bytes to be extracted from the struct and sent. [More accurately, JeeLib accepts the address of the first byte and a length in bytes.] For convenience(?), ‘sizeof’ is used but it doesn’t have to be so.