From 34a6e6afd4c0f0cb10aed39bbbfd44a94c8f7e85 Mon Sep 17 00:00:00 2001
From: erwin <>
Date: Mon, 19 Aug 2024 18:56:51 +0000
Subject: [PATCH] 00_KNXIO.pm: a few fixes, (Forum #127792)
git-svn-id: https://svn.fhem.de/fhem/trunk@29085 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/00_KNXIO.pm | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/fhem/FHEM/00_KNXIO.pm b/fhem/FHEM/00_KNXIO.pm
index b19438094..ff7581f22 100644
--- a/fhem/FHEM/00_KNXIO.pm
+++ b/fhem/FHEM/00_KNXIO.pm
@@ -81,6 +81,7 @@
# add a few debug msgs
# 25/04/2024 changed _open for mode S
# replaced/removed experimental given/when
+# 19/08/2024 fix error-msg when mode S fails to open
package KNXIO; ## no critic 'package'
@@ -132,7 +133,6 @@ BEGIN {
#####################################
# global vars/constants
-my $MODELERR = 'MODEL_NOT_DEFINED';
my $PAT_IP = '[\d]{1,3}(\.[\d]{1,3}){3}';
my $PAT_PORT = '[\d]{4,5}';
my $KNXID = 'C';
@@ -847,7 +847,7 @@ sub KNXIO_openDev {
$ret = ::TcpServer_MCastAdd($hash,$host);
if (defined($ret)) { # error
KNXIO_Log ($name, 2, qq{MC add failed: $ret});
- return qq{KNXIO_openDev ($name): MC add failed: $ret};
+ return qq{KNXIO_openDev ($name): MC add failed: $ret};
}
::TcpServer_SetLoopbackMode($hash,0); # disable loopback
@@ -860,11 +860,11 @@ sub KNXIO_openDev {
if ($mode eq q{S}) { ### socket mode
if (!(-S -r -w $spath) ) {
KNXIO_Log ($name, 2, q{Socket not available - (knxd running?)});
- KNXIO_disconnect($hash, 30);
- readingsSingleUpdate($hash, 'state', 'disconnected', 1);
- return qq{KNXIO_openDev ($name): Socket not available - (knxd running?)};
+ $ret = qq{KNXIO_openDev ($name): Socket not available - (knxd running?)};
+ }
+ else {
+ $ret = ::DevIo_OpenDev($hash,$reopen,\&KNXIO_init); # no callback
}
- $ret = ::DevIo_OpenDev($hash,$reopen,\&KNXIO_init); # no callback
}
if ($mode eq q{H}) { ### host udp
@@ -1056,8 +1056,8 @@ sub KNXIO_processFIFO {
my $queentriesOld = $queentries;
@que = KNXIO_deldupes(@que);
$queentries = scalar(@que);
- KNXIO_Log ($name, 5, q{deleted } . ($queentriesOld - $queentries) .
- qq{ duplicate msgs from queue, $queentries remain});
+ my $qdiff = $queentriesOld - $queentries;
+ KNXIO_Log ($name, 3, qq{deleted $qdiff duplicate msgs from queue, $queentries remain}) if ($qdiff > 0);;
}
if ($queentries > 0) { # process timer is not running & fifo not empty
@@ -1456,6 +1456,7 @@ __END__
If you have a KNX-router that supports multicast, you do not need a KNXD installation.
Default address:port is 224.0.23.12:3671
Pls. ensure that you have only one GW/KNXD in your LAN that feed the multicast tree!
+ If you run FHEM in Docker, note that multicast is not supported in network-mode bridge, but macvlan supports multicast.