Ethernet eHouse Home Automation, Building Management – open source c++ programming

eHouse Home Automation Open Source C, C++, Object C software for different Linux distributions and hardware.

Control and management of building automation Ethernet version EHouse and eHouse1 under the supervision of CommManager.

This article describes open source code to manage and control an eHouse smart home (Ethernet version) and eHouse1 (RS-485) under the supervision of CommManager.

It is a piece of home automation server application (template, educational library) for eHouse (open source C++), written for the operation and management of eHouse controllers from mini-computers running under Linux. These are devices that have very low hardware performance and limited resources and require a low-level software programming to be able to work efficiently,effectively and functional in relation to their abilities.

Because the eHouse C++ server will work on a LAN, most suitable and least burdensome solution consists in receiving the status of the controllers via UDP broadcasts from each controller on the same port. UDP broadcasts are connectionless protocol and does not require keeping connection between the client and the server, which would be cumbersome and loaded the controllers too. UDP datagrams can be received by any of the control panels in the network, no matter how many there are. It does not create an additional traffic on the LAN for TCP/IP connections that were be reproduced. In addition, active TCP/IP connections would have to be with each panel as much as total amount of home automation eHouse controllers in Ethernet version to receive the statuses of all intelligent home controllers. Such a chain would have to be multiplied for each subsequent panel that cause needless increase in the load on the LAN.

Due to the C++ software and Linux architecture, hardware requirements are many times smaller compared to similar versions of software running under Windows or written in Java. The graphical environment also in not needed from the server, so that you can use for this purpose microprocessor board with ATOM , ARM, Samsung processors, much cheaper than a standard PC. It is also possible to install such software on a “archaic” PC hardware running on processor 486, eg by launching Linux and software from a USB stick.

The main element is the UDPListener (who listens broadcasts from Ethernet eHouse controllers on port 6789 (default), which are statuses smart hmatrix ome controller in binary form (below 200B/controller). Data is copied directly to the structure of the status of the ECM (for CommManager), EHE[] status for EthernetRoomManagers, and for eHouse1 building automation controllers under the supervision of CommManager statuses are loaded into the array of structures eH[].

Complete software configuration is in the file Home Automation – Open Source C ++ configuration “globals.h” .
To activate a job as a server of Ethernet eHouse definition need to set or verified
ETHERNET_EHOUSE = 1 which is the default.

Another critical parameters are:
COMMANAGER_IP_HIGH – The IP address CommManger (3rd byte) – default (0)
COMMANAGER_IP_LOW – The IP address CommManager (4th byte) – default (254) total IP address for the CM is 192.168.%COMMANAGER_IP_HIGH%.%COMMANAGER_IP_LOW%
INITIAL_ADDRESS_L – The minimum IP address (4 bytes) EthernetRommManager’ów – default (200) – ERM addresses begin with a standard of 201. It is used to create INDEX of status table EHE [AdresL-INITIAL_ADDRESS_L] so the controller with the IP address 192.168.0.201 will be in eHE[1].
STATUS_ARRAYS_SIZE – The mask for the status of the index at the same time determines the number of controllers eHouse4Ethernet (ERMs) and eHouse1 (RMs) – default (15). Unless you have installed more drivers, you should leave this value. Otherwise, uncomment another line with definitiion of propper value and do not edit the number directly. When editing can disguise array index status and some drivers will be overwritten on the other.

The most important function of the software is “UDPListener()”, which is in an infinite loop capturing statuses (from UDP broadcasts) of the Ethernet eHouse controllers of building automation, and eHouse1 under the supervision of CommManager. Termination of the loop is only possible through termination of the application ‘Ctrl-Break’ or run the “TerminateUDP()” function.

The software is as simple as possible, because it is an educational and development to enable the study of software development for eHouse smart home.
It is not a multi-server, and does not have a configuration (requires a recompile after changes to definitions in the file globals.h).
To enhance its functionality, place the configuration in external file. For better performance it is necessary to put the “UDPListener ()” in an independent thread from main application, with the lowest priority (lowest, lower), which allows the equipment on which the application is running.
eHouse Home Automation – open source C++ free source codes / open source

Smart House eHouse – Open Source C++ UDP software source code listener UDP datagrams Ethernet EHouse drivers.

For more information about the software open source C++ for EHouse.

Inteligentny Dom eHouse – Open Source C++