Newbie questions About Emon PI

Hi.

For some time that I've reading this website pages to get more information about Emon PI and I have a few question that I would like to have answers for...

Since I would like to spend the least money I can, what are the real differences between Emon Pi and Emon Pi - Solar PV, is it only the additional clip-on current sensor CT?

I've read that the AC-AC transformer shell be connected in a "socket outlet within approx. 1 m of the electricity supply meter or distribution board / consumer unit". In my case I would connect it in the same cable that goes to the Solar PV inverter and will be approx. 1m form the distribution board in a box where I will put the EmonPi hardware (without the aluminum box). Is there a problem with connecting the AC-AC transformer this way? Shell I get a separate line from the sockets breaker for it?

I have some other questions, that I will certainly ask in the future... For now this two.

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

As far as I know, there's only one hardware version of the emonPi, so for additional clarification I suggest you email the shop.

The 1m distance is the approximate length of the low voltage cable on the ac adapter. There's no other reason to restrict the placement of the adapter, and as there's next to no current drawn, you could if you wanted extend it significantly. Obviously, it should measure a representative voltage, i.e. don't put it at the end of a long heavily and intermittently loaded spur where the voltage will jump about due to the effects of one load. But you still need a separate 5 V dc adapter to power the Pi, so budget for two socket outlets.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Thank you for your answer.

So, from what I understand from you answer, there is no problem to connect the AC-AC transformer and the 5V USB power supply on the cable that comes from the inverter after the sensor clip.

My idea is to clip the live/positive wire that comes from the solar panels Inverter (in the box where I will put all the material) after the clip create an shunt with two simple outlets for the transformer and the 5V power supply.

Continue with the cable to the distribution board along with the cable to the second sensor clip (the one to put at the line cable that comes from the consumer unit) and connect the cable to a breaker for the solar system.

Is this the correct approach?

The sensor has one meter of cable, can we extend this cable or is it a case where the measurement precision will suffer too much because of that?

Best Regards.

Bill Thomson's picture

Re: Newbie questions About Emon PI

what are the real differences between Emon Pi and Emon Pi - Solar PV

Could he be referring to this? http://shop.openenergymonitor.com/emonpi-solar-pv/

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I'm referring exactly to that product compared with this one:
http://shop.openenergymonitor.com/emonpi-1/

What are the physical/logical/real differences?

I haven't noticed the note "Expected release date is 30th Sep 2015" before, it gives the idea that these are new products that aren't available yet, but I've seen videos made by users that are already using this products, strange...

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

Let's deal with the power wiring first. We have two standard configurations, they are shown here. From what you write, I think you're describing a "Type 2" system, so your PV infeed will be a spare MCB on your distribution board.

Personally, I would not supply the Emon system from the same breaker that your inverter is connected to, because if you need to isolate it for any reason, you'll lose all monitoring. But if that's OK with you, you can do it that way. Don't say "create an shunt", because "shunt" has a quite specific meaning to us and I hope it's not what you mean here.

What you need to end up with is the "grid" CT sees the nett current flowing to or from the supply grid, and the "PV" CT sees only the current from your inverter.

For the CT, provided it is the 100 A YHDC one, 10 m shouldn't be a problem, and it can't lose accuracy because it works on current. Get a length of two-core screened "microphone" cable, e.g. something like http://spiratronics.com/cable-and-connectors/cable-and-wire/screened-aud...
At the Pi end, don't connect the screen and use the two inner cores, connecting to tip and sleeve of the plug (which you've taken off the CT). At the CT end, earth the screen to your mains earth, on the CT cable, forget the screen and connect the red and white wires to the cores of your new extension cable. Solder the joints if you can, otherwise a small screw terminal block is fine.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

First of all, thank you for taking the time to answer my questions.

About the  Emon Pi - Solar PV, I already know that the difference is in fact the addition of a second CT sensor.

My installation is the TYPE 2 of the link you referred and I will add an circuit breaker (or check for a free one) in the distribution box for the solar system.
About powering the EmonPi on the same breaker, I will add a small power bank between 5V power supply and the EmonPi to act as an UPS and prevent SD card corruption on power failures (I have used Rasps before, and know that happens), at the same time I can switch the breaker off for a while without cutting the power to the EmonPi.
About the shunt, as you can see my English is very poor and I may have use the inappropriate word for the situation. What I want to do is some kind of connection with 2 outlets for the transformer and power supply.
My main concern is where the AC-AC transformer is connected to. I know that if we don't take in account the wires' resistance and the breakers, virtually all the installation is in parallel, but I don't fully understand what will the reading be from the AC-AC transformer to know if it makes any difference for it to be connected at the inverter cable or at another outlet closer to other consuming appliances or closer to the grid input.
About extending the CT sensor cable, I think I understood your explanation, by wire screen you mean wire braid/mesh, don't you?

