Yes.
Do it in the process list of P2, as I explained above. When you’ve done all you need to with P2 on its own, do a Reset to original and then add the Feed where you logged P1. then log it to a Feed.
A minus sign has crept in somewhere?
Yes.
Do it in the process list of P2, as I explained above. When you’ve done all you need to with P2 on its own, do a Reset to original and then add the Feed where you logged P1. then log it to a Feed.
A minus sign has crept in somewhere?
I’m curious… How is it you know about Grape’s issue?
I have two accounts, as it appears. Sometime ago I created the first one and read the blogs and was quite impressed. After much time, a situation arose when, in order to effectively create an emergency preparedness checklist, I felt was necessary to have data on energy usage. Remembering the great work of OpenEnergyMonitor, I decided to buy equipment from them, but forgot that I had an account, thus opened a new one. It appears that I have logged in on the first account. Now all I have to do is figure out how I did that.
I’ll go back to being Grape.
I did some investigating and some experimenting.
I found that all of the circuits on L2 have a negative power.
If I turn off all the circuits except for the EV charger circuit, P8, the power for it is the negative of P2 (CT8 is on the wire of the L2 bus).
In addition, which doesn’t make sense, is that P1, the L1 bus, has that same power as P2, which would contradict @Robert.Wall .
How do I correct this?
You originally wrote that you’d oriented your c.t’s according to Part 1 of Use in North America, for the emonTx V2 & V3 and the emonPi 1. Did you swap them round for the emonTx V4+ and emonPi2 in Part 2 of that page?
Agreed.
Do both your voltages read about 120 V, but are slightly different?
Have you edited your sketch? Have you accidentally got the same Voltage input for both P1 & P2?
Have you got this:
EmonLibDB_set_pInput(1, 1); // CT1, V1
EmonLibDB_set_pInput(2, 2); // CT2, V2
and not
EmonLibDB_set_pInput(1, 1); // CT1, V1
EmonLibDB_set_pInput(2, 1); // CT2, also V1
and not
EmonLibDB_set_pInput(1, 2); // CT1, V2
EmonLibDB_set_pInput(2, 2); // CT2, also V2
Yes, I did
yes
While I did compile the sketch I opted for moving my CTs and circuits around to match the default. I had previously uploaded emonSD-01Feb24
Previously I noted that the EV circuit (P8) and P2 (of L2 bus) were the same though opposite signs. That value was 3.6kW. I did some investigation and found that the EV charger was set to deliver 30A, which at 240V is 7.2kW.
So It would appear that the 240V circuits are not using V1+V2 in determining the power. Where in emonSD or in emonCMS would one configure 240V circuits?
I thought I’d told you that, early on in this thread. You name both voltages in the API call, so it’s edit, recompile and upload again.
Yes I did - post no.18, and repeated it in post no.21 It’s in the sketch itself too, as a comment/example.
Thank you, I see that!
In order not to assume, the API is something like
EmonLibDB_set_pInput(CT, line [,line2]);
where line2, if missing, is neutral.
The sketch has the commented out lines, ~276-278 :
EmonLibDB_set_pInput(3, 1, 2); // CT1 between V1 & V2
EmonLibDB_set_pInput(2, 2, 3); // CT2 between V2 & V3
EmonLibDB_set_pInput(3, 3, 1); // CT2 between V3 & V1 (etc)
Which I think should be:
EmonLibDB_set_pInput(1, 1, 2); // CT1 between V1 & V2
EmonLibDB_set_pInput(2, 2, 3); // CT2 between V2 & V3
EmonLibDB_set_pInput(3, 3, 1); // CT2 between V3 & V1 (etc)
OK, now I have make appropriate changes and bite the bullet in sending the binary to my emonPi2
Thanks!
This is the command that the Arduino IDE used to upload:
"C:\Users\uname\AppData\Local\Arduino15\packages\DxCore\tools\avrdude\6.3.0-arduino17or18/bin/avrdude" "-CC:\Users\uname\AppData\Local\Arduino15\packages\DxCore\hardware\megaavr\1.5.11/avrdude.conf" -v -pavr128db48 -carduino -D -PCOM6 -b115200 "-Uflash:w:C:\Users\uname\AppData\Local\arduino\sketches\16B9745DD515182E89A8D7E7E22B5F98/emon_DB_12CT_v1.ino.hex:i"
And this is the (abbreviated) response:
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\uname\AppData\Local\Arduino15\packages\DxCore\hardware\megaavr\1.5.11/avrdude.conf"
Using Port : COM6
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
.
.
.
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xef
And then the emonPi2 is stuck at starting...
but sometimes not
What can I try now?
Hello @Grape did you try using the emonPI2 firmware upload tool? Just drop in the compiled hex that the Arduino IDE compiled there, select ttyAMA0 and emonPi2 to bring that custom upload option up, see: Local emoncms custom firmware upload option
The third parameter is optional. You really should refer to the emonLibDB documentation - this would save a day waiting because of the time difference between you and the UK.
You’re right - but I assume that’s from Github and I have no control over that. All the example sketches I’ve published are like this:
/*
EmonLibDB_set_pInput(1, 1, 2); // CT1 between V1 & V2
EmonLibDB_set_pInput(2, 2, 3); // CT2 between V2 & V3
EmonLibDB_set_pInput(3, 3, 1); // CT3 between V3 & V1 (etc)
EmonLibDB_set_pInput(4, 1, 2);
EmonLibDB_set_pInput(5, 2, 3);
EmonLibDB_set_pInput(6, 3, 1);
EmonLibDB_set_pInput(7, 1, 2);
EmonLibDB_set_pInput(8, 2, 3);
EmonLibDB_set_pInput(9, 3, 1);
EmonLibDB_set_pInput(10, 1, 2);
EmonLibDB_set_pInput(11, 2, 3);
EmonLibDB_set_pInput(12, 3, 1);
*/
The image on that page has:
" - or - upload custom firmware to emonPi2 on ttyAMA0: Browse...
emon_CM_6CT_current_only.ino.hex" which is not on my page. I do see that there needs to be “changes to both EmonScripts (v2.3.11) and emoncms core (v11.5.6)”
Clicking on [Full Update] appears to do nothing …[Update Emoncms] does appear to update and after the update completes, the aforementioned line appears Clicking on
Choose File
(formerly Browse...
) I traverse to the directory C:\Users\uname\Documents\Arduino\emon_DB_12CT_v1\build\DxCore.megaavr.avrdbopti find the hex file compiled by the Arduino IDE and select it.
The log indicates something to the effect, “first time custom firmware, setting upload, please select the upload again”. I select the upload again. … nothing happens. I click on [Update Firmware] an update occurs, but, in viewing the update log, it looks like the update used is the one on the dropdown box.
I select my file again … nothing happens. I select a previous version that was created by the Arduino IDE and it updates, without clicking on [Update Firmware]. I select my current version and this appears to update, again, without clicking on [Update Firmware].
Now I notice that the display on the emonPi2 is not displaying “emonPi2 starting …” But, it still reboots.
(just documenting my oobe)
Now the powers shown in Inputs are really wrong! Way off. I suspect the the CT calibrations were affected.
At this point I made a fresh SD card, and updated Emoncms.
I modified emon_DB_12CT
changed Set hardware variant to EMONPI2
changed number of voltage channels to 3
changed Link voltage and current sensors
The main feeds, L1 and L2, power are calculated Vn-N times CTn
240V circuits power are caclulated V1-V2 times CTn
120V circuits power are calculated Vn-N times CT depending on the bus (L1 or L2)
change Default calibration values
CT calibrations defaults set to match installation
Enable on-line calibration when running left true
compiled and uploaded it
Back at the inputs page I see that P1 is 3321, P2 is 3312, P8 (EV charger) is 6587. I see -4 on P12 all the rest are 0 to 4. I have to check to see if the 120v circuits on L2 are negative (P10 is on L2)
P12 was associated with the wrong V.
All is good at this point!
Thanks for all your help!
In all honesty, while Trystan’s efforts to do as much as possible through a GUI are laudable, in the long run this method is probably the more obvious and arguably the simplest, once you have the tools set up. Remember to never update back to the default via emonCMS
After gaining all of the experience that I needed when I started this project, I would have to concur @Robert.Wall . The most intimidate part is setting up the libraries in the Arduino IDE and then configuring the board. (We did discover one configuration that wasn’t documented, comment 29 by @TrystanLea )
I did find my errant minus sign, I had a CT paired to the wrong V. I wanted to get this right so that my progeny will learn more easily. Getting the documentation, hardware and software (and vice-versa-vice) matching is always a big job. I’ve already started my documentation, the purpose of which is to make it easier for the next person’s oob, and, hopefully, easier for those who helped me.
Thanks again!
Mine has always been the default: 1 x Wire, Master or Slave (least Flash & RAM) and it seemed to work while I was testing the library.
7.2 kVA, but likely not 7.2kW.
I’d say it’s a fair bet the resultant EV charger waveform is not a clean sinusoid.
@Bill.Thomson Right! I’ve got to watch my P’s and Q’s here!
In the sketch emon_DB_12CT.ino I find the line:
// Enable on-line calibration when running.
bool calibration_enable = true;
I remember reading about it but cannot find the page again. As I remember one sets it true to set the calibration constants and then change it to false once they are set. But that’s my memory so I’m not sure what it does.
What does it do and how do I use it?
It was intended to recalibrate the internal reference bandgap against an external precision reference as the unit operated to mitigate any drift. However, on the Tx5, there is too much capacitance on the precision reference so it oscillates. Also, the calibration takes quite a bit of time.
Consequently, this variable does nothing - it’s not used anywhere in the firmware.
Good to know! I’m up and running! … though there is one quirk …