Community
OpenEnergyMonitor

Community

How to configure in USA

Tags: #<Tag:0x00007fc9c4053238>

EmonPi
Have Grid on P1
Solar on P2

EmonTX
Have Grid on P1
Solar on P2

Is above the best way?
How do I configure PV Type 2 with inputs
Says:
If using emonTx then the power values from multiple CT inputs can be summed in Emoncms using + feed Input Processor.
How?

Do I have to put Grid on emonpi and Solar on emontx?

What is the correct way?

I presume you have looked at the “Use in N.America” page and you have the emonPi on one leg and the emonTx on the other.

I don’t think there will be a “correct” way as such - the right way is the one that works.
That’s because in general, the OEM system has been designed with the UK’s single phase system very much in mind, whereas although you have single phase too, it’s split and centre-tapped to earth.

One think you might like to consider when deciding which apparatus to use where, is the emonPi and the emonTx won’t take their readings synchronously, so the data from one could be up to 10 s “old” compared to the other.

Like it says, in emonCMS on the “Inputs” page, against each input you’ll find a spanner icon. Click it and you’ll get to “Add a process”. Expand the first drop-down list and some way down there’s “+ feed”. Nominate the feed to add, it makes no difference where the feed has originally come from (there’s another drop-down list to pick it from - you need to have created it first of course). You will need to move it up the list so that it’s above any common processing that you do on the resulting sum of the two feeds. Remember to save before exiting.

Would be nice to use only one but only use 3 inputs on emontx as 4 is different.
Can I change emonpi to 10s do not see how if Type2 Solar generator of feeds.

You can relatively easily convert input 4 of the emonTx to the same sensitivity as the others: Add a wire-ended 27 Ω resistor in parallel with the fitted 120 Ω SMD resistor just behind the c.t. socket - then adjust the calibration for that input to be the same as the others.

You can change the emonPi to a 10 s reporting interval, but it means downloading the front-end sketch, edit it and then reload it into the emonPi. It’s a fairly roundabout procedure, My notes say:
Updating emonPi sketch:
If you do want to change the firmware, it’s best to compile the Arduino sketch on your PC then transfer the .hex to the emonPi and upload directly from the RaspberryPi using avrdude. Emonhub will need to be stopped to free up the serial port. See example script to upload .hex https://github.com/openenergymonitor/emonpi/blob/master/firmware/compiled/update

#!/bin/bash
sudo service emonhub stop
avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:/home/pi/emonpi/firmware/compiled/latest.hex
sudo service emonhub start

BUT I’m fairly certain that’s out of date. The file location in the Pi is now /opt/openenergymonitor/emonpi/firmware/compiled/latest.hex

1 Like

Thanks Robert

I have by sheer coincidence just got working a script to copy the compiled front end file from a (Linux) computer to load it into the front-end processor in the emonPi. To use it, get and edit the sketch, compile it with the Arduino IDE but use the “Export compiled binary” option instead of “Upload”. That will put the output .hex file alongside the source.
Then you’ll want to make a keyfile pair and upload as per the comment in the script (removes the need for passwords with every command), and change the path in the source computer and the address of the Pi as appropriate, but the file becomes nameless when it’s uploaded into the processor, so the actual name of the .hex file doesn’t matter.

For what it’s worth - here it is:

#!/bin/bash

#Generate a SSH key pair with "ssh-keygen" Don't set a password.
#Copy to the Pi with "ssh-copy-id [remote-id]  e.g.remote-id = '[email protected]', password "emonpi2016" is required ]
#Needs SSH & SCP on source machine. Avrdude should exist on the Pi.

remotemachine='[email protected]'
sourcefile='/home/r/OpenEnergy/Software/rfmNATIVE/EmonPiCM_radio/emonFrontEndCM/emonFrontEndCM.ino.standard.hex'
targetfile='/opt/openenergymonitor/emonpi/firmware/compiled/emonFrontEndCM.ino.standard.hex'

echo This can take about 45 seconds to complete
echo

scp $sourcefile $remotemachine:/opt/openenergymonitor/emonpi/firmware/compiled

ssh $remotemachine sudo service emonhub stop

ssh $remotemachine avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:$targetfile

ssh $remotemachine sudo service emonhub start

exit

I did warn you. :wink:

I’ve successfully installed pio on an RPi and then compiled the CM firmware. The extra script has been added to the emonTX CM repository.

What file do I need to change and any other changes need for USA?
and what files do need to download for /Software/rfmNATIVE/EmonPiCM_radio/emonFrontEndCM/emonFrontEndCM.ino.standard.hex

Do you mean to calibrate your emonTx after you’ve changed the value of the burden? Do you have a programmer?

If you do have a programmer, you need to download the default sketch (comprising 3 files, the main one is “EmonTxV3CM.ino” from Github, change the value of i4Cal to 90.91 (line 98 or so), compile and upload to the emonTx. Then ignore the change to P4 & E4 in emonhub.conf that follows. All those calibration constants assume our YHDC SCT-013-000 c.t., if you have a different one, the relevant constant(s) will need changing.

If not, the best place is in emonHub.conf - when you get your emonPi working. Find the section for your emonTx, and there is the specification that allows it to decode the data that the emonTx sends. It should be

[[15]]
    nodename = emontx3cm15
    [[[rx]]]
       names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,L,L,L,L,h,h,h,L
       scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
       whitening = 1

If you get silly numbers for the energy, you need to change the ‘datacodes’ line to

      datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L

Notwithstanding that, the names, datacodes, scales and units all have a 1:1 relationship left to right, so to change the scale of the 4th input, you must change the scale of “P4” (for the power) and “E4” (for the accumulated energy). These will be the 6th & 10th items in the “scales=” line. Change the “1” to 5.44 ( = 120 / 22 where 22 is the 120 Ω & 27 Ω in parallel).

That is my new not-yet-released CM version for the emonPi. Like I said, you must substitute the paths and filenames for the one you compiled from this step:

Your ‘sourcefile’ will have the path where you downloaded the source, and the name of the file you downloaded - suffixed with “.hex”; your ‘targetfile’ should have the same path as mine and the same filename as the sourcefile.

This is what would like to change emonPi to a 10 s
What code do need and what file do need update?

A few words went missing there, I think.
The source for the Atmel '328P front end is on Github: https://github.com/openenergymonitor/emonpi/tree/master/Atmega328
and you need all the .ino files in firmware - the line to change is

const int TIME_BETWEEN_READINGS=  5000;   

in firmware.ino.