EmonTx V3.2 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.

1 Like

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

Hi Robert, I know this thread is old now but another question. Will this older TX3 work with the wifi add on? I am having problems with the radio signal even though it is not a long-distance and no brick walls in between.

Yes - but you may well need to follow the very early release notes which describe the ESP8266 conected externally to the emon|Tx. Using the EmonTx v3 with the ESP8266 Huzzah WIFI module.
When you get WiFI working, you will probably want to disable the RFM module. If the software version is recent enough, that can be done via a programmer and the setup menu. If not, then you’ll need to download the sketch, edit it and re-load the emonTx 3.

Thanks Robert I have only just got back to this. Am I correct in saying I can update TX3 firmware using Pi with latest software with usb lead? The wifi card was bought from the openenergymonitor shop so has the correct software I believe?

It’s said that you can do that, I’ve never tried it so I can’t personally endorse it. The ESP8266 from The Shop should indeed ‘just work’ - given ir receives the data in the correct format.

At this point I guess it would make sense to go continuous monitoring. Is it as simple as loading the cm firmware into the tx3’s and it will work?

I’m still not sure what hardware you have. There are two very different versions of the emonTx V3. The V3.2. used the no longer available RFµ328 module, while the V3.4 has the ATMega 328P directly on the main circuit board. Then there are two possible radio modules, the Hope RFM12B and the Hope RFM69CW. To identify which one of those you have, look here: Learn | OpenEnergyMonitor

When you can say definitively what you have, I can tell you which software will work, or what you need to change to make it work.

Board says v3.2 Oct 2013. That prob explains why it would not update connected to Pi. with rfm12b 868.

OK, The emonLibCM library itself works on all emonTx versions so far (even with limitations on the V4!)
The rfmTxLib can only transmit, but that too will work with both the RFM12B and the RFM69CW. What I suggest is exactly as I wrote to another correspondent only days ago:

Both libraries are documented, but if you run into problems, do ask.

Thanks Robert,
So I have never used GitHub Arduino or anything like that in my life. I hope I can work it out! To be clear. Are you saying that I will also need to change the program as well?
I am 60 yrs old so this kind of thing is a bit daunting!
rgds
Mark Webb

No excuses allowed - I’m 73. Yes, you will need to edit the sketch. I can do that for you, but I can’t do it immediately, it may well be a week or more before I can look at it. Let me know if you’re prepared to wait, or whether you want to give it a go. Do you have a programmer? And have the Arduino IDE set up? You’ll need both either to load a sketch I send you, or to edit and load your own.

Thanks again Robert,
I have a programmer. I have downloaded Arduino. I can’t get a serial feed from the emontx into Arduino (have downloaded drivers) And I don’t understand how to download from GitHub and get stuff into Arduino libraries. Pretty useless really! Instructions not that clear!
rgds
Mark Webb