Month: May 2017

  • Reading Modbus devices from Linux (or any system with Python)

    Problem:

    Read a TCP/IP modbus device from a Linux server so that we can get power generated, energy generated, and voltages from our newly installed solar system.

    Solution:

    Search the web and find MBUtils, an open source set of python libraries that allow you to communicate with Modbus devices and servers. They also allow you to communicate with PLC’s and other control devices.

    The project is on sourceforge (love this site) as MBLogic http://mblogic.sourceforge.net/ I recommend downloading the full package because you will need to install the libraries as well as the pollmb utility package.  Follow the install directions in the readme file.

     

  • Solar is installed!!

    We recently installed our solar system. Well,  we had someone come in and install what was supposed to be a 5.2Kw/hour solar system on our roof. One of the things I did almost immediately was setup tracking on pvoutput.org to see what our generation versus consumption is and how compares with others. pvoutput.org is a free website that is dedicated to solar energy generation and seeing how much carbon output is saved by solar panels. It tracks generation, output, import, export, and consumption on an every 5 minute basis.

    The down side is that you have to send them data every 5 minutes (or in my case we send every minute) via json and html. The other downside is that many of the solar systems either do not have direct tracking capability or they are not easy to poll and securely transfer data to a service that is not proprietary in nature. For example, our solar system uses and SMA Sunny Boy 3.8 inverter (part that takes the DC power and makes it AC and allows it to be fed back into the grid or used). The SMA series is addressable internally with a web browser, and it will also automatically (sometimes… when it feels like it…) send readings about generation to the sunnyportal.com web site (owned and controlled by SMA). If you really want to see what your energy profile is you have to send: power generated (watts), energy generated (kw), energy used (kw), power used (kw) and also it helps to send temperature and wind speed if possible. Well, all of this does not come out of one device so I took advantage of a bunch of open source software and a linux server (have at least one running all the time here) to make this all work.

    Here is our output (live):

    https://pvoutput.org/intraday.jsp?id=57895&sid=51866

    and our daily totals:

    https://pvoutput.org/list.jsp?id=57895&sid=51866

    I will post a page soon that shows how to set this all up.