Giter Site home page Giter Site logo

rpi-aps-inverters's Introduction

APSystems inverters monitoring

housing

A software for a Raspberry pi Zero and other Raspberry models to read the production of APS inverters yc600, qs1 and ds3. I should mention that the basics (the zigbee communication) has been reverse engineered by others who shared their results here: Koenkk/zigbee2mqtt#4221
A very important detail is the software running on the zigbee module, developped by @kadzsol.
NEW april 2022 The DS3 inverter is implemented.

For information on building and use please see the WIKI

IMPORTANT TO KNOW

People keep asking for the ssh login, this is 'root' and 'mies'. Please be aware that this is known to the whole world now. So never put the ssh port open 'to the world'

The influx database system has the very annoying feature that it starts very slow, sometimes as much as 15 minutes after system boot. This means that you shouldn't backup or restore databases during this period! The values displayed on the webpage are the values reported by the inverter. In case of an inverter reset, these values start at zero so they seem to be incorrect. In the database / charts however, the values will be correct so there is no need for actions by the user. In case of a raspberry reboot there are initially no values written to the database, because it starts very slowly. This means that the chart of the power won't be correct. The energy value in the database will be correct the next day.

PURPOSE

This project is intended for reading APS Systems inverters. The program can pair and poll YC600, QS1 and DS3 inverters, up to 9 pieces. The read values are:

  • displayed on a web page
  • sent via mosquitto in a Json format
  • saved in a database for charts and statistics.

DOWNLOAD SD-CARD IMAGE

2022-04-19 A new image version RPI-ECU-v2_4 is available (see changelog). This version works with the DS3 inverter.
If you don't have a DS3, you don't need to install this, you are up to date with version 2_3. https://1drv.ms/u/s!AkMG5FvUwhedizkqqOlZyptwBY7I?e=lpbuCQ

DOWNLOAD SOFTWARE UPDATES

2022-06-08 A software update to version RPI-ECU-v2_7 is available (see changelog). Install this only when you currently use version 2_6
https://1drv.ms/u/s!AkMG5FvUwhedi0r9yS7C6Spkopzg?e=x4y9IR 2022-05-31 A software update to version RPI-ECU-v2_6 is available (see changelog). Install this only when you currently use version 2_5
https://1drv.ms/u/s!AkMG5FvUwhedi0nkRdw0J8sN6Oea?e=QA3ML6
2022-05-21 A software update to version RPI-ECU-v2_5 is available (see changelog). Install this only when you currently use version 2_4
https://1drv.ms/u/s!AkMG5FvUwhedi0f-bOvnSD9lo95s?e=y6FRhJ

2022-04-21 A software update to version RPI-ECU-v2_4 is available (see changelog). Install this only when you currently use version 2_3
https://1drv.ms/u/s!AkMG5FvUwhedizqYIS5MOefFfNyo?e=iCehez
2022-03-29 A software update to version RPI-ECU-v2_3 is available (see changelog). Install this only when you currently use version 2_2
https://1drv.ms/u/s!AkMG5FvUwhedizgEDlH87A0LKjzj?e=5Lp2f7
2022-03-29 A software update to version RPI-ECU-v2_2 is available (see changelog). Install this only when you currently use version 2_1
https://1drv.ms/u/s!AkMG5FvUwhedizMIrXNOnCWgsIZK?e=nEqyOW see SOFTWARE UPDATES
2022-02-25 A software update to version RPI-ECU-v2_1 is available (see changelog). Install this only when you currently use version 2_0
https://1drv.ms/u/s!AkMG5FvUwhedix8xSOvp7YAxMspk?e=hgKOuf see SOFTWARE UPDATES

2022-04-19 The new version RPI-ECU-v2_4 is available. This has to be installed by burning the disk image to an sdcard. Before you start please read the instructions. If you want to backup and restore your settings and databases, be sure you upgraded to version RPI-ECU-v2_3. And schedule some time after midnight to perform the migration. Please follow the steps in installation via the sd-card image , in particular it is important that you expand the filesystem first and than wait for influxdb is running, before restoring your backup!!.


instructions:
You can burn the image on a new sd-card at any time. The backing-up of the old system however, and starting up / restoring on the new system should be done in the period after midnight and before sunrise. This way we have a smooth migration. If all goes well, it wil take you 1 hour.