A new question:
Since the CT Sensors are 100A (and at least in my case it will never pass 30A), wouldn't it be a good idea to pass the live wire twice (or even 3 times) around the CT sensor to double (triple) the reading and tell the software to divide it by two (or three) and this way obtain a more accurate reading?

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

If your installation is properly designed, where you connect the ac adapter will make very little difference. Having it close to the distribution board will be better, but not essential.

Yes, it will be a good idea to use a 2 or 3-turn primary winding for your CT.

The cable "screen" is, in the picture on that catalog page I linked to, the silver strands immediately under the outer black cover that surround the inner red and black wires.

Don't worry about using the wrong word, in the UK we would use a "2 gang socket outlet" to connect both dc and ac adapters.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I was referring to connecting two of this
http://www.fermat.co.ao/fotos/produtos/121160_735005050548f188d15439.jpg
on the cable inside my box to connect the transformer and power supply.

Best Regads.

dBC's picture

Re: Newbie questions About Emon PI

know if it makes any difference for it to be connected at the inverter cable or at another outlet closer to other consuming appliances or closer to the grid input.

I think it depends on how big your PV system is, how long the cable run is from there to the distribution panel for the consumer circuits and the grid, and how over-rated that circuit is.   To give you an extreme example, if I load up my kitchen circuit (20A breaker) with 21A worth of appliances, I see a full 9.5V drop down that leg.  I think that works out at about 1/2 ohm resistance in the breaker+wiring, and means they're dissipating an impressive 200W under those conditions.  Something is probably getting warm, I suspect the breaker as it warms up its thermal trip mechanism.

Your setup is the opposite to that.   By picking up the voltage right as it comes out of your inverter you'll potentially see a higher voltage when it's sunny, but only to the extent of the voltage drop across that run from your inverter to your distribution panel.  If for example you had a massive PV array on the roof of a very distant shed, and a long run from the inverter back to the house, then the voltage you read down at the shed could be a bit higher than the voltage the house is seeing.

Robert Wall's picture

Re: Newbie questions About Emon PI

"I was referring to connecting two of this"

I have never seen one of those before. I cannot see what it does, so I think I have not understood what you are trying to do.

Voltage drop and cables:
Yes, dBC is right. In the UK our regulations list the voltage drop for each cable size in millivolts per amp per metre, therefore if you know how long the cable run is, and the current, you can calculate the voltage drop. Here are the tables, which give current ratings as well as volt drop: https://www.tlc-direct.co.uk/Figures/Tab4.6.htm or https://www.tlc-direct.co.uk/Figures/Tab4.7.htm (for unsheathed single core or sheathed multicore cable - the volt drop is of course the same).

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

LOL.

Robert, I didn't thought you wouldn't recognize an European plug, but I forgot you there have those funny plugs...

The image I posted is a cable mount female to connect the "Type C (CEE 7/16 Europlug)" shown in this link, that will be the kind of plug found on the AC-AC transformer and the 5V DC power supply.

https://en.wikipedia.org/wiki/Mains_electricity_by_country

In Portugal we use this types:
Type C (CEE 7/16 Europlug)
CEE 7/17 2-pin plug & CEE 7/1 socket (Only the male version)
Type F ("Schuko") CEE 7/4 plug & CEE 7/3 socket
and
CEE 7/7 plug, (combines earthing methods of Type E & Type F)
 

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

It's not us who have funny plugs, it's you.

I think you probably want something like this then. It would not be a good idea to use a cable mounting female connector on a permanent installation.

