Home > Tech > Envoy router from Enphase

Envoy router from Enphase

December 13th, 2010 Leave a comment Go to comments

How to monitor your Envoy router with MRTG

So I am into green, whole family is. This past summer, I decided to install solar panels. Got a 4.4KW system installed with Enphase microinverters.

Traditional solar panel system generate DC in the panels, and all of them goes to a battery bank, then a DC-AC converter for the house. It’s big, bulky and wasteful (converting DC-AC, etc). The Enphase microverters uses a DC-AC converter per panel. So no batteries needed, and losing one panel (whether shade, damage, whatever) is not going to stop power production.

Anyway, long story short, along with the microinverter come an Envoy, which is essentially a small embedded computer that talk with each inverter, query their status (power generation, heat, etc.), collects them and send them to a central place (Enphase’s server).

You have the option of subscribing to Enphase Enlighten program which allow you to login to a personalize website and view your power generation history with nice graphs, etc. The first few months are free after installation so you can play with it and see how it work.

I didn’t want to pay for something I can do myself. The microinverters talk with the Envoy over the power lines, so use their own protocol. But since I have access to the Envoy controller, I can query it for the data it collect from the inverters. There is a web interface on the unit that I can login to and see the data. But there is no programmatic way to get that data, e.g no snmp or API that I can use to ask the Envoy.

Hmmm, ok, I’ll screen scrape the web interface. So I wrote a little perl script to do just that, and that script output MRTG data for graphing locally.

12/14

Sorry, didn’t finish this yet.  I’ll post my little perl script and the config I used for MRTG when I have chance.

3/9/2011

I posted my MRTG config and perl script in the comment to this post.  Too lazy to put it here….

 