backing-up your system
Be sure that you are running version 2_3 or above. First ensure that the influxdb is running. So don't do this right after a reboot of your system. If you can see your charts, influx is running. The backup is primarily intended for system migrations and have to be restored the same day as it was made. If you restore it on a later date you will miss data.

Please see 'CHANGELOG'

If you are currently using version RPI-ECU-v1_1 (check the infopage) you now can upgrade to version RPI-ECU-v1_2.
Download the tarball here https://1drv.ms/u/s!AkMG5FvUwhediwMEziqX7Kv8eWEC?e=K5FKcC
In the menu 'system' you'l find the option 'update'. Click this and choose the downloaded file. If you get an error about the filename, try to rename it to ecu_swupdate.tar.
Please see 'CHANGELOG'

See it in action on youtube: https://youtu.be/oF-QE4GUGy8

In case someone wants to print the housing: https://1drv.ms/u/s!AkMG5FvUwhediwaPqGYXa7vMkXp8?e=kzkdHQ

Some webpages:
pages_rpiecu

FEATURES:

  • all inverter information such as temperature, dc voltage etc available
  • energy production per solar panel displayed
  • Easy wifi config portal
  • Easy add, delete and pair inverters
  • There are 3 different json formats, a special one for domoticz
  • a very smart console to send zigbee commands and debug
  • almost all processes show debug information, most pages have a frame for that.
  • polled values are stored in a database
  • charts of the production at multiple days are available
  • There is a page with some statistic data
  • The menu is only accessible from local network with login
  • software can be updated by uploading and installing a tar achive

(RE) INSTALLATION INSTRUCTIONS

installation via the sd-card image
step 1
Download the package, unzip and burn the image on an sd card. If you are new user of this software please continue with stap 3.
step 2
You already are using this software then you can make a backup of your system and databases first. You should do this after midnight. Then complete the next steps before sunrise in order to get a smooth migration.
step 3
Boot up with the new sd-card. Open the wifi settings on your computer/tablet/phone. After a while you will see an accesspoint RadioAP. Connect to it with the paswd 'rpiradio'.
Now browse to http://192.168.4.1 and enter your wifi credentials as well as a userename/password for the security of your webpages. Click save and wait for the reboot button to appear. Click it. note: The security credentials are needed to get access to the settings of your ECU.


Next the Raspberry reboots and tries to connect to your wifi. This may take a while! You can find your Raspberry's ip address by browsing to http://rpiecu.local. Or open your router's webpage to see the connected devices to find the ip address. Or use a wifi analizer tool on your phone/tablet.
step 4
The first thing to do now is to expand the filesystem. Go to the menu 'system' and click the button 'expand'.
Important: If you want to restore a backup then, after the expansion reboot, you need to wait until the influxdb is running. This can take as much as 15 minutes!!!! By doing a query in the menu database you can find out if influx is running. If so, you can restore your system backup. Check if the databases are restored by clicking a chart of the date of yesterday. If that doesn't give the expected result you can try to restore the backup again.
step 5
If you restored a systembackup you can check the settings now. Otherwise you should do some other configuration first. See the chapter 'SETTINGS'. In particular the setting of the geographical coordinates is important.

SOFTWARE UPDATES

If the software needs updates, they are provided as a file ecu_swupdate_date.tar that you can download. This file can be uploaded to your system. When this succeeded you'l get a button
'install' and when pressed a script is running that unpacks the archive and replaces
the relative files. You can follow the process in the outputframe. In the chapter 'CHANGELOG' you can see what has been changed.

FACTORY RESET

When i make an image of the system there are settings and data present that belong to my inverters. You should edit inverter 0 with your own name and serialnr. Now go to the menu 'databases' and wipe all data for inv0 in both databases. If you restore a backup, the existing databases are removed and replaced by those in the backup.

SETTINGS AFTER INSTALL OF A NEW SD-CARD


In the menuitem 'settings' you have to enter the geographical coordinates of your location (google for latitude on your city). Now your system can determine sunset and sunrise.
Also enter the id nr for the zigbee coordinator, this must be a 12 character string, like D6B3011B9780