[A serious point: had you put your country on your member's profile, I would have known more about your wiring, mains voltages etc.]

CidiRome's picture

Re: Newbie questions About Emon PI

Hi,

I can't find country setting in the profile, only the time zone.

I have limited space in the installation in the box, I have to fit in this material:
Base EmonPi (without case);
AC-AC transformer;
5V DV Power Supply;
Transformer cables for the AC-AC T. and 5V P.S.
USB Power Bank
Sockets for the AC-AC T. and 5V P.S.
CT sensor for the solar cable;
Excess length of some cables, including the ethernet one;

The kind of outlets I referred don't represent any kind of hazard and average quality ones make good connection. It will be more than enough for the purpose, it is not a professional installation and I've seen far worse out there...

Anyway I will probably pass a separate cable for the AC-AC+5V DC from the electrical outlets section breaker as suggested.

Best Regards.
 

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I've got all the hardware I need now.

I want to calibrate the sensor readings before starting using.

Is there a step by step how to for EmonPI?
I've seen one guide for emonTx, but it is a bit vague about where we put the values and I don't know if it applies the same way to EmonPI.

I'm thinking about passing the line wire a few times in the CT sensor to get more accurate readings, where do I configure this? (Since it is a 100A sensor and at the Mains line I will get at most 30A and at the solar not even 5A, I think it would be good to do that)

Thanks in advance for your tips.

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

To calibrate the emonPi in the same way as you do the emonTx, you must either install the Arduino IDE on the Pi, edit the sketch and then copy the compiled file into the correct place, or compile the sketch externally and transfer it to the Pi.

If it's only a scaling problem with your current, it's probably a lot easier to do the scaling inside emonCMS, i.e. multiply the power by 0.2 assuming a 5-turn CT primary winding.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Thank you for your reply.

You seem to imply that there is other way to calibrate that is not the same as emonTx.

I assume that it is a good practice to calibrate it, what is the easiest way to do it?

I have most things I need to do the calibration (eg. multimeter and Load), I assume that I will still need this things to calibrate the EmonPi, Is there a how to for this procedure?

I bought the bulk EmonPi because I have a spare rasp, an AC-AC transformer and a 100A CT sensor. Maybe the full EmonPi comes calibrated to be used with the supplied peripherals, but at least for me this is not the situation. 

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

The emonPi front end is a cut-down emonTx, so the same procedure applies. The difficulty will be operating the Arduino IDE unless you have a keyboard and screen attached.

If you are only interested in real power, then as I said, the easy way is to do it inside emonCMS and on the Input page, multiply the power by an appropriate factor. (See the emonCMS documentation.)

CidiRome's picture

Re: Newbie questions About Emon PI

The main purpose is to monitor the grid vs solar panels consumption, but I would like to have accurate readings at least of Voltage.

Are you saying that for this purpose I don't need to calibrate the readings?

You said that I cannot operated Arduino IDE without Screen / keyboard, can't that be done by SSH, or if graphical something like VNC?

This is pretty new to me, but I'm a computer geek and I believe that with the right documentation and help from experienced users I can do it.

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

I'm only just getting to grips with the emonPi myself, so I can't help you with the finer details.
The voltage calibration should be no worse than ±6%, and hopefully somewhat better than that.

(Details are here: Sources of error in the emonTx voltage and current inputs. Look at the EmonTx V3 values - the emonPi is essentially the same.)

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

After my last post, with the default configuration (without any changes) I get Voltage readings about 4 to 5 V above my multi meter readings (it is an UniVolt that states that it is True RMS Multi-meter with new batteries) and about about 3V above the reading of a Veleman power meter I have.

I'm using a 9VAC 1A transformer from a retired Dlink Router.

I will investigate my way, the problem is that I can't find many information about the EmonPI, it is all about EmonTX and I don't know where to go for accurate literature for my project.

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

"The emonPi front end is a cut-down emonTx, so the same procedure applies."

Did you miss that? All the information is in the same sort of places - Github and the Wiki. What more do you need?

CidiRome's picture

Re: Newbie questions About Emon PI

I'm reading http://openenergymonitor.org/emon/modules/emonpi that is the best information I found until now about configuring the EmonPi but haven't get yet to any information about calibration (it must be there).

I think that, even the information to calibrate EmonTx is vague.

A step by step with command line instructions on how to install the Arduino IDE, what files to edit, etc etc, would be a very important plus for this project that would help the ones that are not familiar with arduino or this project.

This is only my first day making tests, with patience I will get there.

Can you please point me to the correct documentation about this:

If you are only interested in real power, then as I said, the easy way is to do it inside emonCMS and on the Input page, multiply the power by an appropriate factor. (See the emonCMS documentation.)

 Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

We do assume that anyone who feels the need to calibrate the Emon system will have the necessary equipment and with that sufficient general knowledge about basic electrical engineering. What is vague about the step-by-step instructions?

Regarding installing the Arduino IDE, how are the instructions here not complete?

The instructions for configuring the inputs are in the emonCMS Input API Help, which you should see on the Input page - in short, click on the spanner and add the process ×.

CidiRome's picture

Re: Newbie questions About Emon PI

OK, I will read an make tries and later I will post my (more) specific questions if I still have them...

One thing that keeps me intrigued is what you say about calibration

anyone who feels the need to calibrate the Emon system will have the necessary equipment

I general I would think that calibrating the devices to get the most accurate readings possible should be the first step, but you don't seem to think like me.

In general, I would expect a section in EmonCMS where we would put the real different readings at the several moments so it would calibrate automatically based on that real readings.

Best Regards.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I've found the files and made the changes to correct the readings.

Now I can't find information on how to build/compile the .ino file.

I can find information about compiling the whole project with the "ino build" command but to do that some kind of project file should be present and I can't find it, and also I'm not being able to find info on how to compile a single .ino file.

If I cannot find the required information I will try to install the Arduino IDE on Windows to compile the .ino file, transfer the .hex to the PI and upload it from there, but it seems to be extra work that shouldn't be needed.

Best Regards.

CidiRome's picture

Re: Newbie questions About Emon PI

Update:

I've given up compiling through the command line and installed the IDE on Windows.

After that a lot of libraries that were missing and I find info about, but compared with EmonTX one is missing in the instructions:
Arduino-LiquidCrystal-I2C-library

I download it and I'm still getting errors:
 

emonPi_Serial_LCD.ino: In function 'void emonPi_LCD_Startup()':
emonPi_Serial_LCD:4: error: 'class LiquidCrystal_I2C' has no member named 'init'
'class LiquidCrystal_I2C' has no member named 'init'

There are a few LCD libraries, I used the above one, isn't it the correct one?

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

The correct library to use is specified in the comment in the sketch alongside the respective "#include".

[Note: if a sketch needs a different library to the standard ones, it is always listed in the comments near the top of the sketch.]

But for some reason, the zip download extracted 'flat' and did not keep the directory structure, so I had to move files and folders to restore the structure.

You must remove "-master" from the directory name.

Then, the sketch compiles for me on my laptop with no errors.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

This was the missing file library

https://github.com/openenergymonitor/LiquidCrystal_I2C1602V1

I made a few errors:
- Didn't noticed that it was mentioned at the include;
- Didn't noticed that openenergymonitor github has more than one page;

- The github search didn't helm me, I was searching in the right place;

Now I get:

Sketch uses 18,958 bytes (58%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,461 bytes (71%) of dynamic memory, leaving 587 bytes for local variables. Maximum is 2,048 bytes.

I'm in the right track, I can now calibrate my Pi.

One unrelated strange thing that happened to me:
Yesterday the EmonPi stopped working: emonCMS started giving Mysql errors and things like that. After a while I found that the line in the next quote was missing from /etc/fstab causing the problem, I didn't change it, what could have cause the problem?

/dev/mmcblk0p3  /home/pi/data   ext2    defaults,rw,noatime                   0    2

 

 

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Updates for tonight.

I've made changes and now understand how the avr programing works and can compile changes I've made.

But cannot flash them (emonhub and emonPiLCD are stopped when I try to program)

avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:/root/emonPi_RFM69CW_RF12Demo_DiscreteSampling.cpp.standard.hex

avrdude: Version 6.1, compiled on Jul  7 2015 at 13:18:47
         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/ttyAMA0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xfc
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x8e
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x8e
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x8e
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xfc
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x70
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0

avrdude done.  Thank you.

It doesn't seem to be able to communicate with the AVR to program.

Any ideas?

Best Regards. 

pb66's picture

Re: Newbie questions About Emon PI

There seems to be something wrong with your "rpi-avrdude" setup, each of those line should start avrdude-original. The name isn't important but it tells us the AVR probally isn't getting a "reset" signal via the gpio.

see Upgrading RFM12Pi Firmware Direct from the Pi

Paul

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Thanks for the information.

Since I used an original ISO for Rasp + EmonPi, I thought that avrdude would be already fine tuned for this, guess it isn't...

Anyway, the instructions are for RFM12Pi V2, do they apply the same way for emonPI?

I did the instructions until line 10 and it doesn't seem to work... here is the output:

root@emonpi:~# avrdude -v -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:r:/root/aaa.hex

avrdude-original: Version 6.1, compiled on Jul  7 2015 at 13:18:47
                  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/ttyAMA0
                  Using Programmer              : arduino
                  Overriding Baud Rate          : 115200
avrdude-original: Using autoreset DTR on GPIO Pin 7

Update:

I noticed that the programer is not arduino on this instructions, and changed it to avrispmkII

Now I get this output:

root@emonpi:~# avrdude -v -v -c avrispmkII -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:r:aaa.hex

avrdude-original: Version 6.1, compiled on Jul  7 2015 at 13:18:47
                  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/ttyAMA0
                  Using Programmer              : avrispmkII
                  Overriding Baud Rate          : 115200
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
                  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 : STK500V2
                  Description     : Atmel AVR ISP mkII
                  Programmer Model: Unknown
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_command(): failed miserably to execute command 0x03
avrdude-original: stk500v2_getparm(): failed to get parameter 0x90
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_getsync(): timeout communicating with programmer
avrdude-original: stk500v2_ReceiveMessage(): timeout
avrdude-original: stk500v2_ReceiveMessage(): timeout
^X^CTraceback (most recent call last):
  File "/usr/bin/autoreset", line 42, in <module>
    process()
  File "/usr/bin/autoreset", line 36, in process
    if hasattr(e, 'errno'):
KeyboardInterrupt

 

 

 

 Any more ideas?

 

 

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I made a post before this one that vanished !?!? with info about my tries on programming the emonPI firmware.

I have a now few questions:

Based on this sentence: "Modify the autoreset script to use the pin that you wired up to the reset pin. See the line in autoreset where we do "pin = 4" and change the 4 to your gpio pin number."
Do I need to make any connection from the PI to the Emon board?
If not, what is the correct pin number I should configure?
If yes, from where to where?

I've tried 4, 7 and 11 with no luck (at least 4 required the next change to avoid an error)

Is the change "setmode(GPIO.BOARD)" to "setmode(GPIO.BCM)" necessary?

I expected this programming to be something "out of the box" like it is explained on the EmonPi wiki page, but somehow this easy task is failing...

Best Regards.

pb66's picture

Re: Newbie questions About Emon PI

Pin P1-7 is permenantly connected via the gpio for the reset line, the pin 4 or 7 were different ways to reference the same pin and "BCM 4" was used, when the Pi 2B was launched there was some differences in the IO pin references and "BCM 4" could mean different pins on different models so the more universal "BOARD 7" was adopted.

The correct programmer is "Arduino" for a serial uart connected device, the shorter printout looks correct just not confirming any success (or fail) did you confirm the programming wasn't successful?

I too thought this was included and ready to go on all the emonPi images and now you have it installed it should work ok, it's been tried and tested on the rfm2pi, rfm69pi and the emonPi too.

Try the "Arduino"  and "BOARD pin 7" again and if it doesn't work 1st time try it a second time, I have in the past experienced it not working first time following a restart but a fix was put in place for that.

Also sounds obvious but have you definitely stopped any serial software eg emonhub or serial terminal console etc, avrdude must have exclusive serial port access to function correctly.

Paul

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Thank you for your reply.

I' done with this for today.

Summary:
- Restarted the EmonPI;
- Corrected the pin to 7 and BOARD, programmer to Arduino;
- I always get the output you said "printout looks correct just not confirming any success (or fail)": it is just too fast to do anything and in this case it a a read operation and the file aaa.hex isn't created.

This is the testing command I'm using:
avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:r:aaa.hex

Is 115200 the correct baudrate?

I don't know there is any other access to serial port, when I do a "cat /dev/ttyAMA0" there is data coming in intervals, but I did
service emonhub stop
and
service emonPiLCD stop

It is a Raspberry 2 with a bulk EmonPi (no case or LCD).

Any more ideas I can try tomorrow will be good.

Best Regards.

pb66's picture

Re: Newbie questions About Emon PI

115200 is correct for the emonPi, I hadn't noticed you had changed the command to read, the lock bit is set by default in the fuses so you probably won't be able to read the flash. Try using the same command line without any -U options to confirm communication, it should printout the fuse settings etc, except the actual values will be zero'd due to the lock bit, but it will work as a test.

Also to stop the EmonHub service you need sudo, the data seen with cat is possibly from the AVR

Paul

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

The user is root, so no sudo is needed...

Exits at the same point:

root@emonpi:~# avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200

avrdude-original: Version 6.1, compiled on Jul  7 2015 at 13:18:47
                  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/ttyAMA0
                  Using Programmer              : arduino
                  Overriding Baud Rate          : 115200
avrdude-original: Using autoreset DTR on GPIO Pin 7
root@emonpi:~#

CidiRome's picture

Re: Newbie questions About Emon PI

Hi

Just solved my problem:

The solution was to up the sleep time, mine helped, but it was the one on autoreset script:

def reset():
  GPIO.setup(pin, GPIO.OUT)
  GPIO.output(pin, GPIO.HIGH)
  time.sleep(0.32)
  GPIO.output(pin, GPIO.LOW)

Changed 0.12 to 0.32 and now it always work, I tried .22 and it works sometimes.

I can now calibrate my EmonPI (already added Amperes values for Intensity that I can monitor on EmonCMS).

Best Regards and thanks to everyone that pointed me in the right direction.

 

pb66's picture

Re: Newbie questions About Emon PI

Glad you got it sorted.

Paul

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Today I stepped up into installing my Emon Pi into it's definitive box and found a bug in the construction.

There is a pad facing the RASP USB ports that causes a shot-circuit.

Solutions:
- Isolate the pads.
or
- use slightly longer plastic unions between the Rasp and the Emon.

Best Regards.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I have two new questions.

One about electricity basics: If I pass the live wire in thought the CT sensor 10 time I can predict that the Intensity result will have to be dived by 10 to have the correct amperes reading, does this apply to watts of real power? (I thought of this because the power factor may vary)

The second if about EmonCMS: how do I disable automatic updates? (The ones who have read this thread know that I have changed the EmonPi firmware and EmonCMS config and I don't want any of this to be changed without me knowing. If there is a new firmware I have the change it so it works correctly for my setup)

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

"If I pass the live wire in thought the CT sensor 10 time..."

Nothing will change.
Real power is the average value of all the samples of V × I, therefore the constant factor 10 can be taken out of the average calculation and applied to the result at the end.
Apparent power is Irms × Vrms. Vrms is not affected, Irms is the square root of the average of I2. Again, in exactly the same way, the constant 10 can be taken out of the squaring, averaging and square root and applied to the result at the end.
Power factor is not cos(φ) (except for a pure sine wave) - it is defined as the ratio (real power)/(apparent power), and that is how emonLib calculates it. So it will still be correct even when calculated with 10 × I.

(And if you think about it, even if power factor was calculated from the time difference (= the angle) between V and I, it would still be correct if I were 10 times bigger!)

"how do I disable automatic updates [of emonCMS]?"
EmonCMS does not update automatically. You need to start the update process. Therefore you can copy the changes you made to a safe place (a USB memory stick or another computer) and reapply them after updating.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

Thank you for the explanations.

About the update, I thought that, but while looking at the log I noticed this (isn't it checking for updates every minute?)

Oct 18 13:49:01 emonpi /USR/SBIN/CRON[1138]: (pi) CMD (/home/pi/emonpi/update >> /var/log/emonpiupdate.log 2>&1)
Oct 18 13:50:01 emonpi /USR/SBIN/CRON[1336]: (pi) CMD (/home/pi/emonpi/update >> /var/log/emonpiupdate.log 2>&1)
Oct 18 13:51:01 emonpi /USR/SBIN/CRON[1549]: (pi) CMD (/home/pi/emonpi/update >> /var/log/emonpiupdate.log 2>&1)
Oct 18 13:52:01 emonpi /USR/SBIN/CRON[1728]: (pi) CMD (/home/pi/emonpi/update >> /var/log/emonpiupdate.log 2>&1)

The script seems to be for that, it includes this:

cat /dev/null >  /var/log/emonpiupdate.log

cd /home/pi/emonpi
git checkout master
git pull origin master

/home/pi/emonpi/emonpiupdate
/home/pi/emonpi/emoncmsupdate

sudo rm /tmp/emonpiupdate

 

 

CidiRome's picture

Re: Newbie questions About Emon PI

Hi there.

One more question.

Today I received a second CT sensor that I will use on my solar system. Don't have my solar system installed yet so I inserted this CT sensor in the same cable next to the one I already had.

I'm noticing different readings, some times 10 Watts or more. Can this mean one of the sensors is bad?

I tested the first sensor and was getting about 50mA less compared to my multi meter, and didn't worry about correcting that (at least for now, it is possible that the multi meter is also not accurate).

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

10 W in how many? Every component is subject to manufacturing tolerances, so I expect, even if you don't, to see some variation between the two channels.

You can read about component tolerances and their effects in Building Blocks.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

10 W in 300W - 500W.

I don't know but It seems to me something more related to the reading moment of each sensor because they do not read constantly the same difference it varies.

This is a plot of the measurements of the two sensors.

Robert Wall's picture

Re: Newbie questions About Emon PI

Regarding the updates question, Paul Reed says "I believe it updates on user demand, via a 'Update Now' button in the UI 'Administration' page."

The ATMega328 sketch inside the emonPi runs a version of the "Discrete Samples" sketch, so the two inputs are sampled one after the other. Therefore unless your load and your supply voltage are absolutely constant, I would expect to see small differences. In any case, 10 in 400 is 2.5% and that is well within the possible error band - the CT tolerance and the burden resistor tolerance add up to 4%, and in the worst possible case you could see a difference of 8% between the readings.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

It is very strange, I would expect that the readings wouldn't be accurate but what I notice is that they are inconsistent.

To confirm that I test changed the firmware to make 20 reads of the power at each CT sensor (ct1, ct2, ct1, ct2, ...) and returned the average of the readings and the inconsistence is the same as the graph I posted.

So the inaccuracy is present on every reading and is not consistent. I thought a CT sensor would read consistently an error of n% but what I get is a variable inaccuracy within n% on every read.

Can the trick of passing the live wire several times in the CT sensor help reduce this error margins to more steady reads?

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

"Can the trick of passing the live wire several times in the CT sensor help reduce this error margins to more steady reads?"

It might do, but that assumes the problem is in the current input. My voltage here bounces around a lot and if that is what is causing the two powers to differ (and if you have a linear load, ΔP = 2 × ΔV), then it will not help.

For information, did you average the readings over a long time, and what is the difference if you do? From your graph, it looks as if the averages are very close.

You might like to look at converting the "continuous" sketch for the emonTx to run on the emonPi. That samples the currents alternately at the sample rate, so if the problem is what I think, the results should be a lot closer.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

There are variations in the Vrms readings but that ones are very steady compared to the Watts or Amps readings.

Normally the voltage floats along the day, I rarely detect instant floats above 1V, of coarse that @2A 1V variation will create almost 5W of difference.

Later I will test if that is the origin of the problem by calculating all the samples in the average with the first Vrms.

My main objective os doing 10 or 20 reads was to be certain that the variation were not coming from the time that passes between reading the first and the second.

I could not find where we set the time interval of loop, I would like to make reads every second and return the averages at the 5 second loop, but I couldn't find where...

Best Regards .

Robert Wall's picture

Re: Newbie questions About Emon PI

It would be interesting to see the difference between the voltage readings that the two powers use. (Yes, you did read that correctly - CT1 will measure the voltage over the 200 ms or so that it samples the current to calculate power1, then CT2 measures the same voltage again over the next 200 ms and uses that value to calculate power2. It uses the same transformer, voltage divider and ADC of course, so there are no systematic differences, but it measures over a different time period.)

The duration of the sampling period is set by "no_of_half_wavelengths", the interval between samples (i.e. the main loop) is set by "TIME_BETWEEN_READINGS". The data is sent each time around the main loop.
Therefore to do what you want, you need to set TIME_BETWEEN_READINGS to about 599 ms - that's a guess for 1 s less 2 sampling periods less processing time for the results - then accumulate and average the values and call "send_emonpi_serial()" (and presumably read temperature and do the pulse count) every 5th time around the loop.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

If you imply that a full loop takes about 401ms to be processed why isn't the TIME_BETWEEN_READINGS set to by default 4599 so we get a 5 second loop?

Best Regards.

Robert Wall's picture

Re: Newbie questions About Emon PI

Don't ask me, I didn't write it. As "time BETWEEN readings", it is accurate, to get the reading frequency you need to add the time to make 1 or 2 readings, depending on whether you have the 2nd CT in use or not.

CidiRome's picture

Re: Newbie questions About Emon PI

For testing I've configured a 1000 millisecond TIME_BETWEEN_READINGS, because it compares between every start, so it seems right this way (I'm not the expert but I can program).

I've made the changes to send readings every 5 seconds that are averages of 1 second interval real readings.

Let's see how it goes until tomorrow.

Best Regards.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I've also made the live wire pass 3 times in the CT Sensor and it seems to improve slightly the readings (of course I've changed to firmware to take this in account).

I'm having some doubts now.

I've configured 2 feeds for testing, one with KWh and one with Wh, shouldn't the first read exactly the same read of the second divided by 1000?

All my feeds are configured to 5 secs, don't know if it affects, but the KWh (or the Wh/1000) are too high to be real. Can I be doing something wrong?

Update:
- Made 2 equal Wh feeds (one 10 and other 5 seconds) and have the same values, this don't seem to affect anything.
- Created a virtual output on the firmware of a 3rd power that always reads 1000W to check that the Wh and KWh count right (I would expect 1KWh or 1000Wh every hour) but this feeds are stuck on zero, I don't understand this behavior...

Update 22-10-2015 15:08
- I'm having one problem when I make changes to the feeds. Some times the feedwriter service stops and normally I cannot start it unless I reboot the whole EmonPi/Rasp. If I start it with "service feedwriter start log" I get this error: PHP Fatal error:  Call to a member function prepare() on a non-object in (...)/feedwriter.php
- About the virtual feed that I made to test: I've made and remade it over and over again and don't understand why it don't work, this image shows how it appears in the Nodes and the result is always zero:

- Does a Wh or Power to kWh need a Log to feed to work? I don't yet fully understand how this node/feed config works...

Any ideas?

Update 22-10-2015 20:37

I think I'm getting dumber:
- For the sake of excluding possibilities, I altered the firmware to output a variation on one watt every 5 seconds, from 990 to 1010 and when I did that the Wh and KWh feed started counting. Shouldn't the Wh feed count anyway if the W of power are stable at a value? (I know it is improbable, but possible)

- After this, shouldn't a 1000W feed count 1KWh or 1000Wh per hour? Doesn't the term KWh mean the a specific load consumed 1Kw during one hour? But this isn't what I'm seeing at the emoncms results...

I'm confused...

Best Regards.

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I think I've overcome most of the issues I had.

I'm now trying to remotely log the EmonHUB data to an EmonCMS I installed on another LOCAL server.

I'm having trouble setting the EmonHUB to post the data every 5 seconds as it does to the local Pi EmonCMS (I want to have real time widgets and graph not just regular 30 second graphs).

I've added the option
interval = 5
to the remote emoncms config settings but it does nothing and it is not a case of now allowing lower values, if I set to 60 is keeps logging at 30 seconds.

I think it should work, don't know why it doesn't.

Best Regards.

pb66's picture

Re: Newbie questions About Emon PI

To adjust the send interval on the emonpi variant you will need to edit the source code as the setting has been replaced with a hardcoded 30 secs.

https://github.com/openenergymonitor/emonhub/blob/emon-pi/src/interfacers/EmonHubEmoncmsHTTPInterfacer.py#L52

Paul

PhilWadsley's picture

Re: Newbie questions About Emon PI

Hi, Just received my emonpi last week. After setting up with my local network, only problem was not reading data which was eventually sorted with re-booting the box.

I moved onto emoncms.org for remote login, following the videos and setup. Although I can log on to the web page, I am not seeing the same displays as the "local" mode, esp. not seeing Inouts and Feeds.

I note the APIkeys are different for the local and remote conditions.

I have tried changing APIkeys in the EmonHub config in the local state, to no avail.

I suspect I am making a "schoolboy error" but the setup videos seem to jump from using emoncms locally to emoncms.org and I think I am in the "no-man's land" between.

I am pretty sure our ADSL router is set for porting, as I have remote monitoring of our Solaredge PV system and Salus iT500 Central Heating control.

The Sun is now shining over the Campsie Fells (North of Glasgow!), so we have conditions for checking out the Solar App, when we get there...!...

Comments, pls. (I do have sense of humour, so rude-ish ones accepted!)

Cheers

CidiRome's picture

Re: Newbie questions About Emon PI

Hi.

I'm not using EmonCMS.org, I'm using my own emoncms server.

From what I've seen that part of the configuration is easy, just configure this part "EmonHub Config" and the data should appear in the Inputs section of the EmonCMS updates at 30 seconds periods.

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = http://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        senddata = 1
        sendstatus = 1

I've made a few changes to my config, but I believe you only have to put your emoncms.org write key where the xxxxx are. 

You will also need to identify the inputs because the transmission only passes the values.
Best Regards.

PhilWadsley's picture

Re: Newbie questions About Emon PI

Thanks, CiDiRome,

I've managed to see inputs now, without Name or Process List data

Onwards!

Cheers!

CidiRome's picture

Re: Newbie questions About Emon PI

Glad you sorted it out.

Cheers.

PhilWadsley's picture

Re: Newbie questions About Emon PI

er,...How does one identify the inputs?...(Real Newbie...)

 

CidiRome's picture

Re: Newbie questions About Emon PI

Normally they are in the same order, then name it in EmonCMS

PhilWadsley's picture

Re: Newbie questions About Emon PI

That's the difference. The Process list has not been populated and the data is not being updated...!

Screenshot:

CidiRome's picture

Re: Newbie questions About Emon PI

I don't know.

When I configured the emoncms Api write key in the emonpi emonhub config section the values started appearing.

I only had to add the names.

Cheers.

PhilWadsley's picture

Re: Newbie questions About Emon PI

Hi,

Deleted the Inputs, re-booted the emonpi and went back through the whole process, giving everything a long period to update and got the system to work.

Many thanks for your assistance

Cheers!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.