Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed May 22, 2018
2 parents 6c584ba + 7d5e20c commit 9572529
Show file tree
Hide file tree
Showing 15 changed files with 1,661 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ set(SOURCE_FILES
config.h
src/Families/EnOcean.cpp
src/Families/EnOcean.h
src/Families/HomeMaticCc1101.cpp
src/Families/HomeMaticCc1101.h
src/Families/HomeMaticCulfw.cpp
src/Families/HomeMaticCulfw.h
src/Families/ICommunicationInterface.cpp
Expand Down
36 changes: 36 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,42 @@ case $1 in
chown homegear:homegear /var/log/homegear-gateway
chmod 750 /var/log/homegear-gateway

mkdir -p /var/lib/homegear-gateway
chown homegear:homegear /var/lib/homegear-gateway
chmod 750 /var/lib/homegear-gateway

uuid=$(cat /proc/sys/kernel/random/uuid)
sed -i "s/^#uPnPUDN .*/uPnPUDN = ${uuid}/g" /etc/homegear/gateway.conf
password=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1)
sed -i "s/^#configurationPassword .*/configurationPassword = ${password}/g" /etc/homegear/gateway.conf

if test ! -e /var/lib/homegear-gateway/dh.pem; then
if [[ $DIALOG_OUTPUT ]]; then
platform=$(dpkg --print-architecture)
if [[ $platform == "armhf" ]] || [[ $platform == "arm64" ]]; then
echo "The generation can take up to 30 minutes."
fi
openssl dhparam -check -text -5 -out /var/lib/homegear-gateway/dh.pem 1024 > /dev/null 2>&1 &
opensslPid=$!
exitcode=0
counter=0
while [[ $exitcode -eq 0 ]]; do
kill -0 $opensslPid > /dev/null 2>&1
exitcode=$?
counter=$((counter+1))
if [[ $counter -eq 30 ]]; then
counter=0
echo "Please wait..."
fi
sleep 1
done
else
openssl dhparam -check -text -5 -out /var/lib/homegear-gateway/dh.pem 1024
fi
chown homegear:homegear /var/lib/homegear-gateway/dh.pem
chmod 400 /var/lib/homegear-gateway/dh.pem
fi

pidof systemd
if [ $? -eq 0 ]; then
systemctl enable homegear-gateway.service
Expand Down
40 changes: 31 additions & 9 deletions misc/Config Directory/gateway.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,52 @@ workingDirectory = /var/log/homegear-gateway
# Default: logfilePath = /var/log/homegear-gateway
logfilePath = /var/log/homegear-gateway

# Default: dataPath = /var/lib/homegear-gateway
dataPath = /var/lib/homegear-gateway

# Default: lockfilePath = /var/lock
lockfilePath = /var/lock

### TLS options ###

# The path to the certificate authority's certificate
# The path to the certificate authority's certificate.
# If empty, Homegear Gateway looks for "ca.crt" in dataPath.
caFile =

# The path to the PEM encoded client certificate.
# If empty, Homegear Gateway looks for "gatewary.crt" in dataPath.
certPath =

# The path to the PEM encoded client keyfile.
# If empty, Homegear Gateway looks for "gatewary.key" in dataPath.
keyPath =

# The path to the Diffie-Hellman parameters.
# If empty, Homegear Gateway looks for "dh.pem" in dataPath.
dhPath =

# The password used to decrypt configuration data sent to an unconfigured gateway.
#configurationPassword = changeme

# Enable UPnP server for other devices to be able to discover this installation of Homegear Gateway
# Default: enableUPnP = true
enableUPnP = false
enableUPnP = true

# Sets the IP address, the UPnP server listens on. By default auto discovery is used, but this might not work,
# if multiple interfaces exist. Only set specific IP addresses not "0.0.0.0". Alternatively the interface name can be
# specified here (e. g. "eth0").
# Default: uPnPIpAddress =
# uPnPIpAddress =

# Please change this setting! Set a unique UPnP UDN here.
# Please change this setting! Set a unique UPnP UDN here. When installed as a Debian package, a unique UUID is created
# automatically.
# E. g.: 0660e537-dada-affe-cafe-001ff3590148
# Default: uPnPUDN =
uPnPUDN = 0660e537-dada-affe-cafe-001ff3590148
#uPnPUDN = 0660e537-dada-affe-cafe-001ff3590148

#{{{ EnOcean example config

## The device family the gateway is for.
## Options:
## - EnOcean, HomeMaticCulfw
#family = EnOcean

## The device to use
Expand All @@ -79,8 +88,6 @@ uPnPUDN = 0660e537-dada-affe-cafe-001ff3590148
#{{{ HomeMatic CUL example config

## The device family the gateway is for.
## Options:
## - EnOcean, HomeMaticCulfw
#family = HomeMaticCulfw

## The device to use
Expand All @@ -92,7 +99,6 @@ uPnPUDN = 0660e537-dada-affe-cafe-001ff3590148

## The device family the gateway is for.
## Options:
## - EnOcean, HomeMaticCulfw
#family = HomeMaticCulfw

## The device to use
Expand All @@ -103,4 +109,20 @@ uPnPUDN = 0660e537-dada-affe-cafe-001ff3590148

#}}}

#{{{ HomeMatic TICC1101 example config

## The device family the gateway is for.
#family = HomeMaticCc1101

## The device to use
#device = /dev/spidev0.0

## The interrupt pin to use. "0" for GDO0 or "2" for GDO2.
## You only need to connect one of them. Specify the GPIO
## you connected the interrupt pin to below.
#interruptPin = 2

## The GPIO GDO0 or GDO2 is connected to. Specify which GDO to use above.
#gpio1 = 24

#}}}
2 changes: 2 additions & 0 deletions src/Families/EnOcean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ EnOcean::EnOcean(BaseLib::SharedObjects* bl) : ICommunicationInterface(bl)
{
try
{
_familyId = ENOCEAN_FAMILY_ID;

_initComplete = false;
_stopped = true;

Expand Down
Loading

0 comments on commit 9572529

Please sign in to comment.