Ventures

Ventures provides an overview of current and past projects.


Solar Feed


Solar Feed - An Internet of Things (IoT) project to use available solar energy to regulate a local heatpump

Brief: Develop a Software System to regulate a local heat-pump based on solar panel power output.

Hardware description:
  • Solar Panels Inverter: Blue Planet 5.0TL1 manufactured by Kaco New Energy (A Siemens Company). It comes with an ethernet port and a TCP/IP server which enables remote monitoring of system status and output by means of a “Sunspec Modbus Interface”.
  • Heat-pump:  Siebel-Eltron WPF7 with a CAN bus to control the various modes of operation.
  • Computer Setup: Intel CPU, Ethernet Port, Linux, Internet Browser.
Software Development Stages:
  • Phase-1: To develop a TCP Server to extract the Inverter’s status and power output. 
  • Phase-2: To develop a Websocket Server to pass-on Inverter data to a standard web browser.
  • Phase-3: To develop a CAN server to regulate the heatpump based on Inverter data.
Overview
Figure 1 below shows the various software components and their relation to the hardware parts.

Diagram
Figure 1

Figure 2 shows a simplified code snippet of the TCP server that extracts the Inverter’s status and power output. The programming language is C++17 and the main program is there to to establish a TCP connection between the Inverter and Computer. It subsequently reads some specific data registers from model-1 and model-103 as defined by the Sunspec specification. And finally it closes the TCP connection. NB A Sunspec model is a set of buffer offsets and lengths that defines the address and size of a particular data register (e.g. ‘power output’) within the Inverter's output data stream.

Code Sample
Figure 2

Figure 3 shows a screenshot of a web page that lists the Manufacturer Name, Model Number and Power Output in KiloWatt (and a time stamp). A C++ Websocket Server was written (using the uWebsocket library) to pass this information from the TCP server to a standard browser. The receiving web client processed and formatted the incoming data by means of JavaScript, standard HTML and Material Design Components.

SolarFeedWeb
Figure 3

To Play and Pause:
At the bottom of the web page (figure 3) one can see a play/pause button to continue or pause the sampling of the Power Output over time. A ‘Pause’ will tell the TCP server to halt the data extraction from the Inverter. A ‘Play’ will resume the polling of the inverter for more 'Power Output' samples. To make this work properly it was necessary to use asynchronous computer processes to avoid situations where say the Websocket Server had to wait for the TCP server to fetch the next batch of Inverter data. Consequently the web page is updated in a (near) real-time manner. NB A time stamp has been added to the Power Output display in case of future data logging.

Current Status
The development of Phase-1 and phase-2 have been completed. Phase-3 is on hold pending hardware procurement.

Tags: C++17, libmod-dev, Linux, CentOS, git, scons, multi-threading, concurrency, Websockets, uWebsockets, JavaScript, CSS, HTML, SaaS, Webpack, Material Design Components, Sunspec Modbus Interface, ...