EmonTx3 upgraded firmware now voltage reads wrong

I have an Emon Tx3 vintage Jan 2016. I have recently updated the firmware to the latest discrete. version. Since the upgrade the voltage [email protected] I am in the UK so this is incorrect. Have I messed up by upgrading to the latest version and if so how can I go back? upgrade done by connecting by cable to Pi running latest software.

I would imagine that somehow, the “USA” flag is set, but I’ve no idea why that should be - is the DIP switch in the correct position? It should not have picked up a wrong calibration value from the EEPROM.

Would I be right in thinking that the powers are wrong by the same factor?

The easiest, if you have a programmer, is going to be to reload the sketch that way. As long as your emonTx is a V3.4 (from 2016, it should be), it should be OK with the version on Github.

But why do you want to stay with the Discrete Sample version? The CM version can be calibrated via the programmer (so I presume by your Pi, though I have never tried it), so you would be able to calibrate it accurately. The code necessary for that hasn’t been, and probably won’t be, carried back into the DS version.

If you can’t recalibrate the emonTx, you can of course change the “scales=…” in emonhub.conf, and recalibrate it this way. You’ll need to change everything - voltage and all four powers - because voltage and current are multiplied in the emonTx, and the voltage being wrong affects everything.

Thanks again Robert. What is this dip switch you refer to? I believe it was reading fine before the update. OK I have a programmer so I will try reloading. I will leave the CM for the moment as my system also has 2 older Emontx3.

It’s on the V3.4, between CT4 socket and the radio. Look in the Guide for the details, though if you haven’t touched it, it should be right.

That shouldn’t affect it. You can update those if you wish - emonLibCM will run on an emonTx V2 even. I’ve got a sketch for the V3.2 if that is what you have - I’m not sure it’s been published.

LAST ENTRIES ON THE LOG FILE
-------------------------------------------------------------
emonTxV34_jeelib Firmware Upload
-------------------------------------------------------------
Downloading firmware from:
https://github.com/openenergymonitor/emontx3/releases/download/3.4.0/firmware.hex

Downloaded file:
-rw-r--r-- 1 pi pi 48K Dec 8 07:09 /opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex

EmonHub is running, stopping EmonHub

Uploading emonTxV34_jeelib on serial port ttyUSB0
Attempt 1...


avrdude-original: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude-original: Using autoreset DTR on GPIO Pin 7
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude-original: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude-original: Device signature = 0x1e950f (probably m328p)
avrdude-original: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude-original: erasing chip
avrdude-original: reading input file "/opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex"
avrdude-original: input file /opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex auto detected as Intel Hex
avrdude-original: writing flash (17168 bytes):

Writing | ################################################## | 100% 6.48s

avrdude-original: 17168 bytes of flash written
avrdude-original: verifying flash memory against /opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex:
avrdude-original: load data flash data from input file /opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex:
avrdude-original: input file /opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex auto detected as Intel Hex
avrdude-original: input file /opt/openenergymonitor/data/firmware/emonTxV34_jeelib.hex contains 17168 bytes
avrdude-original: reading on-chip flash data:

Reading | ################################################## | 100% 6.02s

avrdude-original: verifying ...
avrdude-original: 17168 bytes of flash verified
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe

avrdude-original done. Thank you.

strace: |autoreset: Broken pipe
SUCCESS: flash verifed

Restarting EmonHub

That is the log. Does broken pipe have any relevance?

No, I see that always. It appears to have succeeded.

Still reads 124v

Is that after reloading the .hex file? The source file looks to be correct, can you compile that and load it?
And what about the DIP switch?

It’s OK dip switch was wrong. Sorry to have bothered you!

2 Likes