EmontxV3.4.1. Where is the REAL default script?

I bought an emontxv3 with RFM69CW a year ago and have just started to get a monitoring solution up and going, but I’m stuck on the configuring and personalising procedures mostly because I cant find the source for the default script preinstalled on the board.
After a bit of time i have got the emon talking to the Rpi (RPi v3b) via the direct serial connection and uploading data to my local emoncms, but I would like to calibrate it. I have tried some of the other source files and actually went through a calibration exercise today with this sketch emonTxFirmware/emontx3_emonesp.ino at master · openenergymonitor/emonTxFirmware · GitHub
but the output data seems quite at odds with what I get with the original firmware. eg the original firmware seems sensitive to quite low power readings whereas the linked sketch is wildly inaccurate at less than ~100W.

The sketch that I should have thought most likely to be the original firmware source is:emonTxFirmware/emonTxV3/RFM/emonTxV3.4/emonTxV3_4_DiscreteSampling at master · openenergymonitor/emonTxFirmware · GitHub, but it seems to be presented quite differently to the others and I dont understand how I should use it.

I dont know whether this helps or just confuses things, but the output of the default script seems a bit mixed up. ie:
Data comes out as Port2, Port3, Port4, Vrms, Port1, and there is no nodeID transmitted.

The default sketch is indeed the “discrete sample” sketch on Github that you found. You should follow the calibration procedure in Resources > Building Blocks.

The default is intended to transmit the values by radio, so in fact, if you’re using a serial connection, you most likely want to use the “Direct Serial” one emonTxFirmware/emonTxV3_DirectSerial.ino at master · openenergymonitor/emonTxFirmware · GitHub
That definitely sends the NodeID, 4 powers and the voltage in that order. It doesn’t have temperature measurement or pulse counting, if you require these you might be better removing the radio module parts from the default, rather than adding temperature etc to the serial sketch.

The default sketch has the NodeID added automatically by the radio library (JeeLib). You must do that yourself if you’re using the serial output. I think you’re wrong about the order that the variables are sent - it’s likely that the output is not in the format expected and it’s being parsed wrongly on receipt.

We have recently been trying to make things simpler by putting the default (factory loaded) firmware in its own repository together with the hardware design for the emonTx:

We are moving to the using the same pattern (all hardware and firmware for a particular hardware unit in it’s own repo) e.g.

Calibration can be done in software on the RasPi by setting the emonHub scale factors in emonhub config.

I would still consider using the default firmware as a starting point if you are connecting via serial and just disabling the RF and changing the serial output to the format you require. The default firmware is more developed in terms of pulse counting and temperature sensing.

Ah!!, Worked it out thanks to your comment Robert. The data coming in from the emontx consists of 6 groups of data P1,P2,P3,P4,Vrms,?. Emonhub is interpreting the first group as the nodeid hence the subsequent groups are effectively offset such that P1 is populated with P2 data, P2 with P3 data etc. I misunderstood the last group and thought it represented P1 but in fact it represents a non-existent temperature or pulse sensor.

What has confused me is that the emontx3 repo for discrete sampling is laid out quite differently to any of the other repos (eg the 3 phase or, discrete sampling with Ack,), instead it links to a shell script that relies on a github download. I think I have it understood now so hopefully will make a little more progress.
On this note, can I comment that the emonupload folder structure is in a completely different place to the github download referred to by those shell scripts. Is there meant to be any compatibility between the two downloads, or do they have completely different purposes?.
The trouble with using the default script without calibration is that my AC adapter seems to output a significantly lower voltage than that assumed by the script. Although I can adjust this in the emonhub config, I suspect it would affect the power calculations output by the emontx.

Anyway thanks for the help, I think the fog is beginning to clear somewhat.

Yes, it would. If you do the adjustment for voltage in emonHub, you must also scale the power values likewise (plus any adjustment for the CT calibration). It’s not an ideal situation, it makes perfect sense when you know the history but it doesn’t any more.