I have had a emontx3 for several years. I had an issue after a power outage where it continually looped on the setup. I decided to upgrade to the latest emontx34_CM firmware from Firmware — OpenEnergyMonitor 0.0.1 documentation
I was able to update fairly easily using avrdude. However, I can not configure it using the same serial connection that I used to update the firmware. It does not seem to accept any serial input. Either the +++ command or h or l or anything else. For background, I only have the emonTx connected to the monitor via a serial connection.
I started to try and follow the process to load the code into arduino ide, but when I could not download the jeelib library, I thought I would come here.
emonTx V3.4 Continuous Monitoring V2.4.0
[18:08:14:084] OpenEnergyMonitor.org
[18:08:14:085] No EEPROM config
[18:08:14:086] Settings:
[18:08:14:090] Band 433 MHz, Group 210, Node 15, 7 dBm
[18:08:14:091] Calibration:
[18:08:14:092] vCal = 268.97
[18:08:14:093] assumedV = 240.00
[18:08:14:094] i1Cal = 90.90
[18:08:14:095] i1Lead = 3.00
[18:08:14:097] i2Cal = 90.90
[18:08:14:098] i2Lead = 3.00
[18:08:14:099] i3Cal = 90.90
[18:08:14:101] i3Lead = 3.00
[18:08:14:102] i4Cal = 16.67
[18:08:14:103] i4Lead = 6.00
[18:08:14:104] datalog = 9.85
[18:08:14:105] pulses = 1
[18:08:14:107] pulse period = 100
[18:08:14:111] RF on
[18:08:14:111] temp_enable = 1
[18:08:14:112] JSON Format Off
[18:08:14:115] RFM69CW Freq: 433MHz Group: 210 Node: 15
[18:08:14:117] USA Vcal active: 130.00
[18:08:14:119] Factory Test
[18:08:15:685] NO CT's detected
[18:08:15:919] Temperature Sensors found = 0 of 3
[18:08:15:922] Temperature measurement is enabled.
[18:08:15:922]
[18:08:17:933] AC missing - Apparent Power calc enabled, assuming 240.00 V
[18:08:18:002] MSG:1,Vrms:240.00,pulse:1
[18:08:27:856] MSG:2,Vrms:240.00,pulse:1
By this, do you mean you aren’t using the radio at all? In that case, by not defining the radio format at all in line 55 (i.e. comment the line)
#define RadioFormat RFM69_LOW_POWER_LABS
it should compile for you.
Where did you look for JeeLib? It’s here: GitHub - jeelabs/jeelib: JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs and we also have a copy here GitHub - openenergymonitor/jeelib: JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs
How to install the Arduino IDE and libraries is here: Using the Arduino IDE — OpenEnergyMonitor 0.0.1 documentation but it hasn’t been updated to add the location of our copy of JeeLib nor emonLibDB and LowPowerLabs library.
(@Gwil - can you look please?)
The sketch should enter config/calibration mode if you send it exactly 5 characters: +++[cr][lf]
(in that order). Don’t sent it ++s[cr][lf]
- it won’t echo anything back to you, ‘s’ means silent. Depending on the monitor you’re using, it might be sending [lf][cr]
or only [cr]
or only [lf]
. I assume you’ve got the correct baud rate (115200) so you’re seeing output?
1 Like
Thanks Robert. This helped point me in the right direction. I was able to get the sketch to compile in the arduino ide. It seems the latest code can change the configuration at any point.
My big issue was that the code looks for \n as the end of transmission. Apparently putty is only sending \r. The arduinio ide serial monitor lets you configure the line endings. In putty I am using Ctrl-J to terminate the line.
1 Like
Somebody has changed it since I wrote it - obviously it’s thought a good idea to allow any random stuff that comes along to try to change the options and calibration…
I was aware some terminal software didn’t send both [cr]
& [lf]
, hence my note.
Just to close the loop here, I also believe there is a bug in the emontx3/emonTx34_CM.ino file where EmonLibCM_ReCalibrate_IChannel is called with the wrong value in the first parameter. I submitted this as an issue to the project for others to look at.
I think the link is incomplete - it takes me to the contents page for the emonTx3.
Which emonTx V3 do you have? Several times you mentioned emonTx V3.4, now you’re looking at V3.2 software. I’m getting confused.
Also, why do you think it is wrong? I don’t understand and don’t have access to Github so if you want me to look into it, you need to write it out in plain English here.
[Edit]
At first sight, it does indeed appear to be totally wrong. Unless there’s been a redesign of the emonTx V3 (both versions) that I’m unaware of, it appears Trystan has forgotten how many voltage inputs the emonTx V3.2/V3.4 has (or doesn’t have!). I think you’ll find the ‘max’ demonstration sketch, which is the only thing I’m responsible for and is part of the emonLibCM download, is correct.
Yes, in my haste yesterday I linked to the 3.2 firmware, but as you mention the 3.2 and 3.4 are the same.
I was setting calibration values for 3.4 but the readings were not coming back as I expected. I then found in the forum another post that linked me to your library and calibration sketches. With those, it was working as expected. When I took those values back to the emonTx code, it wasn’t. At that point I looked at the code and found the issue - changing it seemed to fix it for my device and thought I’d share it as much to double check I wasn’t missing something and to help anyone else that comes afterward with calibration issues.
As an explanation, in emonTx34_CM.ino it calls EmonLibCM_SetADC_IChannel for 1 through 4. However, in emonTx34_CM_config.ino it calls EmonLibCM_ReCalibrate_IChannel for 3 through 6
My guess is, it was copied and pasted from a sketch for the emonTx4 using emonLibCM, which has 3 voltage channels (0 - 2) and the current channels start at 3, without enough thought being applied to the process. As the initial setup SetADC_IChannel(...)
in emonTx32_CM.ino is correct, and the ReCalibrate_IChannel(...)
takes the same parameters (it even says this in the documentation) there’s hardly any excuse.
Note, emonLibDB adopts a different numbering strategy, so users must consult the documentation and examples released with the library in this forum (as always, and not rely on sketches that have clearly not been thoroughly tested).