I’ve just upgraded my emonPi to using a newer base image (1st Feb 2024; from October 2019), and switched the firmware from JeeLib to LowPowerLabs. All the OEM related software is up to date.
Following Should I update Emon Pi firmware to CM, and how? it all went pretty smooth. Yay.
Similarly, so did updating the firmware on the TH2, having bought the programmer previously.
I enabled autoconf
as is suggested.
Which then brings me round to the Tx4 which I’d never put into production. It was originally shipped (in June 2023) with the JeeLib firmware, so it needed updating to match the update on the emonPi, but I’ve also put the CT expander in it, before putting it into use.
I intend to use it wirelessly with the emonPi.
I flashed the relevant firmware (emonTx4_DB_12CT_1phase_LPL
), but it doesn’t seem to be found automagically by the emonPi. There’s no red LED flashing/briefly on startup/power plug in on that firmware (there is on the 6CT
firmware). I’m not sure if that’s expected, or relevant.
If I flash back to the 6CT firmware, emon_DB_6CT_1phase_27
appears in the inputs automatically, and all seems to be playing nice. Plus the red LED comes on for a few seconds after power on.
6 CT Expansion board — OpenEnergyMonitor 0.0.1 documentation seems to suggest that autoconf should work:
If you have the latest version of emonhub with autoconf enabled, it will automatically populate the node decoder configuration below.
I have tried adding the manual config as it’s mentioned, and then saving, rebooting EmonHub, and even the whole emonPi, to no apparent avail.
I haven’t tried the Tx4 plugged into the emonPi for anything other than firmware yet, so I guess I should do that (though the config change potentially conflicts with the existing config for the monitoring equipment in the emonPi itself), and also see if I can get the serial console as suggested under emonTx4, emonVs & emonBase Install Guide — OpenEnergyMonitor 0.0.1 documentation
I do note that on the page it does say
- Switch on mains socket and verify that the red LED on the emonTx4 and the red LED on the Raspberry Pi illuminates.
So it kinda seems that my theory that something is wrong with the firmware/the flash, may indeed be the case…
The flash log for the 12CT
has some noise (but so does the 6CT
), which I don’t know if it is relevant.
12CT
:
LAST ENTRIES ON THE LOG FILE
-------------------------------------------------------------
Firmware selected: emonTx4_DB_12CT_1phase_LPL
-------------------------------------------------------------
Downloading firmware from:
https://raw.githubusercontent.com/openenergymonitor/avrdb_firmware/master/compiled/emonTx4/emonTx4_DB_12CT_1phase_LPL_v1_2_0.ino.hex
Downloaded file:
-rw-r--r-- 1 pi pi 66K Jun 16 17:49 /opt/openenergymonitor/data/firmware/emonTx4_DB_12CT_1phase_LPL.hex
EmonHub is running, stopping EmonHub
Uploading emonTx4_DB_12CT_1phase_LPL on serial port ttyUSB0
Attempt 1...
avrdude -Cavrdude.conf -v -pavr128db48 -carduino -D -P/dev/ttyUSB0 -b115200 -Uflash:w:/opt/openenergymonitor/data/firmware/emonTx4_DB_12CT_1phase_LPL.hex:i
avrdude-original: Version 7.1
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is /opt/openenergymonitor/EmonScripts/update/avrdude.conf
avrdude-original yywarning() warning: ATmega329's flash writepage misses a necessary address bit a13 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:5932]
avrdude-original yywarning() warning: ATmega649's flash writepage misses a necessary address bit a14 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:6158]
avrdude-original yywarning() warning: AT90PWM2's eeprom writepage misses a necessary address bit a8 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:9348]
avrdude-original yywarning() warning: ATtiny44's eeprom writepage misses a necessary address bit a7 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11206]
avrdude-original yywarning() warning: ATtiny84's eeprom writepage misses a necessary address bit a8 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11390]
avrdude-original yywarning() warning: a4 would normally be expected to be a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a3 would normally be expected to be a4 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a2 would normally be expected to be a3 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a1 would normally be expected to be a2 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a0 would normally be expected to be a1 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: too few opcode bits in instruction [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: ATtiny43u's eeprom read misses a necessary address bit a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11694]
avrdude-original yywarning() warning: ATmega32U4's eeprom writepage misses a necessary address bit a2 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11880]
avrdude-original yywarning() warning: AT90USB1286's eeprom writepage misses a necessary address bit a11 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:12275]
avrdude-original yywarning() warning: ATtiny1634's flash writepage misses a necessary address bit a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:15031]
avrdude-original yywarning() warning: mcuid -1 for ATtiny402w is out of range [0..2039], use a free number >= 372 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:15497]
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
AVR Part : AVR128DB48
RESET disposition : dedicated
RETRY pulse : SCK
Serial program mode : yes
Parallel program mode : yes
Memory Detail :
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
prodsig 0 0 0 0 no 125 125 0 0 0 0x00 0x00
fuses 0 0 0 0 no 9 16 0 0 0 0x00 0x00
fuse0 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse1 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse2 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse4 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse5 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse6 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse7 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse8 0 0 0 0 no 1 1 0 0 0 0x00 0x00
lock 0 0 0 0 no 4 1 0 0 0 0x00 0x00
data 0 0 0 0 no 0 1 0 0 0 0x00 0x00
flash 0 0 0 0 no 131072 512 0 0 0 0x00 0x00
eeprom 0 0 0 0 no 512 32 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 25.1
avrdude-original: AVR device initialized and ready to accept instructions
avrdude-original: device signature = 0x1e970c (probably avr128db48)
avrdude-original: reading input file /opt/openenergymonitor/data/firmware/emonTx4_DB_12CT_1phase_LPL.hex for flash
with 23896 bytes in 1 section within [0x200, 0x5f57]
using 47 pages and 168 pad bytes
avrdude-original: writing 23896 bytes flash ...
Writing | ################################################## | 100% 3.64s
avrdude-original: 23896 bytes of flash written
avrdude-original: verifying flash memory against /opt/openenergymonitor/data/firmware/emonTx4_DB_12CT_1phase_LPL.hex
Reading | ################################################## | 100% 2.40s
avrdude-original: 23896 bytes of flash verified
avrdude-original done. Thank you.
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: Using autoreset DTR on GPIO Pin 7
SUCCESS: flash verifed
Restarting EmonHub
6CT
:
LAST ENTRIES ON THE LOG FILE
-------------------------------------------------------------
Firmware selected: emonTx4_DB_6CT_1phase_LPL
-------------------------------------------------------------
Downloading firmware from:
https://raw.githubusercontent.com/openenergymonitor/avrdb_firmware/master/compiled/emonTx4/emonTx4_DB_6CT_1phase_LPL_v2_1_0.ino.hex
Downloaded file:
-rw-r--r-- 1 pi pi 71K Jun 16 18:37 /opt/openenergymonitor/data/firmware/emonTx4_DB_6CT_1phase_LPL.hex
EmonHub is running, stopping EmonHub
Uploading emonTx4_DB_6CT_1phase_LPL on serial port ttyUSB0
Attempt 1...
avrdude -Cavrdude.conf -v -pavr128db48 -carduino -D -P/dev/ttyUSB0 -b115200 -Uflash:w:/opt/openenergymonitor/data/firmware/emonTx4_DB_6CT_1phase_LPL.hex:i
avrdude-original: Version 7.1
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is /opt/openenergymonitor/EmonScripts/update/avrdude.conf
avrdude-original yywarning() warning: ATmega329's flash writepage misses a necessary address bit a13 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:5932]
avrdude-original yywarning() warning: ATmega649's flash writepage misses a necessary address bit a14 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:6158]
avrdude-original yywarning() warning: AT90PWM2's eeprom writepage misses a necessary address bit a8 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:9348]
avrdude-original yywarning() warning: ATtiny44's eeprom writepage misses a necessary address bit a7 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11206]
avrdude-original yywarning() warning: ATtiny84's eeprom writepage misses a necessary address bit a8 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11390]
avrdude-original yywarning() warning: a4 would normally be expected to be a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a3 would normally be expected to be a4 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a2 would normally be expected to be a3 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a1 would normally be expected to be a2 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: a0 would normally be expected to be a1 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: too few opcode bits in instruction [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]
avrdude-original yywarning() warning: ATtiny43u's eeprom read misses a necessary address bit a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11694]
avrdude-original yywarning() warning: ATmega32U4's eeprom writepage misses a necessary address bit a2 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11880]
avrdude-original yywarning() warning: AT90USB1286's eeprom writepage misses a necessary address bit a11 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:12275]
avrdude-original yywarning() warning: ATtiny1634's flash writepage misses a necessary address bit a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:15031]
avrdude-original yywarning() warning: mcuid -1 for ATtiny402w is out of range [0..2039], use a free number >= 372 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:15497]
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
AVR Part : AVR128DB48
RESET disposition : dedicated
RETRY pulse : SCK
Serial program mode : yes
Parallel program mode : yes
Memory Detail :
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
prodsig 0 0 0 0 no 125 125 0 0 0 0x00 0x00
fuses 0 0 0 0 no 9 16 0 0 0 0x00 0x00
fuse0 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse1 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse2 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse4 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse5 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse6 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse7 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse8 0 0 0 0 no 1 1 0 0 0 0x00 0x00
lock 0 0 0 0 no 4 1 0 0 0 0x00 0x00
data 0 0 0 0 no 0 1 0 0 0 0x00 0x00
flash 0 0 0 0 no 131072 512 0 0 0 0x00 0x00
eeprom 0 0 0 0 no 512 32 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 25.1
avrdude-original: AVR device initialized and ready to accept instructions
avrdude-original: device signature = 0x1e970c (probably avr128db48)
avrdude-original: reading input file /opt/openenergymonitor/data/firmware/emonTx4_DB_6CT_1phase_LPL.hex for flash
with 25590 bytes in 1 section within [0x200, 0x65f5]
using 50 pages and 10 pad bytes
avrdude-original: writing 25590 bytes flash ...
Writing | ################################################## | 100% 3.87s
avrdude-original: 25590 bytes of flash written
avrdude-original: verifying flash memory against /opt/openenergymonitor/data/firmware/emonTx4_DB_6CT_1phase_LPL.hex
Reading | ################################################## | 100% 2.56s
avrdude-original: 25590 bytes of flash verified
avrdude-original done. Thank you.
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: Using autoreset DTR on GPIO Pin 7
SUCCESS: flash verifed
Restarting EmonHub