Enter an offset to sunrise and sunset were the polling should start. On a bright day, the inverter may startup before sunrise.
In the journal you can see the timespan at the first poll, this is the amount of seconds the inverter is already working. I have an offset of -5 so i start 5 minutes before sunrise and stops 5 minutes after sunset with the polling.

START THE ZIGBEE SYSTEM

Check first the hardware, than go to "console" and do a healthcheck. If the zigbee coordinator is not running, check the wiring and try to start it. With the healthcheck you can see if this succeeded. If success you can configure an inverter, go to the menu 'inverters' and fill up / save the form. Attention you should provide a numeric value in the field DOM.IDX like 123, do not leave it empty or put a non-numeric value. !!! Now you can try to pair this inverter, but only during daylight, the inverter will not answer when it's not working.
If success, this inverter will be polled automatically every 5 minutes. The data is displayed in the frontpage and charts, and is send via Mosquitto. At reboot all processes will be started automatically.

HARDWARE

What you need for this project is:

  • a Raspberry zero 1.3 W (yes the W means wifi) ~11Euro or a goodold model 1 will work too.
  • micro sd-card class 10, 8 or 16 gB (like in your phone)
  • a cc2530 module, see photo, with the right firmware on it (see readme in the info folder of the download package.
  • a 5V dc 3A powersupply see photo

estimates costs some 25 Euro. The zigbeemodule should be flashed with a firmware that can be found here Koenkk/zigbee2mqtt#4221.

WIRING ZIGBEE MODULES

you need 5 dupont cables.

cc2530/31 (see wiki)
p02 -> gpio14 ( pin 8 )
p03 -> gpio15 ( pin 10 )
rst -> gpio18 ( pin 12 )
vcc -> 3.3V
gnd -> g

hardware:
rpi_minhw pwrsup

stats

TROUBLE SHOOTING

You forgot your admin password. If you type http://your_ecu_ip/recovery/recover.php you will enter a secret page where you can drop your wifi credentials. At reboot the accesspoint RadioAP is started.

CHANGELOG

version RPI-ECU-v2_7 08 june 2022 upgrade archive

  • added healthcheck of influxdb
  • fixed a bug in send a zigbeecommand

version RPI-ECU-v2_6 30 may 2022 upgrade archive

  • removed limit of 20 in database query
  • added a value validation to prevent erratical energy values

version RPI-ECU-v2_5 27 may 2022 upgrade archive

  • added dc current for the ds3 inverter
  • improved powercalculation

version RPI-ECU-v2_4 19 april 2022 new sd image

  • made the program suitable for the ds3 inverter
  • extended database query and editing

version RPI-ECU-v2_3 22 march 20222 upgrade archive.

  • repaired a bug with database editing

version RPI-ECU-v2_2 22 march 20222 upgrade archive.

  • added a utility to edit database entries in 'invEnergy'

version RPI-ECU-v2_1 25 feb 20222 upgrade archive.

  • repaired a bug with offset to sunrise / sunset
  • restored a missing file for mqtt test.
  • Some cosmetics

version RPI-ECU-v2_0 15 feb 20222 Only installable as sd-image.

  • changed the process of gathering the total energy values.
  • ruled out the effect of disturbances (eclips, inverter resets, zigbee disturbances)
  • added a tool to upload and show a photo of your powerplant.

version RPI-ECU-v1_5 11 feb 2022

  • improved the backup process as this was not working as it should.

version RPI-ECU-v1_4 04 feb 2022

  • added a tool for statistic research over an adjustable period.
  • removed a small bug in the mosquitto sending and settings.
  • added a chart for average power
  • added currency setting
  • improved some beauty flaws

version RPI-ECU-v1_3 28 jan 2022

  • added a quick analysis tool for statistic research.
  • removed a bug in the pairing process that malformed the inverterProprties files.
  • added a workaround for qs1's not returning values for freq and acv

version RPI-ECU-v1_2 24 jan 2022

  • changed the chart 'last 30 days' to a selectable month.
  • made the programm suitable for old Raspberry 1 model.

version RPI-ECU-v1_1 19 jan 2022

  • added means of backup of settings and databases
  • added means to upload/install software upgrade package
  • added some new features to the charts and statistics
  • removed a hard-coded inverternumber in midNight.cpp
  • changed the security strategy, only local access to settings pages.
  • changed the retention policy of invEnergy to 3 years

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.