Categories: Tech Tags: , , , , ,
  1. August 11th, 2016 at 18:51 | #1

    I now have the performance trends, generated with gnuplot, available on my website.
    http://simple-pages.homeunix.net/solar/

    The data I extract from MySQL using a perl script which is then passed on to my gnuplot script:
    #!/usr/bin/gnuplot
    reset
    #
    set grid
    set time
    set title “Daily generation graph”
    set style fill solid 1 border noborder
    set key top left box
    set style data fsteps

    set xtics font “Times-Roman, 12”
    set xlabel “Time”

    set xdata time
    set timefmt “%Y-%m-%d %H:%M:%S”

    set format x “%d/%m\n%H:%M”

    set ylabel “Watt”
    set y2label “kWh”

    set ytics nomirror
    set y2tics
    set tics in
    #
    set key autotitle columnhead
    set terminal png size 800,300

    set output ‘/var/www/htdocs/solar/daily.png’

    plot ‘/tmp/daily.dat’ using 1:3 smooth freq, \
    ” using 1:($4/1000) smooth freq axis x1y2
    # end of gnuplot script

    The datafile (/tmp/daily.dat) is generated using a MySQL query and looks like this:
    ‘date time’ ‘power’ ‘energy’
    2016-08-12 13:45:02 2240 7950
    2016-08-12 13:40:02 1880 7770
    2016-08-12 13:35:02 653 7610
    2016-08-12 13:30:02 1570 7560

    All pretty simple I would think.

    Cheers,
    Frits.

  2. July 23rd, 2016 at 19:07 | #2

    Hi Tin,
    I’ve added some SQL to your perl script:
    Top of the script:
    use CGI qw(:standard);
    use strict;use Socket;
    use DBI;

    Bottom of the script:
    #
    # update the MySQL database table
    #
    my ($dbhandle, $qhandle,$query);
    $dbhandle = DBI->connect (“DBI:mysql:host=localhost;database=envoy”,
    “nobody”, “”,
    {PrintError => 0, RaiseError => 1});
    $query = ”
    INSERT INTO data \
    VALUES (0, now(), $ncurrently, $ntoday, $nlastweek);”,

    # print(“query: $query\n”);
    $qhandle = $dbhandle->prepare($query);
    $qhandle->execute();
    #
    # End of MySQL addition
    #

    I guess you might like that.
    The graphics can you be generated using GNU plot and straight out of the MySQL table 🙂
    Oh, and for good measure I added ‘last week’ generation.

    • August 1st, 2016 at 11:49 | #3

      Thanks Frits for the contribution.

  3. Richard Smith
    January 9th, 2016 at 14:24 | #4

    Hi Tin, here are links to my mrtg graphs. I’ve only got a weeks worth of data, so far:

    Day Graph: http://s17.postimg.org/p31t04acv/envoy_day.png
    Week Graph: http://s9.postimg.org/85aaaebyn/envoy_week.png
    Month Graph: http://s24.postimg.org/633yj5fmd/envoy_month.png

    And finally, the year graph: http://s9.postimg.org/3nckw1lan/envoy_year.png

    I don’t have a lot data yet for my yearly graph. But, as you can see, the maximum value is about 6kW. Where on the week and month, it is about 12.5kW.

    • January 10th, 2016 at 12:14 | #5

      That look about right. Anything based on RRDs will lose details over time as the data get averaged the further back you go.

  4. January 4th, 2016 at 06:20 | #6

    Tin, thanks for this page. I’ve implemented this to get mrtg graphing of my envoy data. One question: I notice that your screen shot of the mrtg graphs don’t include the yearly data. I’m having issues with my yearly graph. My yearly graph doesn’t seem to be showing the correct daily totals production. Are you having the same issue with your yearly graph?

    • January 6th, 2016 at 23:21 | #7

      Can you post a screen cap of your yearly graph? Mine works fine as far as I can remember. I upgraded my server HW and OS last year and broke the monitoring. I’ll get it working again now to take a look.

    • January 9th, 2016 at 14:28 | #8

      I got my MRTG monitoring working again with the Envoy and my yearly graph look ok. Note that it take time, at least a day or more for there to be any data to be graphed. Since RRD rolls up data over the time series. You lose precision, but you get cumulative averages.

      I’ve also updated my get-envoy-stats.pl script and checked it into my github repo.

      Get stats script

  5. helios
    September 29th, 2011 at 06:37 | #9

    @fromport
    What method did you use to gain root access to your Envoy?

  6. July 29th, 2011 at 20:35 | #10

    Just FYI, Enlighten is free now, and there is a data API as well. Not quite the same as direct access to the Envoy, but it’s quite useful.

    • August 29th, 2011 at 20:56 | #11

      Eric,

      Thanks for the info, I’ve stopped checking Envoy website, so would not have known that.

  7. joe
    June 23rd, 2011 at 10:57 | #12

    @fromport
    Hi Fromport, is it possible to explain to me how to get the root pasword. I will like to get in to my Envoy. Thanks,

  8. May 5th, 2011 at 08:28 | #13

    @Joe

    At the moment, no. The software is meant to run on Linux or *NIX like systems (including BSD variants, OSX, Solaris, etc.).

    This was just a quich hack so I can monitor what my solar panels are generating. Not promising anything, but I’ll look into making it run on other OS, including Windows.

    I have a couple of ideas to make it nicer looking.

  9. May 4th, 2011 at 11:24 | #14

    I’m not a programmer, but I sure would like to be able to install and utilize this software to get better displays of the performance. I have an enphase system out “in the country” where only dial-up is available, and can’t use their monitoring system. I’m NOT a programmer – is there a “finished’ version of this software I can just load up on a windows 7 computer to let me get the more complete data? Sure would appreciate a copy…

  10. fromport
    March 20th, 2011 at 16:15 | #15

    The output of my envoy is now uploaded to http://pvoutput.org/list.jsp?userid=1805 using the scripts found on http://pvoutput.org/help.html#integration
    In April i am sure there will be no extension of my current enphase subscription

    If somebody wants more info, just shout

  11. fromport
    March 19th, 2011 at 15:51 | #16

    http://pastebin.com/gtnXPHU5 for the dump of the password file

  12. March 9th, 2011 at 23:46 | #17

    @fromport

    Yes, the Envoy router uses OpenVPN to connect back to Enphase mothership and upload the data through that connection. I block it at my fw.

  13. March 9th, 2011 at 23:35 | #18

    Ok, here is what I have. There are several pieces you need to graph your system using MRTG. You need to have MRTG setup and working. There is an MRTG cronjob that runs every 5 minutes to grab the data, update the RRDs and generate the graph.

    First, create an MRTG config file for your Envoy router. Here is mine, you need to change the IP address to yours. I put mine in a file call envoy.cfg in /var/www/mrtg/cfg directory.

    WorkDir: /var/www/mrtg
    # Options[_]: derive,nopercent,growright
    Options[_]: gauge,nopercent,growright
    
    ######################################################################
    # System: tin.le.org
    # Description: Envoy Solar router 192.168.2.104
    # Contact: Postmaster 
    # Location: Tin Data Closet
    ######################################################################
    
    Target[envoy_192.168.2.104]: `/home/tin/bin/get-envoy-stats.pl`
    SetEnv[envoy_192.168.2.104]: MRTG_INT_IP="192.168.2.104" MRTG_INT_DESCR="envoy"
    MaxBytes1[envoy_192.168.2.104]: 4400
    MaxBytes2[envoy_192.168.2.104]: 50000
    # Kilo[envoy_192.168.2.104]: 1000
    Title[envoy_192.168.2.104]: Envoy (192.168.2.104) -- Solar Router
    Legend1[envoy_192.168.2.104]: Current Generated
    Legend2[envoy_192.168.2.104]: Today Generated
    Legend3[envoy_192.168.2.104]: 5 Min Current Generated
    Legend4[envoy_192.168.2.104]: 5 Min Today Generated
    LegendI[envoy_192.168.2.104]: Now
    LegendO[envoy_192.168.2.104]: Today
    YLegend[envoy_192.168.2.104]: Watt Generated
    XSize[envoy_192.168.2.104]: 600
    ShortLegend[envoy_192.168.2.104]: W/h
    PageTop[envoy_192.168.2.104]: 

    Envoy (192.168.2.104) -- Solar Router

    Then you will need the following perl script:

    get-envoy-stats.pl script

    This is a screen cap of my MRTG screen:
    Envoy MRTG Screencap

  14. Dan
    March 9th, 2011 at 19:45 | #19

    I have 12 Enphase inverters as well an Envoy unit which allows me some access to my data but I sure would like to see it all. I did pay for the equipment.

    Please let me know of any progress in this regard.

  15. RichG
    March 9th, 2011 at 12:23 | #20

    Fromport I would also love to get a copy of the /etc/passwd so that I can help. @fromport

  16. fromport
    February 1st, 2011 at 12:41 | #21

    I managed to gain root access to my envoy.
    It makes a vpn to enphase HQ and using ruby it transfers all the data.
    Maybe we can do some stuff together ?!

    • February 8th, 2011 at 00:32 | #22

      Sorry, I’ve been busy and have not check my blog for a while. I’ve got to clean up my script and post it.

      If you can post the /etc/passwd file from the envoy, that should help. More eyes to look at it and have a try at cracking it.

  17. Mr. Radon
    December 13th, 2010 at 20:09 | #23

    You figure out a way to get the per inverter data out of the Envoy?

    • December 15th, 2010 at 00:00 | #24

      No, I wish. I am screen scraping at the moment. I am planning on opening up the router and see if I can get to the OS. If mine is one of the old one with the SD card, then I am in heaven!

  1. No trackbacks yet.
You must be logged in to post a comment.