<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Forum KNX francophone / English KNX forum - Tous les forums]]></title>
		<link>https://www.knx-fr.com/</link>
		<description><![CDATA[Forum KNX francophone / English KNX forum - https://www.knx-fr.com]]></description>
		<pubDate>Fri, 09 Oct 2026 13:21:59 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[GVS Smart Touch S3 – My experience with installation, issues and after-sales support]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16457</link>
			<pubDate>Sat, 03 Oct 2026 17:24:12 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=9209">Silver60</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16457</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">GVS Smart Touch S3 – My experience with installation, issues and after-sales support</span><br />
<br />
I wanted to share my experience with the GVS Smart Touch S3, including the problems I encountered with two second-hand units and, more importantly, how GVS eventually handled the situation.<br />
I think it is useful to share the complete story because there are still relatively few detailed user experiences with GVS on French and English-speaking KNX forums.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">My installation</span><br />
I have four GVS Smart Touch S3 panels installed on the same KNX line, with 24 V power supply.<br />
Two of them are newer white S3 panels that I purchased new from Smartkram in Germany. These worked normally from the beginning, including Wi-Fi, the GVS application and the IoT/cloud functions.<br />
The other two were older grey S3 panels that I purchased second-hand from a professional demonstrator.<br />
These two older panels are where the problems started.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The first problem: unexpected reboots</span><br />
The first issue I encountered was recurrent and unexpected rebooting of the grey S3 panels.<br />
After several tests, GVS suggested disabling some of the HomePage functions. This did stop the reboots, but for me this was clearly only a workaround. I did not want to lose part of the functionality of the S3 simply to prevent it from rebooting.<br />
The objective was therefore to find a real solution rather than permanently disabling features.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Wi-Fi issue</span><br />
I also encountered a strange Wi-Fi problem.<br />
The S3 reported an incorrect password even though the password was correct. After several tests, I eventually discovered that the older S3 units had a limitation related to Wi-Fi password length.<br />
Using a shorter password, including through an iPhone hotspot and a separate 2.4 GHz network, allowed the panels to connect correctly.<br />
So the problem was not my Wi-Fi network itself, but rather a compatibility limitation of these older units.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The cloud / IoT problem</span><br />
The most important issue was related to the GVS IoT/cloud functionality.<br />
The two newer white S3 panels had the IoT/cloud icon, while the two older grey S3 panels did not.<br />
As a result, the grey panels could not be properly connected to my GVS IoT account. The GVS application could detect them, but they appeared as offline, even though I knew that they were connected to Wi-Fi and had Internet access.<br />
This had several practical consequences.<br />
I could not properly manage the devices through the GVS IoT service, and in particular, I could not rename them.<br />
The panels therefore remained identified in the application by their serial numbers, rather than by meaningful names corresponding to their location or function. With several identical S3 panels in the same installation, this made device management unnecessarily difficult.<br />
The missing IoT connection also prevented me from accessing other GVS-specific functions, including the SIP/intercom functionality that I wanted to use.<br />
KNX was working, but GVS-specific functions were not<br />
It is important to make this distinction.<br />
The KNX side of the installation was working correctly. The panels were powered, connected to the KNX bus and communicating normally.<br />
The Wi-Fi and Internet connections could also be established.<br />
The problems were therefore mainly related to the GVS-specific software, IoT/cloud functions and the older hardware/firmware generation of these two grey panels.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Firmware and support investigation</span><br />
GVS and I spent quite some time investigating the possible causes and looking at firmware and OTA update possibilities.<br />
However, the situation was somewhat circular: the missing IoT functionality was itself preventing the normal cloud-based process that could potentially have been used to update the panels.<br />
There were quite a few exchanges and tests before the situation became clear.<br />
I have to be honest: at some points, the support process felt rather long and sometimes seemed to go in circles. However, GVS continued to work with me on the problem rather than simply closing the case with a workaround.<br />
Eventually, they proposed replacing both problematic S3 panels.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Replacement of the two panels</span><br />
GVS provided the replacement panels themselves.<br />
I agreed to cover the DHL shipping costs and the customs/import costs associated with bringing the replacement units from China to France.<br />
We also discussed the customs documentation because the replacement was being shipped from China to France. I specifically asked GVS to make sure that the shipment was clearly identified as a standard warranty replacement, rather than a normal commercial purchase.<br />
I then paid the DHL shipping costs as well as the applicable customs/import charges.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The replacement panels</span><br />
The replacement units were the same general generation as the original grey panels, marked CHTF-3.3/3.1.01.<br />
The replacement process on my side was actually very straightforward.<br />
I did not need to rebuild my ETS project. I simply removed the old physical panels, installed the replacement units, assigned them the same individual addresses and downloaded the existing ETS configuration.<br />
All the existing KNX parameters, group addresses, configured pages and other settings were retained.<br />
Everything worked immediately.<br />
And finally, everything worked<br />
This was the most satisfying part of the whole process.<br />
I was able to add both replacement panels to the GVS application.<br />
The IoT/cloud connection worked correctly, the panels could be renamed, and the SIP functionality also worked as expected.<br />
In other words, the replacement panels finally provided all the functionality that I had originally expected from the S3.<br />
I now have four fully operational S3 panels, with the KNX, IoT and SIP functions working correctly.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">A reassuring point about GVS's approach to product longevity</span><br />
During my discussions with GVS, I was reassured by the company's approach to the S3 as a product.<br />
GVS explained to me that they do not consider these products to be short-lived gadgets, but rather equipment intended to become part of the infrastructure of a home and to remain in service for many years — with a target lifespan of at least around ten years.<br />
For me, this is an important distinction.<br />
A KNX installation is infrastructure. When you install touch panels, actuators and other components in a house, you are not necessarily expecting to replace them every two or three years simply because a new generation has appeared.<br />
This is one of the reasons I chose KNX in the first place.<br />
I was also particularly reassured by the fact that, in my case, GVS accepted the warranty claim for second-hand S3 units. The panels had originally been purchased by someone else, but GVS nevertheless agreed to deal with the issue and ultimately provided replacement units.<br />
This is something I personally appreciate. It is consistent with the idea that durable equipment should retain meaningful after-sales support throughout its useful life, rather than being treated as disposable technology simply because it has changed hands.<br />
I obviously cannot speak for every possible product or situation, but this is what I experienced with my S3 case, and it contributed significantly to my confidence in the brand.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">My overall assessment</span><br />
I think it is important to be transparent about the fact that the experience was not perfect.<br />
There were genuine technical issues, the troubleshooting process was relatively long, and some of the initial solutions were more like workarounds than definitive fixes.<br />
At the same time, I think it is equally important to mention what happened afterwards.<br />
GVS continued to investigate the problem, accepted the warranty claim in my particular case, provided replacement units and ultimately resolved the issue completely.<br />
The final result is therefore very positive from my point of view.<br />
I will therefore continue to trust GVS for my home automation installation and will be happy to consider other GVS products as I continue to develop my KNX system.]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">GVS Smart Touch S3 – My experience with installation, issues and after-sales support</span><br />
<br />
I wanted to share my experience with the GVS Smart Touch S3, including the problems I encountered with two second-hand units and, more importantly, how GVS eventually handled the situation.<br />
I think it is useful to share the complete story because there are still relatively few detailed user experiences with GVS on French and English-speaking KNX forums.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">My installation</span><br />
I have four GVS Smart Touch S3 panels installed on the same KNX line, with 24 V power supply.<br />
Two of them are newer white S3 panels that I purchased new from Smartkram in Germany. These worked normally from the beginning, including Wi-Fi, the GVS application and the IoT/cloud functions.<br />
The other two were older grey S3 panels that I purchased second-hand from a professional demonstrator.<br />
These two older panels are where the problems started.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The first problem: unexpected reboots</span><br />
The first issue I encountered was recurrent and unexpected rebooting of the grey S3 panels.<br />
After several tests, GVS suggested disabling some of the HomePage functions. This did stop the reboots, but for me this was clearly only a workaround. I did not want to lose part of the functionality of the S3 simply to prevent it from rebooting.<br />
The objective was therefore to find a real solution rather than permanently disabling features.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Wi-Fi issue</span><br />
I also encountered a strange Wi-Fi problem.<br />
The S3 reported an incorrect password even though the password was correct. After several tests, I eventually discovered that the older S3 units had a limitation related to Wi-Fi password length.<br />
Using a shorter password, including through an iPhone hotspot and a separate 2.4 GHz network, allowed the panels to connect correctly.<br />
So the problem was not my Wi-Fi network itself, but rather a compatibility limitation of these older units.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The cloud / IoT problem</span><br />
The most important issue was related to the GVS IoT/cloud functionality.<br />
The two newer white S3 panels had the IoT/cloud icon, while the two older grey S3 panels did not.<br />
As a result, the grey panels could not be properly connected to my GVS IoT account. The GVS application could detect them, but they appeared as offline, even though I knew that they were connected to Wi-Fi and had Internet access.<br />
This had several practical consequences.<br />
I could not properly manage the devices through the GVS IoT service, and in particular, I could not rename them.<br />
The panels therefore remained identified in the application by their serial numbers, rather than by meaningful names corresponding to their location or function. With several identical S3 panels in the same installation, this made device management unnecessarily difficult.<br />
The missing IoT connection also prevented me from accessing other GVS-specific functions, including the SIP/intercom functionality that I wanted to use.<br />
KNX was working, but GVS-specific functions were not<br />
It is important to make this distinction.<br />
The KNX side of the installation was working correctly. The panels were powered, connected to the KNX bus and communicating normally.<br />
The Wi-Fi and Internet connections could also be established.<br />
The problems were therefore mainly related to the GVS-specific software, IoT/cloud functions and the older hardware/firmware generation of these two grey panels.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Firmware and support investigation</span><br />
GVS and I spent quite some time investigating the possible causes and looking at firmware and OTA update possibilities.<br />
However, the situation was somewhat circular: the missing IoT functionality was itself preventing the normal cloud-based process that could potentially have been used to update the panels.<br />
There were quite a few exchanges and tests before the situation became clear.<br />
I have to be honest: at some points, the support process felt rather long and sometimes seemed to go in circles. However, GVS continued to work with me on the problem rather than simply closing the case with a workaround.<br />
Eventually, they proposed replacing both problematic S3 panels.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Replacement of the two panels</span><br />
GVS provided the replacement panels themselves.<br />
I agreed to cover the DHL shipping costs and the customs/import costs associated with bringing the replacement units from China to France.<br />
We also discussed the customs documentation because the replacement was being shipped from China to France. I specifically asked GVS to make sure that the shipment was clearly identified as a standard warranty replacement, rather than a normal commercial purchase.<br />
I then paid the DHL shipping costs as well as the applicable customs/import charges.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The replacement panels</span><br />
The replacement units were the same general generation as the original grey panels, marked CHTF-3.3/3.1.01.<br />
The replacement process on my side was actually very straightforward.<br />
I did not need to rebuild my ETS project. I simply removed the old physical panels, installed the replacement units, assigned them the same individual addresses and downloaded the existing ETS configuration.<br />
All the existing KNX parameters, group addresses, configured pages and other settings were retained.<br />
Everything worked immediately.<br />
And finally, everything worked<br />
This was the most satisfying part of the whole process.<br />
I was able to add both replacement panels to the GVS application.<br />
The IoT/cloud connection worked correctly, the panels could be renamed, and the SIP functionality also worked as expected.<br />
In other words, the replacement panels finally provided all the functionality that I had originally expected from the S3.<br />
I now have four fully operational S3 panels, with the KNX, IoT and SIP functions working correctly.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">A reassuring point about GVS's approach to product longevity</span><br />
During my discussions with GVS, I was reassured by the company's approach to the S3 as a product.<br />
GVS explained to me that they do not consider these products to be short-lived gadgets, but rather equipment intended to become part of the infrastructure of a home and to remain in service for many years — with a target lifespan of at least around ten years.<br />
For me, this is an important distinction.<br />
A KNX installation is infrastructure. When you install touch panels, actuators and other components in a house, you are not necessarily expecting to replace them every two or three years simply because a new generation has appeared.<br />
This is one of the reasons I chose KNX in the first place.<br />
I was also particularly reassured by the fact that, in my case, GVS accepted the warranty claim for second-hand S3 units. The panels had originally been purchased by someone else, but GVS nevertheless agreed to deal with the issue and ultimately provided replacement units.<br />
This is something I personally appreciate. It is consistent with the idea that durable equipment should retain meaningful after-sales support throughout its useful life, rather than being treated as disposable technology simply because it has changed hands.<br />
I obviously cannot speak for every possible product or situation, but this is what I experienced with my S3 case, and it contributed significantly to my confidence in the brand.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">My overall assessment</span><br />
I think it is important to be transparent about the fact that the experience was not perfect.<br />
There were genuine technical issues, the troubleshooting process was relatively long, and some of the initial solutions were more like workarounds than definitive fixes.<br />
At the same time, I think it is equally important to mention what happened afterwards.<br />
GVS continued to investigate the problem, accepted the warranty claim in my particular case, provided replacement units and ultimately resolved the issue completely.<br />
The final result is therefore very positive from my point of view.<br />
I will therefore continue to trust GVS for my home automation installation and will be happy to consider other GVS products as I continue to develop my KNX system.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Migration projet ET5 vers ETS6 Home]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16456</link>
			<pubDate>Fri, 25 Sep 2026 09:53:05 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=4361">fichatel</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16456</guid>
			<description><![CDATA[Bonjour,<br />
<br />
Mon projet a été conçu sous ET5 (5.5 de mémoire, je ne sais pas comment voir ça avec le .proj sans avoir ETS installé,<br />
ça n'est pas moi qui l'ai réalisé).<br />
<br />
Est-ce qu'il est possible de migrer ce projet vers ETS6 Home ?<br />
<br />
Comme il y a une promo en cours (comme régulièrement), je me posais la question d'investir dans une version<br />
Home pour m'y mettre.]]></description>
			<content:encoded><![CDATA[Bonjour,<br />
<br />
Mon projet a été conçu sous ET5 (5.5 de mémoire, je ne sais pas comment voir ça avec le .proj sans avoir ETS installé,<br />
ça n'est pas moi qui l'ai réalisé).<br />
<br />
Est-ce qu'il est possible de migrer ce projet vers ETS6 Home ?<br />
<br />
Comme il y a une promo en cours (comme régulièrement), je me posais la question d'investir dans une version<br />
Home pour m'y mettre.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Projet Proxmox / Home assistant / Jellyfin]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16455</link>
			<pubDate>Wed, 23 Sep 2026 09:09:08 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=16432">fafane84</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16455</guid>
			<description><![CDATA[Salut à tous !<br />
<br />
J'ai eu l'occasion de récupérer un mini-PC Lenovo dont voici les caractéristiques :<br />
<br />
- Modèle du matériel : Lenovo ThinkCentre M715q<br />
- Mémoire : 8,0 Gio<br />
- Processeur : AMD PRO A10-9700E R7, 10 COMPUTE CORES 4C+6G × 4<br />
- Carte graphique : AMD Radeon™ R7 Graphics<br />
- Capacité du disque : 500 Go<br />
<br />
Cela faisait longtemps que j'envisageais de me lancer dans un serveur Proxmox qui hébergerait :<br />
- un serveur domotique Home Assistant<br />
- un serveur média Jellyfin<br />
<br />
Au vu des caractéristiques du mini-PC ce projet est-il viable ?<br />
<br />
J'ai tellement lu de chose sur les serveurs que j'en arrive à me mélanger les pinceaux, mais je crois me souvenir qu'il fallait allouer 2 Go de RAM par serveur en plus des 2 Go pour Proxmox.<br />
<br />
Est-ce correct ?<br />
<br />
Merci d'avance pour vos réponses et vos bons conseils.]]></description>
			<content:encoded><![CDATA[Salut à tous !<br />
<br />
J'ai eu l'occasion de récupérer un mini-PC Lenovo dont voici les caractéristiques :<br />
<br />
- Modèle du matériel : Lenovo ThinkCentre M715q<br />
- Mémoire : 8,0 Gio<br />
- Processeur : AMD PRO A10-9700E R7, 10 COMPUTE CORES 4C+6G × 4<br />
- Carte graphique : AMD Radeon™ R7 Graphics<br />
- Capacité du disque : 500 Go<br />
<br />
Cela faisait longtemps que j'envisageais de me lancer dans un serveur Proxmox qui hébergerait :<br />
- un serveur domotique Home Assistant<br />
- un serveur média Jellyfin<br />
<br />
Au vu des caractéristiques du mini-PC ce projet est-il viable ?<br />
<br />
J'ai tellement lu de chose sur les serveurs que j'en arrive à me mélanger les pinceaux, mais je crois me souvenir qu'il fallait allouer 2 Go de RAM par serveur en plus des 2 Go pour Proxmox.<br />
<br />
Est-ce correct ?<br />
<br />
Merci d'avance pour vos réponses et vos bons conseils.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Remplacement du Hager WKT302/4 (porte etiquette)]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16453</link>
			<pubDate>Mon, 21 Sep 2026 14:06:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=2290">NicNac</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16453</guid>
			<description><![CDATA[Bonjour,<br />
<br />
cela fait quelques années que j'utilise cet interrupteur WKT302...4 avec porte étiquette utile pour éclairer de nuit mes couloirs ou les WCs.<br />
<br />
Mais c'est connu le défaut de ces interrupteurs ce les caches boutons qui ont l'envie de tomber. <br />
Je les recolle mais m'a question est:<br />
<br />
Y a t'il un remplacement qui peut émettre un éclairage commandé qui font donc éclairage de veille ?<br />
<br />
Ce ne doit pas être du Hager.<br />
<br />
J'ai 114 devices et 6 marques différentes.<br />
<br />
Merci à +]]></description>
			<content:encoded><![CDATA[Bonjour,<br />
<br />
cela fait quelques années que j'utilise cet interrupteur WKT302...4 avec porte étiquette utile pour éclairer de nuit mes couloirs ou les WCs.<br />
<br />
Mais c'est connu le défaut de ces interrupteurs ce les caches boutons qui ont l'envie de tomber. <br />
Je les recolle mais m'a question est:<br />
<br />
Y a t'il un remplacement qui peut émettre un éclairage commandé qui font donc éclairage de veille ?<br />
<br />
Ce ne doit pas être du Hager.<br />
<br />
J'ai 114 devices et 6 marques différentes.<br />
<br />
Merci à +]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[Projet] Une stack KNX TP1 open source pour Zephyr RTOS + carte KnxBoard]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16452</link>
			<pubDate>Sun, 20 Sep 2026 10:19:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=2501">condo4</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16452</guid>
			<description><![CDATA[Bonjour à tous,<br />
<br />
Je voulais partager un projet sur lequel je travaille depuis plusieurs années : une implémentation du protocole KNX (TP1, mode S, System B — masque 07B0h) en pure C, principalement pour STM332, mais pas que...<br />
Après plusieurs années et différent essais j'ai choisi de le porter sur Zephyr RTOS.<br />
J'ai aussi fait une carte électronique open hardware qui va avec.<br />
<br />
Pourquoi ce projet ?<br />
<br />
Il n'existait pas, à ma connaissance, de stack KNX correctement intégrée à un OS temps réel open source comme Zephyr.<br />
Je n'avais trouver que la stack C++ Thelsing, surtout orienté Arduino, et, difficilement portable sur n'importe quel environnement.<br />
<br />
L'objectif est de fournir une base solide, testée, et surtout générique — pas liée à un produit ou un capteur en particulier — qui puisse à terme être proposée en amont (mainline) dans Zephyr.<br />
<br />
Ce que ça couvre<br />
<br />
- La stack protocolaire complète : couches Liaison de données, Réseau, Transport (machine à états Style 3 complète) et Application (21 services APDU), les objets d'interface System B, les Datapoint Types courants, et la persistance mémoire compatible avec le modèle de téléchargement ETS.<br />
- Le driver pour le transceiver onsemi NCN5130 (liaison UART 9 bits).<br />
- Un driver de "loopback" logiciel, pratique pour faire tourner et tester la stack sans bus KNX physique.<br />
- Une suite de tests unitaires (8 suites, exécutables sans matériel).<br />
<br />
<br />
La carte : KnxBoard<br />
<br />
En parallèle, j'ai conçu KnxBoard, une carte STM32G4 + NCN5130 pensée comme une "carte de base" générique (un peu à la manière d'un Arduino) : elle ne fait que parler KNX TP1, et on vient y greffer une "carte plus simple" (daughterboard) selon le produit voulu — j'ai deux exemples fonctionnels : une sonde 1-Wire (DS18B20) et une sonde PT100.<br />
<br />
Schémas, PCB et documentation matérielle sont sur GitHub : (Projet Kicad)<br />
<br />
J'ai fait des PCBA sur JLCPCB, ce qui revient autour de 30€ la carte par 5 exemplaires, (PCB + Composant + Assamblage)<br />
Je referais un nouveau prototype prochainement, j'ai une V6 dans les tuyaux avec quelque léger changement, mais la V5 fonctionne parfaitement.<br />
<br />
<a href="https://github.com/condo4/knxboard" target="_blank" rel="noopener" class="mycode_url">https://github.com/condo4/knxboard</a><br />
<br />
Je posterais prochainement les daughterboard et des photos<br />
<br />
Où en est-on ?<br />
<br />
Un téléchargement partiel ETS fonctionne de bout en bout sur la carte réelle, et toute la stack est couverte par des tests. Mais — et c'est important de le dire clairement : ce n'est pas une stack certifiée KNX, elle n'implémente pas KNX Data Secure, et je ne donne aucune garantie de conformité totale au protocole au-delà de ce qui a été testé sur banc. C'est un point de départ robuste, pas un produit fini.<br />
<br />
Et maintenant ?<br />
<br />
Le code est en cours de préparation pour une proposition d'intégration à Zephyr. N'hésitez pas à jeter un œil, tester, remonter des retours ou contribuer — toute aide est la bienvenue, que ce soit sur la stack, le hardware, ou les tests de conformité avec de vrais produits KNX du marché.<br />
<br />
En attendant les corrections et la finalisation de la PR, le code est déjà dispo sur<br />
<a href="https://github.com/condo4/zephyr/tree/devel/knx-protocol" target="_blank" rel="noopener" class="mycode_url">https://github.com/condo4/zephyr/tree/de...x-protocol</a><br />
<br />
Merci de votre lecture, et n'hésitez pas si vous avez des questions !]]></description>
			<content:encoded><![CDATA[Bonjour à tous,<br />
<br />
Je voulais partager un projet sur lequel je travaille depuis plusieurs années : une implémentation du protocole KNX (TP1, mode S, System B — masque 07B0h) en pure C, principalement pour STM332, mais pas que...<br />
Après plusieurs années et différent essais j'ai choisi de le porter sur Zephyr RTOS.<br />
J'ai aussi fait une carte électronique open hardware qui va avec.<br />
<br />
Pourquoi ce projet ?<br />
<br />
Il n'existait pas, à ma connaissance, de stack KNX correctement intégrée à un OS temps réel open source comme Zephyr.<br />
Je n'avais trouver que la stack C++ Thelsing, surtout orienté Arduino, et, difficilement portable sur n'importe quel environnement.<br />
<br />
L'objectif est de fournir une base solide, testée, et surtout générique — pas liée à un produit ou un capteur en particulier — qui puisse à terme être proposée en amont (mainline) dans Zephyr.<br />
<br />
Ce que ça couvre<br />
<br />
- La stack protocolaire complète : couches Liaison de données, Réseau, Transport (machine à états Style 3 complète) et Application (21 services APDU), les objets d'interface System B, les Datapoint Types courants, et la persistance mémoire compatible avec le modèle de téléchargement ETS.<br />
- Le driver pour le transceiver onsemi NCN5130 (liaison UART 9 bits).<br />
- Un driver de "loopback" logiciel, pratique pour faire tourner et tester la stack sans bus KNX physique.<br />
- Une suite de tests unitaires (8 suites, exécutables sans matériel).<br />
<br />
<br />
La carte : KnxBoard<br />
<br />
En parallèle, j'ai conçu KnxBoard, une carte STM32G4 + NCN5130 pensée comme une "carte de base" générique (un peu à la manière d'un Arduino) : elle ne fait que parler KNX TP1, et on vient y greffer une "carte plus simple" (daughterboard) selon le produit voulu — j'ai deux exemples fonctionnels : une sonde 1-Wire (DS18B20) et une sonde PT100.<br />
<br />
Schémas, PCB et documentation matérielle sont sur GitHub : (Projet Kicad)<br />
<br />
J'ai fait des PCBA sur JLCPCB, ce qui revient autour de 30€ la carte par 5 exemplaires, (PCB + Composant + Assamblage)<br />
Je referais un nouveau prototype prochainement, j'ai une V6 dans les tuyaux avec quelque léger changement, mais la V5 fonctionne parfaitement.<br />
<br />
<a href="https://github.com/condo4/knxboard" target="_blank" rel="noopener" class="mycode_url">https://github.com/condo4/knxboard</a><br />
<br />
Je posterais prochainement les daughterboard et des photos<br />
<br />
Où en est-on ?<br />
<br />
Un téléchargement partiel ETS fonctionne de bout en bout sur la carte réelle, et toute la stack est couverte par des tests. Mais — et c'est important de le dire clairement : ce n'est pas une stack certifiée KNX, elle n'implémente pas KNX Data Secure, et je ne donne aucune garantie de conformité totale au protocole au-delà de ce qui a été testé sur banc. C'est un point de départ robuste, pas un produit fini.<br />
<br />
Et maintenant ?<br />
<br />
Le code est en cours de préparation pour une proposition d'intégration à Zephyr. N'hésitez pas à jeter un œil, tester, remonter des retours ou contribuer — toute aide est la bienvenue, que ce soit sur la stack, le hardware, ou les tests de conformité avec de vrais produits KNX du marché.<br />
<br />
En attendant les corrections et la finalisation de la PR, le code est déjà dispo sur<br />
<a href="https://github.com/condo4/zephyr/tree/devel/knx-protocol" target="_blank" rel="noopener" class="mycode_url">https://github.com/condo4/zephyr/tree/de...x-protocol</a><br />
<br />
Merci de votre lecture, et n'hésitez pas si vous avez des questions !]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Présentation]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16451</link>
			<pubDate>Fri, 18 Sep 2026 14:28:19 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=16376">paulovoy</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16451</guid>
			<description><![CDATA[Bonjour à tous,<br />
Je débute tout juste en domotique, mais je commence à vraiment me passionner pour le sujet. Je trouve ça hyper pratique, surtout que je bouge pas mal et voyage régulièrement. Pouvoir controler sa maison à distance, vérifier que tout va bien et automatiser certaines choses, c'est vraiment l'idéal !<br />
Hâte d'échanger avec vous et d'en apprendre plus]]></description>
			<content:encoded><![CDATA[Bonjour à tous,<br />
Je débute tout juste en domotique, mais je commence à vraiment me passionner pour le sujet. Je trouve ça hyper pratique, surtout que je bouge pas mal et voyage régulièrement. Pouvoir controler sa maison à distance, vérifier que tout va bien et automatiser certaines choses, c'est vraiment l'idéal !<br />
Hâte d'échanger avec vous et d'en apprendre plus]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Intégration robot tondeuse Mammotion dans la supervision jardin KNX, possible ?]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16450</link>
			<pubDate>Thu, 17 Sep 2026 02:55:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=16342">Allice</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16450</guid>
			<description><![CDATA[Bonjour à tous,<br />
<br />
Je suis en plein câblage de la partie extérieure de la maison à Chambéry (terrain d’environ 900 m² avec une petite pente), avec les vannes d’arrosage, le portail Nice, l’éclairage de jardin, etc. Tout remonte sur le bus KNX via une passerelle qu’on avait prévue dès le départ pour dialoguer avec l’API du portail et de l’arrosage.<br />
<br />
Du coup je commence aussi à réfléchir à la tondeuse robot qu’on prendra une fois la pelouse posée. L’idée serait de pouvoir gérer les horaires de tonte et d’arrosage depuis la même visu, histoire d’éviter que la tondeuse se mette en route juste après un arrosage.<br />
<br />
En regardant un peu les solutions qui existent, <a href="https://www.journaldurobot.com/robot-tondeuse/robot-tondeuse-mammotion/" target="_blank" rel="noopener" class="mycode_url"><span style="color: #333333;" class="mycode_color">tu peux partir sur un robot tondeuse Mammotion</span></a>, notamment si l’objectif est de pouvoir faire communiquer la tondeuse avec une installation domotique. Par contre, je cherche surtout des retours de personnes qui ont réellement testé ce type d’intégration avec du KNX.<br />
<br />
Est-ce qu’on reste sur des commandes assez basiques comme marche/arrêt et remontée du statut, ou est-ce qu’il est possible de faire des scénarios plus poussés avec l’arrosage et l’éclairage ?<br />
<br />
Merci pour vos retours,]]></description>
			<content:encoded><![CDATA[Bonjour à tous,<br />
<br />
Je suis en plein câblage de la partie extérieure de la maison à Chambéry (terrain d’environ 900 m² avec une petite pente), avec les vannes d’arrosage, le portail Nice, l’éclairage de jardin, etc. Tout remonte sur le bus KNX via une passerelle qu’on avait prévue dès le départ pour dialoguer avec l’API du portail et de l’arrosage.<br />
<br />
Du coup je commence aussi à réfléchir à la tondeuse robot qu’on prendra une fois la pelouse posée. L’idée serait de pouvoir gérer les horaires de tonte et d’arrosage depuis la même visu, histoire d’éviter que la tondeuse se mette en route juste après un arrosage.<br />
<br />
En regardant un peu les solutions qui existent, <a href="https://www.journaldurobot.com/robot-tondeuse/robot-tondeuse-mammotion/" target="_blank" rel="noopener" class="mycode_url"><span style="color: #333333;" class="mycode_color">tu peux partir sur un robot tondeuse Mammotion</span></a>, notamment si l’objectif est de pouvoir faire communiquer la tondeuse avec une installation domotique. Par contre, je cherche surtout des retours de personnes qui ont réellement testé ce type d’intégration avec du KNX.<br />
<br />
Est-ce qu’on reste sur des commandes assez basiques comme marche/arrêt et remontée du statut, ou est-ce qu’il est possible de faire des scénarios plus poussés avec l’arrosage et l’éclairage ?<br />
<br />
Merci pour vos retours,]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KNX Stack - C++ Code ESP32 pour l'IDE Arduino]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16449</link>
			<pubDate>Tue, 15 Sep 2026 17:42:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=10826">Smart Guido 73</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16449</guid>
			<description><![CDATA[Bonjour à tous,<br />
<br />
Je souhaite mettre à votre disposition ce code qui permet de communiquer avec KNX sur un ESP32 sans aucune bibliothèque supplémentaire. Il peut aussi bien envoyer que recevoir les télégrammes les plus courants.<br />
<br />
<div class="codeblock"><div class="title">Code :</div><div class="body" dir="ltr"><code>#include &lt;WiFi.h&gt;<br />
#include &lt;WiFiUdp.h&gt;<br />
#include &lt;WebServer.h&gt;<br />
#include &lt;time.h&gt;<br />
<br />
<br />
const char* projectName  = "KNX Stack";<br />
<br />
const char* ssid         = "WLAN SSID";<br />
const char* password     = "WLAN Passwort";<br />
<br />
const char* ntpServer    = "pool.ntp.org";<br />
const char* tzInfo       = "CET-1CEST,M3.5.0,M10.5.0/3";<br />
<br />
const char* knxGatewayIp = "IP KNX Gateway";<br />
const uint16_t knxPort   = 3671;<br />
const uint16_t localPort = 3671;<br />
<br />
WiFiUDP udp;<br />
WebServer server(80);<br />
<br />
uint8_t knxChannelId     = 0;<br />
uint8_t txSeqNum         = 0;<br />
bool isKnxConnected      = false;<br />
<br />
unsigned long lastHeartbeat = 0;<br />
const unsigned long HEARTBEAT_INTERVAL = 60000;<br />
const unsigned long ACK_TIMEOUT        = 1000;<br />
<br />
#define KNX_LOG_SIZE 10<br />
struct KnxLogEntry {<br />
  char timeStr[24];<br />
  uint16_t ga;<br />
  uint8_t data[16];<br />
  uint8_t len;<br />
};<br />
<br />
KnxLogEntry knxLog[KNX_LOG_SIZE];<br />
int knxLogNext = 0;<br />
int knxLogFilled = 0;<br />
<br />
void hexDump(const char* label, const uint8_t* buf, int len) {<br />
  Serial.printf("%s [%d Bytes]: ", label, len);<br />
  for (int i = 0; i &lt; len; i++) {<br />
    Serial.printf("%02X ", buf[i]);<br />
  }<br />
  Serial.println();<br />
}<br />
<br />
const char* knxStatusToString(uint8_t status) {<br />
  switch (status) {<br />
    case 0x00: return "E_NO_ERROR";<br />
    case 0x01: return "E_HOST_PROTOCOL_TYPE";<br />
    case 0x02: return "E_VERSION_NOT_SUPPORTED";<br />
    case 0x04: return "E_SEQUENCE_NUMBER (Sequenznummer falsch/ausser Sync)";<br />
    case 0x21: return "E_CONNECTION_ID (unbekannte Channel ID)";<br />
    case 0x22: return "E_CONNECTION_TYPE";<br />
    case 0x23: return "E_CONNECTION_OPTION";<br />
    case 0x24: return "E_NO_MORE_CONNECTIONS (Gateway voll)";<br />
    case 0x26: return "E_DATA_CONNECTION";<br />
    case 0x27: return "E_KNX_CONNECTION";<br />
    case 0x29: return "E_TUNNELING_LAYER (nicht unterstuetzt)";<br />
    default:   return "Unbekannter Statuscode";<br />
  }<br />
}<br />
<br />
String getFormattedDateTime() {<br />
  struct tm timeinfo;<br />
  if (!getLocalTime(&amp;timeinfo, 100)) {<br />
    return "Zeit nicht synchronisiert";<br />
  }<br />
  char buf[32];<br />
  strftime(buf, sizeof(buf), "%d.%m.%Y %H:%M:%S", &amp;timeinfo);<br />
  return String(buf);<br />
}<br />
<br />
uint16_t parseGroupAddress(const String&amp; gaStr) {<br />
  int firstSlash  = gaStr.indexOf('/');<br />
  int secondSlash = gaStr.indexOf('/', firstSlash + 1);<br />
  if (firstSlash == -1 || secondSlash == -1) return 0;<br />
<br />
  uint8_t main   = gaStr.substring(0, firstSlash).toInt();<br />
  uint8_t middle = gaStr.substring(firstSlash + 1, secondSlash).toInt();<br />
  uint8_t sub    = gaStr.substring(secondSlash + 1).toInt();<br />
<br />
  return ((main &amp; 0x1F) &lt;&lt; 11) | ((middle &amp; 0x07) &lt;&lt; 8) | (sub &amp; 0xFF);<br />
}<br />
<br />
String gaToString(uint16_t ga) {<br />
  uint8_t main   = (ga &gt;&gt; 11) &amp; 0x1F;<br />
  uint8_t middle = (ga &gt;&gt; 8) &amp; 0x07;<br />
  uint8_t sub    = ga &amp; 0xFF;<br />
  return String(main) + "/" + String(middle) + "/" + String(sub);<br />
}<br />
<br />
uint16_t floatToDpt9(float val) {<br />
  int sign = (val &lt; 0) ? 1 : 0;<br />
  float v = (sign == 1) ? -val : val;<br />
  int exp = 0;<br />
  int mantissa = (int)(v * 100.0f);<br />
  while (mantissa &gt; 2047) {<br />
    mantissa &gt;&gt;= 1;<br />
    exp++;<br />
  }<br />
  if (sign == 1) {<br />
    mantissa = -mantissa;<br />
    mantissa &amp;= 0x07FF;<br />
  }<br />
  return (sign &lt;&lt; 15) | ((exp &amp; 0x0F) &lt;&lt; 11) | (mantissa &amp; 0x07FF);<br />
}<br />
<br />
float dpt9ToFloat(uint8_t hi, uint8_t lo) {<br />
  uint16_t raw = ((uint16_t)hi &lt;&lt; 8) | lo;<br />
  int sign = (raw &gt;&gt; 15) &amp; 0x01;<br />
  int exp  = (raw &gt;&gt; 11) &amp; 0x0F;<br />
  int mantissa11 = raw &amp; 0x07FF;<br />
  int M = mantissa11 - (sign ? 2048 : 0);<br />
  return 0.01f * M * (float)(1 &lt;&lt; exp);<br />
}<br />
<br />
void floatToDpt14Bytes(float val, uint8_t* out4) {<br />
  uint8_t* p = (uint8_t*)&amp;val;<br />
  out4[0] = p[3];<br />
  out4[1] = p[2];<br />
  out4[2] = p[1];<br />
  out4[3] = p[0];<br />
}<br />
<br />
float dpt14ToFloat(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) {<br />
  uint8_t bytes[4] = { b3, b2, b1, b0 };<br />
  float f;<br />
  memcpy(&amp;f, bytes, 4);<br />
  return f;<br />
}<br />
<br />
String apciTypeStr(uint8_t apciByte) {<br />
  switch (apciByte &amp; 0xC0) {<br />
    case 0x00: return "Read";<br />
    case 0x40: return "Response";<br />
    case 0x80: return "Write";<br />
    default:   return "?";<br />
  }<br />
}<br />
<br />
String interpretKnxData(uint8_t* data, uint8_t len) {<br />
  String prefix = "[" + apciTypeStr(data[0]) + "] ";<br />
<br />
  if (len == 1) {<br />
    bool bitVal = data[0] &amp; 0x01;<br />
    return prefix + "DPT1: " + (bitVal ? "EIN (1)" : "AUS (0)");<br />
  }<br />
  else if (len == 2) {<br />
    return prefix + "DPT5: " + String(data[1]) + " (0..255)";<br />
  }<br />
  else if (len == 3) {<br />
    float f = dpt9ToFloat(data[1], data[2]);<br />
    return prefix + "DPT9: " + String(f, 2);<br />
  }<br />
  else if (len == 4) {<br />
    uint8_t h = data[1] &amp; 0x1F, mnt = data[2] &amp; 0x3F, s = data[3] &amp; 0x3F;<br />
    uint8_t day = data[1] &amp; 0x1F, month = data[2] &amp; 0x0F, year = data[3] &amp; 0x7F;<br />
    char buf[80];<br />
    snprintf(buf, sizeof(buf), "DPT10 Zeit : %02d:%02d:%02d  /  DPT11 Datum : %02d.%02d.20%02d",<br />
             h, mnt, s, day, month, year);<br />
    return prefix + String(buf);<br />
  }<br />
  else if (len == 5) {<br />
    float f = dpt14ToFloat(data[1], data[2], data[3], data[4]);<br />
    return prefix + "DPT14: " + String(f, 3);<br />
  }<br />
  else if (len == 15) {<br />
    char txt[15];<br />
    for (int i = 0; i &lt; 14; i++) {<br />
      uint8_t c = data[1 + i];<br />
      txt[i] = (c &gt;= 32 &amp;&amp; c &lt; 127) ? (char)c : (c == 0 ? 0 : '.');<br />
    }<br />
    txt[14] = 0;<br />
    return prefix + "DPT16: &#92;"" + String(txt) + "&#92;"";<br />
  }<br />
  return prefix + "Unbekannt (" + String(len) + " Byte)";<br />
}<br />
<br />
void addKnxLogEntry(uint16_t ga, uint8_t* rxBuf, uint8_t npduLen) {<br />
  KnxLogEntry &amp;e = knxLog[knxLogNext];<br />
  String t = getFormattedDateTime();<br />
  strncpy(e.timeStr, t.c_str(), sizeof(e.timeStr) - 1);<br />
  e.timeStr[sizeof(e.timeStr) - 1] = 0;<br />
  e.ga = ga;<br />
  uint8_t copyLen = npduLen;<br />
  if (copyLen &gt; sizeof(e.data)) copyLen = sizeof(e.data);<br />
  memcpy(e.data, &amp;rxBuf[20], copyLen);<br />
  e.len = copyLen;<br />
<br />
  knxLogNext = (knxLogNext + 1) % KNX_LOG_SIZE;<br />
  if (knxLogFilled &lt; KNX_LOG_SIZE) knxLogFilled++;<br />
}<br />
<br />
uint16_t processIncomingPacket(uint8_t* rxBuf, int len) {<br />
  if (len &lt; 6) return 0;<br />
  uint16_t serviceType = (rxBuf[2] &lt;&lt; 8) | rxBuf[3];<br />
  hexDump("[KNX RX]", rxBuf, len);<br />
<br />
  switch (serviceType) {<br />
    case 0x0421:<br />
      if (len &gt;= 10) {<br />
        Serial.printf("   -&gt; TUNNELING_ACK | Channel : %d | Seq : %d | Status : 0x%02X (%s)&#92;n",<br />
                      rxBuf[7], rxBuf[8], rxBuf[9], knxStatusToString(rxBuf[9]));<br />
      }<br />
      break;<br />
<br />
    case 0x0420:<br />
      if (len &gt;= 21) {<br />
        uint8_t rxChannel = rxBuf[7];<br />
        uint8_t rxSeqNum  = rxBuf[8];<br />
        uint16_t ga = ((uint16_t)rxBuf[16] &lt;&lt; 8) | rxBuf[17];<br />
        uint8_t npduLen = rxBuf[18];<br />
        Serial.printf("   -&gt; TUNNELING_REQUEST (Bus Telegramm) | Channel : %d | Seq : %d | GA : %s&#92;n",<br />
                      rxChannel, rxSeqNum, gaToString(ga).c_str());<br />
        Serial.println("      " + interpretKnxData(&amp;rxBuf[20], npduLen));<br />
<br />
        if (rxChannel == knxChannelId) {<br />
          addKnxLogEntry(ga, rxBuf, npduLen);<br />
<br />
          uint8_t ackBuf[10] = {<br />
            0x06, 0x10, 0x04, 0x21, 0x00, 0x0A, 0x04, knxChannelId, rxSeqNum, 0x00<br />
          };<br />
          udp.beginPacket(knxGatewayIp, knxPort);<br />
          udp.write(ackBuf, sizeof(ackBuf));<br />
          udp.endPacket();<br />
          hexDump("[KNX TX] ACK an Bus Telegramm", ackBuf, sizeof(ackBuf));<br />
        }<br />
      }<br />
      break;<br />
<br />
    case 0x0208:<br />
      if (len &gt;= 8) {<br />
        Serial.printf("   -&gt; CONNECTIONSTATE_RESPONSE | Status : 0x%02X (%s)&#92;n", rxBuf[7], knxStatusToString(rxBuf[7]));<br />
        if (rxBuf[7] != 0x00) {<br />
          Serial.println("   !!! Heartbeat fehlgeschlagen -&gt; Tunnel als getrennt markiert !!!");<br />
          isKnxConnected = false;<br />
        }<br />
      }<br />
      break;<br />
<br />
    case 0x0209:<br />
      if (len &gt;= 8) {<br />
        uint8_t rxChannel = rxBuf[6];<br />
        Serial.printf("   -&gt; DISCONNECT_REQUEST vom Gateway | Channel: %d&#92;n", rxChannel);<br />
        if (rxChannel == knxChannelId) {<br />
          uint8_t discResp[8] = { 0x06, 0x10, 0x02, 0x0A, 0x00, 0x08, knxChannelId, 0x00 };<br />
          udp.beginPacket(knxGatewayIp, knxPort);<br />
          udp.write(discResp, sizeof(discResp));<br />
          udp.endPacket();<br />
          hexDump("[KNX TX] DISCONNECT_RESPONSE", discResp, sizeof(discResp));<br />
          isKnxConnected = false;<br />
        }<br />
      }<br />
      break;<br />
<br />
    default:<br />
      Serial.printf("   -&gt; Unbehandelter ServiceType: 0x%04X&#92;n", serviceType);<br />
      break;<br />
  }<br />
  return serviceType;<br />
}<br />
<br />
bool connectKnx() {<br />
  Serial.println("[KNX] Sende CONNECT_REQUEST an Gateway...");<br />
<br />
  IPAddress myIp = WiFi.localIP();<br />
  Serial.printf("   Lokale IP/Port die wir dem Gateway melden : %s:%d&#92;n", myIp.toString().c_str(), localPort);<br />
  Serial.printf("   Ziel Gateway: %s:%d&#92;n", knxGatewayIp, knxPort);<br />
<br />
  uint8_t connReq[] = {<br />
    0x06, 0x10, 0x02, 0x05, 0x00, 0x1A,<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF),<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF),<br />
    0x04, 0x04, 0x02, 0x00<br />
  };<br />
  hexDump("[KNX TX] CONNECT_REQUEST", connReq, sizeof(connReq));<br />
<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(connReq, sizeof(connReq));<br />
  udp.endPacket();<br />
<br />
  unsigned long start = millis();<br />
  while (millis() - start &lt; 2000) {<br />
    int size = udp.parsePacket();<br />
    if (size &gt;= 8) {<br />
      uint8_t resp[32];<br />
      int rlen = udp.read(resp, sizeof(resp));<br />
      hexDump("[KNX RX] CONNECT_RESPONSE", resp, rlen);<br />
<br />
      if (resp[2] == 0x02 &amp;&amp; resp[3] == 0x06) {<br />
        if (resp[7] == 0x00) {<br />
          knxChannelId = resp[6];<br />
          txSeqNum = 0;<br />
          isKnxConnected = true;<br />
          lastHeartbeat = millis();<br />
          Serial.printf("ERFOLGREICH! Channel ID : %d&#92;n", knxChannelId);<br />
<br />
          if (rlen &gt;= 16 &amp;&amp; resp[8] == 0x08) {<br />
            IPAddress dataIp(resp[10], resp[11], resp[12], resp[13]);<br />
            uint16_t dataPort = (resp[14] &lt;&lt; 8) | resp[15];<br />
            Serial.printf("   [Info] Gateway Data-Endpoint laut CONNECT_RESPONSE: %s:%d&#92;n",<br />
                          dataIp.toString().c_str(), dataPort);<br />
          }<br />
          return true;<br />
        } else {<br />
          Serial.printf("FEHLER! Status Code: 0x%02X (%s)&#92;n", resp[7], knxStatusToString(resp[7]));<br />
          return false;<br />
        }<br />
      }<br />
    }<br />
    delay(10);<br />
  }<br />
  Serial.println("TIMEOUT! Keine CONNECT_RESPONSE vom Gateway erhalten.");<br />
  isKnxConnected = false;<br />
  return false;<br />
}<br />
<br />
void sendConnectionStateRequest() {<br />
  IPAddress myIp = WiFi.localIP();<br />
  uint8_t req[16] = {<br />
    0x06, 0x10, 0x02, 0x07, 0x00, 0x10,<br />
    knxChannelId, 0x00,<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF)<br />
  };<br />
  hexDump("[KNX TX] CONNECTIONSTATE_REQUEST (Heartbeat)", req, sizeof(req));<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(req, sizeof(req));<br />
  udp.endPacket();<br />
}<br />
<br />
void disconnectKnx() {<br />
  if (!isKnxConnected) return;<br />
  IPAddress myIp = WiFi.localIP();<br />
  uint8_t req[16] = {<br />
    0x06, 0x10, 0x02, 0x09, 0x00, 0x10,<br />
    knxChannelId, 0x00,<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF)<br />
  };<br />
  hexDump("[KNX TX] DISCONNECT_REQUEST", req, sizeof(req));<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(req, sizeof(req));<br />
  udp.endPacket();<br />
  isKnxConnected = false;<br />
}<br />
<br />
void handleKnxRx() {<br />
  int packetSize = udp.parsePacket();<br />
  if (packetSize &lt;= 0) return;<br />
  uint8_t rxBuf[64];<br />
  int len = udp.read(rxBuf, sizeof(rxBuf));<br />
  processIncomingPacket(rxBuf, len);<br />
}<br />
<br />
bool sendKnxValue(String groupAddress, String dptType, String rawValue) {<br />
  if (!isKnxConnected) {<br />
    if (!connectKnx()) return false;<br />
  }<br />
<br />
  uint16_t ga = parseGroupAddress(groupAddress);<br />
  uint8_t buf[64];<br />
  uint8_t payloadLen = 0;<br />
<br />
  buf[0] = 0x06; buf[1] = 0x10;<br />
  buf[2] = 0x04; buf[3] = 0x20;<br />
  buf[4] = 0x00; buf[5] = 0x00;<br />
<br />
  buf[6] = 0x04;<br />
  buf[7] = knxChannelId;<br />
  buf[8] = txSeqNum;<br />
  buf[9] = 0x00;<br />
<br />
  buf[10] = 0x11;<br />
  buf[11] = 0x00;<br />
  buf[12] = 0xBC;<br />
  buf[13] = 0xE0;<br />
  buf[14] = 0x00; buf[15] = 0x00;<br />
  buf[16] = (uint8_t)(ga &gt;&gt; 8);<br />
  buf[17] = (uint8_t)(ga &amp; 0xFF);<br />
<br />
  if (dptType == "DPT1") {<br />
    buf[18] = 0x01;<br />
    buf[19] = 0x00;<br />
    buf[20] = (rawValue.toInt() &gt; 0) ? 0x81 : 0x80;<br />
    payloadLen = 21;<br />
  }<br />
  else if (dptType == "DPT5") {<br />
    buf[18] = 0x02;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)rawValue.toInt();<br />
    payloadLen = 22;<br />
  }<br />
  else if (dptType == "DPT9") {<br />
    uint16_t dpt9Val = floatToDpt9(rawValue.toFloat());<br />
    buf[18] = 0x03;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)(dpt9Val &gt;&gt; 8);<br />
    buf[22] = (uint8_t)(dpt9Val &amp; 0xFF);<br />
    payloadLen = 23;<br />
  }<br />
  else if (dptType == "DPT10") {<br />
    int h = 0, m = 0, s = 0;<br />
    int c1 = rawValue.indexOf(':');<br />
    if (c1 == -1) {<br />
      h = rawValue.toInt();<br />
    } else {<br />
      h = rawValue.substring(0, c1).toInt();<br />
      int c2 = rawValue.indexOf(':', c1 + 1);<br />
      if (c2 == -1) {<br />
        m = rawValue.substring(c1 + 1).toInt();<br />
      } else {<br />
        m = rawValue.substring(c1 + 1, c2).toInt();<br />
        s = rawValue.substring(c2 + 1).toInt();<br />
      }<br />
    }<br />
    buf[18] = 0x04;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)(h &amp; 0x1F);<br />
    buf[22] = (uint8_t)(m &amp; 0x3F);<br />
    buf[23] = (uint8_t)(s &amp; 0x3F);<br />
    payloadLen = 24;<br />
  }<br />
  else if (dptType == "DPT11") {<br />
    int day = 1, month = 1, year = 26;<br />
    int p1 = rawValue.indexOf('.');<br />
    if (p1 != -1) {<br />
      day = rawValue.substring(0, p1).toInt();<br />
      int p2 = rawValue.indexOf('.', p1 + 1);<br />
      if (p2 != -1) {<br />
        month = rawValue.substring(p1 + 1, p2).toInt();<br />
        int y = rawValue.substring(p2 + 1).toInt();<br />
        year = (y &gt;= 2000) ? (y - 2000) : y;<br />
      }<br />
    } else {<br />
      day = rawValue.toInt();<br />
    }<br />
    buf[18] = 0x04;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)(day &amp; 0x1F);<br />
    buf[22] = (uint8_t)(month &amp; 0x0F);<br />
    buf[23] = (uint8_t)(year &amp; 0x7F);<br />
    payloadLen = 24;<br />
  }<br />
  else if (dptType == "DPT14") {<br />
    uint8_t db[4];<br />
    floatToDpt14Bytes(rawValue.toFloat(), db);<br />
    buf[18] = 0x05;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = db[0];<br />
    buf[22] = db[1];<br />
    buf[23] = db[2];<br />
    buf[24] = db[3];<br />
    payloadLen = 25;<br />
  }<br />
  else if (dptType == "DPT16") {<br />
    uint8_t strLen = rawValue.length();<br />
    if (strLen &gt; 14) strLen = 14;<br />
<br />
    buf[18] = 15;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    for (int i = 0; i &lt; 14; i++) {<br />
      buf[21 + i] = (i &lt; strLen) ? rawValue[i] : 0x00;<br />
    }<br />
    payloadLen = 21 + 14;<br />
  }<br />
  else {<br />
    Serial.println("[KNX TX] FEHLER - Unbekannter DPT Typ!");<br />
    return false;<br />
  }<br />
<br />
  buf[5] = payloadLen;<br />
<br />
  Serial.printf("[KNX TX] GA: %s (0x%04X) | DPT: %s | Val: %s | Seq: %d&#92;n",<br />
                groupAddress.c_str(), ga, dptType.c_str(), rawValue.c_str(), txSeqNum);<br />
  hexDump("[KNX TX] TUNNELING_REQUEST", buf, payloadLen);<br />
<br />
  uint8_t sentSeq = txSeqNum;<br />
<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(buf, payloadLen);<br />
  udp.endPacket();<br />
<br />
  txSeqNum++;<br />
<br />
  unsigned long waitStart = millis();<br />
  bool ackOk = false;<br />
  while (millis() - waitStart &lt; ACK_TIMEOUT) {<br />
    int packetSize = udp.parsePacket();<br />
    if (packetSize &gt; 0) {<br />
      uint8_t rxBuf[64];<br />
      int len = udp.read(rxBuf, sizeof(rxBuf));<br />
      uint16_t st = processIncomingPacket(rxBuf, len);<br />
      if (st == 0x0421 &amp;&amp; len &gt;= 9 &amp;&amp; rxBuf[8] == sentSeq) {<br />
        ackOk = (len &gt;= 10 &amp;&amp; rxBuf[9] == 0x00);<br />
        break;<br />
      }<br />
    }<br />
    delay(5);<br />
  }<br />
<br />
  if (!ackOk) {<br />
    Serial.println("!!! KEIN passendes TUNNELING_ACK erhalten (Timeout nach 1000ms) !!!");<br />
  }<br />
<br />
  return ackOk;<br />
}<br />
<br />
String escapeJson(String s) {<br />
  String out;<br />
  for (size_t i = 0; i &lt; s.length(); i++) {<br />
    char c = s[i];<br />
    if (c == '"' || c == '&#92;&#92;') out += '&#92;&#92;';<br />
    out += c;<br />
  }<br />
  return out;<br />
}<br />
<br />
void handleRoot() {<br />
  String html = "&lt;html&gt;&lt;head&gt;&lt;meta charset='UTF-8'&gt;";<br />
  html += "&lt;title&gt;" + String(projectName) + "&lt;/title&gt;";<br />
  html += "&lt;style&gt;body{font-family:Arial,sans-serif;margin:20px;background:#f4f4f9;color:#333}";<br />
  html += ".card{background:#fff;padding:20px;border-radius:8px;box-shadow:0 2px 5px rgba(0,0,0,0.1);max-width:650px;margin:auto}";<br />
  html += "h1{text-align:center;margin-bottom:2px;}";<br />
  html += "#dtNow{text-align:center;color:#666;margin-top:0;margin-bottom:16px;font-size:14px;}";<br />
  html += "input,select,button{width:100%;padding:10px;margin:10px 0;box-sizing:border-box;border:1px solid #ccc;border-radius:4px;font-size:16px}";<br />
  html += "button{background:#007bff;color:#fff;font-weight:bold;border:none;cursor:pointer}button:hover{background:#0056b3}";<br />
  html += "#statusMsg{margin-top:10px;font-weight:bold;color:#28a745;text-align:center;}";<br />
  html += "table{width:100%;border-collapse:collapse;font-size:13px;margin-top:10px;}";<br />
  html += "th,td{border-bottom:1px solid #eee;padding:6px 4px;text-align:left;}";<br />
  html += "th{background:#f0f0f5;}";<br />
  html += "&lt;/style&gt;&lt;/head&gt;&lt;body&gt;";<br />
<br />
  html += "&lt;div class='card'&gt;";<br />
  html += "&lt;h1&gt;" + String(projectName) + "&lt;/h1&gt;";<br />
  html += "&lt;p id='dtNow'&gt;...&lt;/p&gt;";<br />
  html += "&lt;p&gt;KNX Status: &lt;span id='knxStatus'&gt;" + String(isKnxConnected ? "&lt;b style='color:green;'&gt;Verbunden (Channel " + String(knxChannelId) + ")" : "Getrennt") + "";<br />
<br />
  html += "&lt;label&gt;Gruppenadresse (z.B. 1/0/0):&lt;/label&gt;";<br />
  html += "&lt;input type='text' id='ga' value='1/0/0'&gt;";<br />
<br />
  html += "&lt;label&gt;Datenpunkttyp (DPT):&lt;/label&gt;";<br />
  html += "&lt;select id='dpt'&gt;";<br />
  html += "&lt;option value='DPT1'&gt;DPT 1 (1 Bit Schalten 0/1)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT5'&gt;DPT 5 (1 Byte Wert 0..255)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT9'&gt;DPT 9 (2 Byte Float Temp/Wert)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT10'&gt;DPT 10 (Zeit, z.B. 14:30:00)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT11'&gt;DPT 11 (Datum, z.B. 24.12.26)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT14'&gt;DPT 14 (4 Byte Float IEEE754)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT16'&gt;DPT 16 (14 Byte Text)&lt;/option&gt;";<br />
  html += "&lt;/select&gt;";<br />
<br />
  html += "&lt;label&gt;Wert / Payload:&lt;/label&gt;";<br />
  html += "&lt;input type='text' id='val' value='1' placeholder='z.B. 1, 128, 21.5, 14:30:00, 24.12.26 oder Text'&gt;";<br />
<br />
  html += "&lt;button type='button' onclick='sendTelegram()'&gt;KNX Telegramm Senden&lt;/button&gt;";<br />
  html += "&lt;button type='button' onclick='reconnectKnx()' style='background:#6c757d;'&gt;KNX Reconnect&lt;/button&gt;";<br />
  html += "&lt;div id='statusMsg'&gt;&lt;/div&gt;";<br />
<br />
  html += "&lt;h3&gt;Letzte empfangene Telegramme&lt;/h3&gt;";<br />
  html += "&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Zeit&lt;/th&gt;&lt;th&gt;GA&lt;/th&gt;&lt;th&gt;Bytes&lt;/th&gt;&lt;th&gt;Hex&lt;/th&gt;&lt;th&gt;Wert&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;";<br />
  html += "&lt;tbody id='logBody'&gt;Lade...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;";<br />
<br />
  html += "&lt;/div&gt;";<br />
<br />
  html += "&lt;script&gt;";<br />
  html += "function sendTelegram(){";<br />
  html += "  var ga = document.getElementById('ga').value;";<br />
  html += "  var dpt = document.getElementById('dpt').value;";<br />
  html += "  var val = document.getElementById('val').value;";<br />
  html += "  document.getElementById('statusMsg').innerText = 'Sende...';";<br />
  html += "  fetch('/send?ga=' + encodeURIComponent(ga) + '&amp;dpt=' + encodeURIComponent(dpt) + '&amp;val=' + encodeURIComponent(val))";<br />
  html += "  .then(response =&gt; response.text())";<br />
  html += "  .then(data =&gt; { document.getElementById('statusMsg').innerText = data; })";<br />
  html += "  .catch(err =&gt; { document.getElementById('statusMsg').innerText = 'Fehler beim Senden!'; });";<br />
  html += "}";<br />
  html += "function reconnectKnx(){";<br />
  html += "  fetch('/reconnect').then(r=&gt;r.text()).then(d=&gt;{ updateStatus(); });";<br />
  html += "}";<br />
  html += "function updateStatus(){";<br />
  html += "  fetch('/status').then(r=&gt;r.json()).then(d=&gt;{";<br />
  html += "    document.getElementById('dtNow').innerText = d.datetime;";<br />
  html += "    document.getElementById('knxStatus').innerHTML = d.connected ? (&#92;"&lt;b style='color:green;'&gt;Verbunden (Channel &#92;" + d.channel + &#92;")&lt;/b&gt;&#92;") : &#92;"&lt;b style='color:red;'&gt;Getrennt&lt;/b&gt;&#92;";";<br />
  html += "    var rows = '';";<br />
  html += "    d.log.forEach(function(e){ rows += '&lt;tr&gt;&lt;td&gt;'+e.time+'&lt;/td&gt;&lt;td&gt;'+e.ga+'&lt;/td&gt;&lt;td&gt;'+e.len+'&lt;/td&gt;&lt;td&gt;'+e.hex+'&lt;/td&gt;&lt;td&gt;'+e.value+'&lt;/td&gt;&lt;/tr&gt;'; });";<br />
  html += "    document.getElementById('logBody').innerHTML = rows || '&lt;tr&gt;&lt;td colspan=5&gt;Noch keine Telegramme empfangen&lt;/td&gt;&lt;/tr&gt;';";<br />
  html += "  }).catch(function(){});";<br />
  html += "}";<br />
  html += "setInterval(updateStatus, 1000);";<br />
  html += "updateStatus();";<br />
  html += "&lt;/script&gt;";<br />
<br />
  html += "&lt;/body&gt;&lt;/html&gt;";<br />
  server.send(200, "text/html", html);<br />
}<br />
<br />
void handleSend() {<br />
  if (server.hasArg("ga") &amp;&amp; server.hasArg("dpt") &amp;&amp; server.hasArg("val")) {<br />
    String ga = server.arg("ga");<br />
    String dpt = server.arg("dpt");<br />
    String val = server.arg("val");<br />
<br />
    bool ok = sendKnxValue(ga, dpt, val);<br />
    server.send(200, "text/plain", ok ? "Telegramm gesendet und per ACK bestaetigt!" : "Gesendet, aber KEIN ACK erhalten, siehe Serial Monitor!");<br />
  } else {<br />
    server.send(400, "text/plain", "Fehlende Parameter!");<br />
  }<br />
}<br />
<br />
void handleReconnect() {<br />
  connectKnx();<br />
  server.send(200, "text/plain", "Reconnected!");<br />
}<br />
<br />
void handleStatus() {<br />
  String json = "{";<br />
  json += "&#92;"project&#92;":&#92;"" + escapeJson(String(projectName)) + "&#92;",";<br />
  json += "&#92;"datetime&#92;":&#92;"" + escapeJson(getFormattedDateTime()) + "&#92;",";<br />
  json += "&#92;"connected&#92;":" + String(isKnxConnected ? "true" : "false") + ",";<br />
  json += "&#92;"channel&#92;":" + String(knxChannelId) + ",";<br />
  json += "&#92;"log&#92;":[";<br />
<br />
  for (int i = 0; i &lt; knxLogFilled; i++) {<br />
    int idx = (knxLogNext - 1 - i + KNX_LOG_SIZE) % KNX_LOG_SIZE;<br />
    KnxLogEntry &amp;e = knxLog[idx];<br />
<br />
    String hex = "";<br />
    for (int b = 0; b &lt; e.len; b++) {<br />
      char hb[4];<br />
      snprintf(hb, sizeof(hb), "%02X ", e.data[b]);<br />
      hex += hb;<br />
    }<br />
    hex.trim();<br />
<br />
    if (i &gt; 0) json += ",";<br />
    json += "{";<br />
    json += "&#92;"time&#92;":&#92;"" + escapeJson(String(e.timeStr)) + "&#92;",";<br />
    json += "&#92;"ga&#92;":&#92;"" + escapeJson(gaToString(e.ga)) + "&#92;",";<br />
    json += "&#92;"len&#92;":" + String(e.len) + ",";<br />
    json += "&#92;"hex&#92;":&#92;"" + escapeJson(hex) + "&#92;",";<br />
    json += "&#92;"value&#92;":&#92;"" + escapeJson(interpretKnxData(e.data, e.len)) + "&#92;"";<br />
    json += "}";<br />
  }<br />
  json += "]}";<br />
  server.send(200, "application/json", json);<br />
}<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
  delay(1000);<br />
<br />
  Serial.printf("&#92;n===&gt; %s &lt;===&#92;n", projectName);<br />
<br />
  WiFi.begin(ssid, password);<br />
  while (WiFi.status() != WL_CONNECTED) {<br />
    delay(500);<br />
    Serial.print(".");<br />
  }<br />
<br />
  Serial.println("&#92;nWLAN Verbunden!");<br />
  Serial.print("IP Adresse - "); Serial.println(WiFi.localIP());<br />
  Serial.print("RSSI: "); Serial.println(WiFi.RSSI());<br />
<br />
  configTzTime(tzInfo, ntpServer);<br />
  Serial.println("Warte auf Zeitsynchronisation (NTP)...");<br />
  struct tm timeinfo;<br />
  if (getLocalTime(&amp;timeinfo, 5000)) {<br />
    Serial.println("Zeit synchronisiert - " + getFormattedDateTime());<br />
  } else {<br />
    Serial.println("Zeit konnte nicht synchronisiert werden (wird spaeter automatisch nachgeholt).");<br />
  }<br />
<br />
  udp.begin(localPort);<br />
<br />
  connectKnx();<br />
<br />
  server.on("/", handleRoot);<br />
  server.on("/send", handleSend);<br />
  server.on("/reconnect", handleReconnect);<br />
  server.on("/status", handleStatus);<br />
  server.begin();<br />
}<br />
<br />
void loop() {<br />
  server.handleClient();<br />
  handleKnxRx();<br />
<br />
  if (isKnxConnected &amp;&amp; (millis() - lastHeartbeat &gt; HEARTBEAT_INTERVAL)) {<br />
    sendConnectionStateRequest();<br />
    lastHeartbeat = millis();<br />
  }<br />
}</code></div></div>]]></description>
			<content:encoded><![CDATA[Bonjour à tous,<br />
<br />
Je souhaite mettre à votre disposition ce code qui permet de communiquer avec KNX sur un ESP32 sans aucune bibliothèque supplémentaire. Il peut aussi bien envoyer que recevoir les télégrammes les plus courants.<br />
<br />
<div class="codeblock"><div class="title">Code :</div><div class="body" dir="ltr"><code>#include &lt;WiFi.h&gt;<br />
#include &lt;WiFiUdp.h&gt;<br />
#include &lt;WebServer.h&gt;<br />
#include &lt;time.h&gt;<br />
<br />
<br />
const char* projectName  = "KNX Stack";<br />
<br />
const char* ssid         = "WLAN SSID";<br />
const char* password     = "WLAN Passwort";<br />
<br />
const char* ntpServer    = "pool.ntp.org";<br />
const char* tzInfo       = "CET-1CEST,M3.5.0,M10.5.0/3";<br />
<br />
const char* knxGatewayIp = "IP KNX Gateway";<br />
const uint16_t knxPort   = 3671;<br />
const uint16_t localPort = 3671;<br />
<br />
WiFiUDP udp;<br />
WebServer server(80);<br />
<br />
uint8_t knxChannelId     = 0;<br />
uint8_t txSeqNum         = 0;<br />
bool isKnxConnected      = false;<br />
<br />
unsigned long lastHeartbeat = 0;<br />
const unsigned long HEARTBEAT_INTERVAL = 60000;<br />
const unsigned long ACK_TIMEOUT        = 1000;<br />
<br />
#define KNX_LOG_SIZE 10<br />
struct KnxLogEntry {<br />
  char timeStr[24];<br />
  uint16_t ga;<br />
  uint8_t data[16];<br />
  uint8_t len;<br />
};<br />
<br />
KnxLogEntry knxLog[KNX_LOG_SIZE];<br />
int knxLogNext = 0;<br />
int knxLogFilled = 0;<br />
<br />
void hexDump(const char* label, const uint8_t* buf, int len) {<br />
  Serial.printf("%s [%d Bytes]: ", label, len);<br />
  for (int i = 0; i &lt; len; i++) {<br />
    Serial.printf("%02X ", buf[i]);<br />
  }<br />
  Serial.println();<br />
}<br />
<br />
const char* knxStatusToString(uint8_t status) {<br />
  switch (status) {<br />
    case 0x00: return "E_NO_ERROR";<br />
    case 0x01: return "E_HOST_PROTOCOL_TYPE";<br />
    case 0x02: return "E_VERSION_NOT_SUPPORTED";<br />
    case 0x04: return "E_SEQUENCE_NUMBER (Sequenznummer falsch/ausser Sync)";<br />
    case 0x21: return "E_CONNECTION_ID (unbekannte Channel ID)";<br />
    case 0x22: return "E_CONNECTION_TYPE";<br />
    case 0x23: return "E_CONNECTION_OPTION";<br />
    case 0x24: return "E_NO_MORE_CONNECTIONS (Gateway voll)";<br />
    case 0x26: return "E_DATA_CONNECTION";<br />
    case 0x27: return "E_KNX_CONNECTION";<br />
    case 0x29: return "E_TUNNELING_LAYER (nicht unterstuetzt)";<br />
    default:   return "Unbekannter Statuscode";<br />
  }<br />
}<br />
<br />
String getFormattedDateTime() {<br />
  struct tm timeinfo;<br />
  if (!getLocalTime(&amp;timeinfo, 100)) {<br />
    return "Zeit nicht synchronisiert";<br />
  }<br />
  char buf[32];<br />
  strftime(buf, sizeof(buf), "%d.%m.%Y %H:%M:%S", &amp;timeinfo);<br />
  return String(buf);<br />
}<br />
<br />
uint16_t parseGroupAddress(const String&amp; gaStr) {<br />
  int firstSlash  = gaStr.indexOf('/');<br />
  int secondSlash = gaStr.indexOf('/', firstSlash + 1);<br />
  if (firstSlash == -1 || secondSlash == -1) return 0;<br />
<br />
  uint8_t main   = gaStr.substring(0, firstSlash).toInt();<br />
  uint8_t middle = gaStr.substring(firstSlash + 1, secondSlash).toInt();<br />
  uint8_t sub    = gaStr.substring(secondSlash + 1).toInt();<br />
<br />
  return ((main &amp; 0x1F) &lt;&lt; 11) | ((middle &amp; 0x07) &lt;&lt; 8) | (sub &amp; 0xFF);<br />
}<br />
<br />
String gaToString(uint16_t ga) {<br />
  uint8_t main   = (ga &gt;&gt; 11) &amp; 0x1F;<br />
  uint8_t middle = (ga &gt;&gt; 8) &amp; 0x07;<br />
  uint8_t sub    = ga &amp; 0xFF;<br />
  return String(main) + "/" + String(middle) + "/" + String(sub);<br />
}<br />
<br />
uint16_t floatToDpt9(float val) {<br />
  int sign = (val &lt; 0) ? 1 : 0;<br />
  float v = (sign == 1) ? -val : val;<br />
  int exp = 0;<br />
  int mantissa = (int)(v * 100.0f);<br />
  while (mantissa &gt; 2047) {<br />
    mantissa &gt;&gt;= 1;<br />
    exp++;<br />
  }<br />
  if (sign == 1) {<br />
    mantissa = -mantissa;<br />
    mantissa &amp;= 0x07FF;<br />
  }<br />
  return (sign &lt;&lt; 15) | ((exp &amp; 0x0F) &lt;&lt; 11) | (mantissa &amp; 0x07FF);<br />
}<br />
<br />
float dpt9ToFloat(uint8_t hi, uint8_t lo) {<br />
  uint16_t raw = ((uint16_t)hi &lt;&lt; 8) | lo;<br />
  int sign = (raw &gt;&gt; 15) &amp; 0x01;<br />
  int exp  = (raw &gt;&gt; 11) &amp; 0x0F;<br />
  int mantissa11 = raw &amp; 0x07FF;<br />
  int M = mantissa11 - (sign ? 2048 : 0);<br />
  return 0.01f * M * (float)(1 &lt;&lt; exp);<br />
}<br />
<br />
void floatToDpt14Bytes(float val, uint8_t* out4) {<br />
  uint8_t* p = (uint8_t*)&amp;val;<br />
  out4[0] = p[3];<br />
  out4[1] = p[2];<br />
  out4[2] = p[1];<br />
  out4[3] = p[0];<br />
}<br />
<br />
float dpt14ToFloat(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) {<br />
  uint8_t bytes[4] = { b3, b2, b1, b0 };<br />
  float f;<br />
  memcpy(&amp;f, bytes, 4);<br />
  return f;<br />
}<br />
<br />
String apciTypeStr(uint8_t apciByte) {<br />
  switch (apciByte &amp; 0xC0) {<br />
    case 0x00: return "Read";<br />
    case 0x40: return "Response";<br />
    case 0x80: return "Write";<br />
    default:   return "?";<br />
  }<br />
}<br />
<br />
String interpretKnxData(uint8_t* data, uint8_t len) {<br />
  String prefix = "[" + apciTypeStr(data[0]) + "] ";<br />
<br />
  if (len == 1) {<br />
    bool bitVal = data[0] &amp; 0x01;<br />
    return prefix + "DPT1: " + (bitVal ? "EIN (1)" : "AUS (0)");<br />
  }<br />
  else if (len == 2) {<br />
    return prefix + "DPT5: " + String(data[1]) + " (0..255)";<br />
  }<br />
  else if (len == 3) {<br />
    float f = dpt9ToFloat(data[1], data[2]);<br />
    return prefix + "DPT9: " + String(f, 2);<br />
  }<br />
  else if (len == 4) {<br />
    uint8_t h = data[1] &amp; 0x1F, mnt = data[2] &amp; 0x3F, s = data[3] &amp; 0x3F;<br />
    uint8_t day = data[1] &amp; 0x1F, month = data[2] &amp; 0x0F, year = data[3] &amp; 0x7F;<br />
    char buf[80];<br />
    snprintf(buf, sizeof(buf), "DPT10 Zeit : %02d:%02d:%02d  /  DPT11 Datum : %02d.%02d.20%02d",<br />
             h, mnt, s, day, month, year);<br />
    return prefix + String(buf);<br />
  }<br />
  else if (len == 5) {<br />
    float f = dpt14ToFloat(data[1], data[2], data[3], data[4]);<br />
    return prefix + "DPT14: " + String(f, 3);<br />
  }<br />
  else if (len == 15) {<br />
    char txt[15];<br />
    for (int i = 0; i &lt; 14; i++) {<br />
      uint8_t c = data[1 + i];<br />
      txt[i] = (c &gt;= 32 &amp;&amp; c &lt; 127) ? (char)c : (c == 0 ? 0 : '.');<br />
    }<br />
    txt[14] = 0;<br />
    return prefix + "DPT16: &#92;"" + String(txt) + "&#92;"";<br />
  }<br />
  return prefix + "Unbekannt (" + String(len) + " Byte)";<br />
}<br />
<br />
void addKnxLogEntry(uint16_t ga, uint8_t* rxBuf, uint8_t npduLen) {<br />
  KnxLogEntry &amp;e = knxLog[knxLogNext];<br />
  String t = getFormattedDateTime();<br />
  strncpy(e.timeStr, t.c_str(), sizeof(e.timeStr) - 1);<br />
  e.timeStr[sizeof(e.timeStr) - 1] = 0;<br />
  e.ga = ga;<br />
  uint8_t copyLen = npduLen;<br />
  if (copyLen &gt; sizeof(e.data)) copyLen = sizeof(e.data);<br />
  memcpy(e.data, &amp;rxBuf[20], copyLen);<br />
  e.len = copyLen;<br />
<br />
  knxLogNext = (knxLogNext + 1) % KNX_LOG_SIZE;<br />
  if (knxLogFilled &lt; KNX_LOG_SIZE) knxLogFilled++;<br />
}<br />
<br />
uint16_t processIncomingPacket(uint8_t* rxBuf, int len) {<br />
  if (len &lt; 6) return 0;<br />
  uint16_t serviceType = (rxBuf[2] &lt;&lt; 8) | rxBuf[3];<br />
  hexDump("[KNX RX]", rxBuf, len);<br />
<br />
  switch (serviceType) {<br />
    case 0x0421:<br />
      if (len &gt;= 10) {<br />
        Serial.printf("   -&gt; TUNNELING_ACK | Channel : %d | Seq : %d | Status : 0x%02X (%s)&#92;n",<br />
                      rxBuf[7], rxBuf[8], rxBuf[9], knxStatusToString(rxBuf[9]));<br />
      }<br />
      break;<br />
<br />
    case 0x0420:<br />
      if (len &gt;= 21) {<br />
        uint8_t rxChannel = rxBuf[7];<br />
        uint8_t rxSeqNum  = rxBuf[8];<br />
        uint16_t ga = ((uint16_t)rxBuf[16] &lt;&lt; 8) | rxBuf[17];<br />
        uint8_t npduLen = rxBuf[18];<br />
        Serial.printf("   -&gt; TUNNELING_REQUEST (Bus Telegramm) | Channel : %d | Seq : %d | GA : %s&#92;n",<br />
                      rxChannel, rxSeqNum, gaToString(ga).c_str());<br />
        Serial.println("      " + interpretKnxData(&amp;rxBuf[20], npduLen));<br />
<br />
        if (rxChannel == knxChannelId) {<br />
          addKnxLogEntry(ga, rxBuf, npduLen);<br />
<br />
          uint8_t ackBuf[10] = {<br />
            0x06, 0x10, 0x04, 0x21, 0x00, 0x0A, 0x04, knxChannelId, rxSeqNum, 0x00<br />
          };<br />
          udp.beginPacket(knxGatewayIp, knxPort);<br />
          udp.write(ackBuf, sizeof(ackBuf));<br />
          udp.endPacket();<br />
          hexDump("[KNX TX] ACK an Bus Telegramm", ackBuf, sizeof(ackBuf));<br />
        }<br />
      }<br />
      break;<br />
<br />
    case 0x0208:<br />
      if (len &gt;= 8) {<br />
        Serial.printf("   -&gt; CONNECTIONSTATE_RESPONSE | Status : 0x%02X (%s)&#92;n", rxBuf[7], knxStatusToString(rxBuf[7]));<br />
        if (rxBuf[7] != 0x00) {<br />
          Serial.println("   !!! Heartbeat fehlgeschlagen -&gt; Tunnel als getrennt markiert !!!");<br />
          isKnxConnected = false;<br />
        }<br />
      }<br />
      break;<br />
<br />
    case 0x0209:<br />
      if (len &gt;= 8) {<br />
        uint8_t rxChannel = rxBuf[6];<br />
        Serial.printf("   -&gt; DISCONNECT_REQUEST vom Gateway | Channel: %d&#92;n", rxChannel);<br />
        if (rxChannel == knxChannelId) {<br />
          uint8_t discResp[8] = { 0x06, 0x10, 0x02, 0x0A, 0x00, 0x08, knxChannelId, 0x00 };<br />
          udp.beginPacket(knxGatewayIp, knxPort);<br />
          udp.write(discResp, sizeof(discResp));<br />
          udp.endPacket();<br />
          hexDump("[KNX TX] DISCONNECT_RESPONSE", discResp, sizeof(discResp));<br />
          isKnxConnected = false;<br />
        }<br />
      }<br />
      break;<br />
<br />
    default:<br />
      Serial.printf("   -&gt; Unbehandelter ServiceType: 0x%04X&#92;n", serviceType);<br />
      break;<br />
  }<br />
  return serviceType;<br />
}<br />
<br />
bool connectKnx() {<br />
  Serial.println("[KNX] Sende CONNECT_REQUEST an Gateway...");<br />
<br />
  IPAddress myIp = WiFi.localIP();<br />
  Serial.printf("   Lokale IP/Port die wir dem Gateway melden : %s:%d&#92;n", myIp.toString().c_str(), localPort);<br />
  Serial.printf("   Ziel Gateway: %s:%d&#92;n", knxGatewayIp, knxPort);<br />
<br />
  uint8_t connReq[] = {<br />
    0x06, 0x10, 0x02, 0x05, 0x00, 0x1A,<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF),<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF),<br />
    0x04, 0x04, 0x02, 0x00<br />
  };<br />
  hexDump("[KNX TX] CONNECT_REQUEST", connReq, sizeof(connReq));<br />
<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(connReq, sizeof(connReq));<br />
  udp.endPacket();<br />
<br />
  unsigned long start = millis();<br />
  while (millis() - start &lt; 2000) {<br />
    int size = udp.parsePacket();<br />
    if (size &gt;= 8) {<br />
      uint8_t resp[32];<br />
      int rlen = udp.read(resp, sizeof(resp));<br />
      hexDump("[KNX RX] CONNECT_RESPONSE", resp, rlen);<br />
<br />
      if (resp[2] == 0x02 &amp;&amp; resp[3] == 0x06) {<br />
        if (resp[7] == 0x00) {<br />
          knxChannelId = resp[6];<br />
          txSeqNum = 0;<br />
          isKnxConnected = true;<br />
          lastHeartbeat = millis();<br />
          Serial.printf("ERFOLGREICH! Channel ID : %d&#92;n", knxChannelId);<br />
<br />
          if (rlen &gt;= 16 &amp;&amp; resp[8] == 0x08) {<br />
            IPAddress dataIp(resp[10], resp[11], resp[12], resp[13]);<br />
            uint16_t dataPort = (resp[14] &lt;&lt; 8) | resp[15];<br />
            Serial.printf("   [Info] Gateway Data-Endpoint laut CONNECT_RESPONSE: %s:%d&#92;n",<br />
                          dataIp.toString().c_str(), dataPort);<br />
          }<br />
          return true;<br />
        } else {<br />
          Serial.printf("FEHLER! Status Code: 0x%02X (%s)&#92;n", resp[7], knxStatusToString(resp[7]));<br />
          return false;<br />
        }<br />
      }<br />
    }<br />
    delay(10);<br />
  }<br />
  Serial.println("TIMEOUT! Keine CONNECT_RESPONSE vom Gateway erhalten.");<br />
  isKnxConnected = false;<br />
  return false;<br />
}<br />
<br />
void sendConnectionStateRequest() {<br />
  IPAddress myIp = WiFi.localIP();<br />
  uint8_t req[16] = {<br />
    0x06, 0x10, 0x02, 0x07, 0x00, 0x10,<br />
    knxChannelId, 0x00,<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF)<br />
  };<br />
  hexDump("[KNX TX] CONNECTIONSTATE_REQUEST (Heartbeat)", req, sizeof(req));<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(req, sizeof(req));<br />
  udp.endPacket();<br />
}<br />
<br />
void disconnectKnx() {<br />
  if (!isKnxConnected) return;<br />
  IPAddress myIp = WiFi.localIP();<br />
  uint8_t req[16] = {<br />
    0x06, 0x10, 0x02, 0x09, 0x00, 0x10,<br />
    knxChannelId, 0x00,<br />
    0x08, 0x01, myIp[0], myIp[1], myIp[2], myIp[3], (uint8_t)(localPort &gt;&gt; 8), (uint8_t)(localPort &amp; 0xFF)<br />
  };<br />
  hexDump("[KNX TX] DISCONNECT_REQUEST", req, sizeof(req));<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(req, sizeof(req));<br />
  udp.endPacket();<br />
  isKnxConnected = false;<br />
}<br />
<br />
void handleKnxRx() {<br />
  int packetSize = udp.parsePacket();<br />
  if (packetSize &lt;= 0) return;<br />
  uint8_t rxBuf[64];<br />
  int len = udp.read(rxBuf, sizeof(rxBuf));<br />
  processIncomingPacket(rxBuf, len);<br />
}<br />
<br />
bool sendKnxValue(String groupAddress, String dptType, String rawValue) {<br />
  if (!isKnxConnected) {<br />
    if (!connectKnx()) return false;<br />
  }<br />
<br />
  uint16_t ga = parseGroupAddress(groupAddress);<br />
  uint8_t buf[64];<br />
  uint8_t payloadLen = 0;<br />
<br />
  buf[0] = 0x06; buf[1] = 0x10;<br />
  buf[2] = 0x04; buf[3] = 0x20;<br />
  buf[4] = 0x00; buf[5] = 0x00;<br />
<br />
  buf[6] = 0x04;<br />
  buf[7] = knxChannelId;<br />
  buf[8] = txSeqNum;<br />
  buf[9] = 0x00;<br />
<br />
  buf[10] = 0x11;<br />
  buf[11] = 0x00;<br />
  buf[12] = 0xBC;<br />
  buf[13] = 0xE0;<br />
  buf[14] = 0x00; buf[15] = 0x00;<br />
  buf[16] = (uint8_t)(ga &gt;&gt; 8);<br />
  buf[17] = (uint8_t)(ga &amp; 0xFF);<br />
<br />
  if (dptType == "DPT1") {<br />
    buf[18] = 0x01;<br />
    buf[19] = 0x00;<br />
    buf[20] = (rawValue.toInt() &gt; 0) ? 0x81 : 0x80;<br />
    payloadLen = 21;<br />
  }<br />
  else if (dptType == "DPT5") {<br />
    buf[18] = 0x02;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)rawValue.toInt();<br />
    payloadLen = 22;<br />
  }<br />
  else if (dptType == "DPT9") {<br />
    uint16_t dpt9Val = floatToDpt9(rawValue.toFloat());<br />
    buf[18] = 0x03;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)(dpt9Val &gt;&gt; 8);<br />
    buf[22] = (uint8_t)(dpt9Val &amp; 0xFF);<br />
    payloadLen = 23;<br />
  }<br />
  else if (dptType == "DPT10") {<br />
    int h = 0, m = 0, s = 0;<br />
    int c1 = rawValue.indexOf(':');<br />
    if (c1 == -1) {<br />
      h = rawValue.toInt();<br />
    } else {<br />
      h = rawValue.substring(0, c1).toInt();<br />
      int c2 = rawValue.indexOf(':', c1 + 1);<br />
      if (c2 == -1) {<br />
        m = rawValue.substring(c1 + 1).toInt();<br />
      } else {<br />
        m = rawValue.substring(c1 + 1, c2).toInt();<br />
        s = rawValue.substring(c2 + 1).toInt();<br />
      }<br />
    }<br />
    buf[18] = 0x04;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)(h &amp; 0x1F);<br />
    buf[22] = (uint8_t)(m &amp; 0x3F);<br />
    buf[23] = (uint8_t)(s &amp; 0x3F);<br />
    payloadLen = 24;<br />
  }<br />
  else if (dptType == "DPT11") {<br />
    int day = 1, month = 1, year = 26;<br />
    int p1 = rawValue.indexOf('.');<br />
    if (p1 != -1) {<br />
      day = rawValue.substring(0, p1).toInt();<br />
      int p2 = rawValue.indexOf('.', p1 + 1);<br />
      if (p2 != -1) {<br />
        month = rawValue.substring(p1 + 1, p2).toInt();<br />
        int y = rawValue.substring(p2 + 1).toInt();<br />
        year = (y &gt;= 2000) ? (y - 2000) : y;<br />
      }<br />
    } else {<br />
      day = rawValue.toInt();<br />
    }<br />
    buf[18] = 0x04;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = (uint8_t)(day &amp; 0x1F);<br />
    buf[22] = (uint8_t)(month &amp; 0x0F);<br />
    buf[23] = (uint8_t)(year &amp; 0x7F);<br />
    payloadLen = 24;<br />
  }<br />
  else if (dptType == "DPT14") {<br />
    uint8_t db[4];<br />
    floatToDpt14Bytes(rawValue.toFloat(), db);<br />
    buf[18] = 0x05;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    buf[21] = db[0];<br />
    buf[22] = db[1];<br />
    buf[23] = db[2];<br />
    buf[24] = db[3];<br />
    payloadLen = 25;<br />
  }<br />
  else if (dptType == "DPT16") {<br />
    uint8_t strLen = rawValue.length();<br />
    if (strLen &gt; 14) strLen = 14;<br />
<br />
    buf[18] = 15;<br />
    buf[19] = 0x00;<br />
    buf[20] = 0x80;<br />
    for (int i = 0; i &lt; 14; i++) {<br />
      buf[21 + i] = (i &lt; strLen) ? rawValue[i] : 0x00;<br />
    }<br />
    payloadLen = 21 + 14;<br />
  }<br />
  else {<br />
    Serial.println("[KNX TX] FEHLER - Unbekannter DPT Typ!");<br />
    return false;<br />
  }<br />
<br />
  buf[5] = payloadLen;<br />
<br />
  Serial.printf("[KNX TX] GA: %s (0x%04X) | DPT: %s | Val: %s | Seq: %d&#92;n",<br />
                groupAddress.c_str(), ga, dptType.c_str(), rawValue.c_str(), txSeqNum);<br />
  hexDump("[KNX TX] TUNNELING_REQUEST", buf, payloadLen);<br />
<br />
  uint8_t sentSeq = txSeqNum;<br />
<br />
  udp.beginPacket(knxGatewayIp, knxPort);<br />
  udp.write(buf, payloadLen);<br />
  udp.endPacket();<br />
<br />
  txSeqNum++;<br />
<br />
  unsigned long waitStart = millis();<br />
  bool ackOk = false;<br />
  while (millis() - waitStart &lt; ACK_TIMEOUT) {<br />
    int packetSize = udp.parsePacket();<br />
    if (packetSize &gt; 0) {<br />
      uint8_t rxBuf[64];<br />
      int len = udp.read(rxBuf, sizeof(rxBuf));<br />
      uint16_t st = processIncomingPacket(rxBuf, len);<br />
      if (st == 0x0421 &amp;&amp; len &gt;= 9 &amp;&amp; rxBuf[8] == sentSeq) {<br />
        ackOk = (len &gt;= 10 &amp;&amp; rxBuf[9] == 0x00);<br />
        break;<br />
      }<br />
    }<br />
    delay(5);<br />
  }<br />
<br />
  if (!ackOk) {<br />
    Serial.println("!!! KEIN passendes TUNNELING_ACK erhalten (Timeout nach 1000ms) !!!");<br />
  }<br />
<br />
  return ackOk;<br />
}<br />
<br />
String escapeJson(String s) {<br />
  String out;<br />
  for (size_t i = 0; i &lt; s.length(); i++) {<br />
    char c = s[i];<br />
    if (c == '"' || c == '&#92;&#92;') out += '&#92;&#92;';<br />
    out += c;<br />
  }<br />
  return out;<br />
}<br />
<br />
void handleRoot() {<br />
  String html = "&lt;html&gt;&lt;head&gt;&lt;meta charset='UTF-8'&gt;";<br />
  html += "&lt;title&gt;" + String(projectName) + "&lt;/title&gt;";<br />
  html += "&lt;style&gt;body{font-family:Arial,sans-serif;margin:20px;background:#f4f4f9;color:#333}";<br />
  html += ".card{background:#fff;padding:20px;border-radius:8px;box-shadow:0 2px 5px rgba(0,0,0,0.1);max-width:650px;margin:auto}";<br />
  html += "h1{text-align:center;margin-bottom:2px;}";<br />
  html += "#dtNow{text-align:center;color:#666;margin-top:0;margin-bottom:16px;font-size:14px;}";<br />
  html += "input,select,button{width:100%;padding:10px;margin:10px 0;box-sizing:border-box;border:1px solid #ccc;border-radius:4px;font-size:16px}";<br />
  html += "button{background:#007bff;color:#fff;font-weight:bold;border:none;cursor:pointer}button:hover{background:#0056b3}";<br />
  html += "#statusMsg{margin-top:10px;font-weight:bold;color:#28a745;text-align:center;}";<br />
  html += "table{width:100%;border-collapse:collapse;font-size:13px;margin-top:10px;}";<br />
  html += "th,td{border-bottom:1px solid #eee;padding:6px 4px;text-align:left;}";<br />
  html += "th{background:#f0f0f5;}";<br />
  html += "&lt;/style&gt;&lt;/head&gt;&lt;body&gt;";<br />
<br />
  html += "&lt;div class='card'&gt;";<br />
  html += "&lt;h1&gt;" + String(projectName) + "&lt;/h1&gt;";<br />
  html += "&lt;p id='dtNow'&gt;...&lt;/p&gt;";<br />
  html += "&lt;p&gt;KNX Status: &lt;span id='knxStatus'&gt;" + String(isKnxConnected ? "&lt;b style='color:green;'&gt;Verbunden (Channel " + String(knxChannelId) + ")" : "Getrennt") + "";<br />
<br />
  html += "&lt;label&gt;Gruppenadresse (z.B. 1/0/0):&lt;/label&gt;";<br />
  html += "&lt;input type='text' id='ga' value='1/0/0'&gt;";<br />
<br />
  html += "&lt;label&gt;Datenpunkttyp (DPT):&lt;/label&gt;";<br />
  html += "&lt;select id='dpt'&gt;";<br />
  html += "&lt;option value='DPT1'&gt;DPT 1 (1 Bit Schalten 0/1)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT5'&gt;DPT 5 (1 Byte Wert 0..255)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT9'&gt;DPT 9 (2 Byte Float Temp/Wert)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT10'&gt;DPT 10 (Zeit, z.B. 14:30:00)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT11'&gt;DPT 11 (Datum, z.B. 24.12.26)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT14'&gt;DPT 14 (4 Byte Float IEEE754)&lt;/option&gt;";<br />
  html += "&lt;option value='DPT16'&gt;DPT 16 (14 Byte Text)&lt;/option&gt;";<br />
  html += "&lt;/select&gt;";<br />
<br />
  html += "&lt;label&gt;Wert / Payload:&lt;/label&gt;";<br />
  html += "&lt;input type='text' id='val' value='1' placeholder='z.B. 1, 128, 21.5, 14:30:00, 24.12.26 oder Text'&gt;";<br />
<br />
  html += "&lt;button type='button' onclick='sendTelegram()'&gt;KNX Telegramm Senden&lt;/button&gt;";<br />
  html += "&lt;button type='button' onclick='reconnectKnx()' style='background:#6c757d;'&gt;KNX Reconnect&lt;/button&gt;";<br />
  html += "&lt;div id='statusMsg'&gt;&lt;/div&gt;";<br />
<br />
  html += "&lt;h3&gt;Letzte empfangene Telegramme&lt;/h3&gt;";<br />
  html += "&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Zeit&lt;/th&gt;&lt;th&gt;GA&lt;/th&gt;&lt;th&gt;Bytes&lt;/th&gt;&lt;th&gt;Hex&lt;/th&gt;&lt;th&gt;Wert&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;";<br />
  html += "&lt;tbody id='logBody'&gt;Lade...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;";<br />
<br />
  html += "&lt;/div&gt;";<br />
<br />
  html += "&lt;script&gt;";<br />
  html += "function sendTelegram(){";<br />
  html += "  var ga = document.getElementById('ga').value;";<br />
  html += "  var dpt = document.getElementById('dpt').value;";<br />
  html += "  var val = document.getElementById('val').value;";<br />
  html += "  document.getElementById('statusMsg').innerText = 'Sende...';";<br />
  html += "  fetch('/send?ga=' + encodeURIComponent(ga) + '&amp;dpt=' + encodeURIComponent(dpt) + '&amp;val=' + encodeURIComponent(val))";<br />
  html += "  .then(response =&gt; response.text())";<br />
  html += "  .then(data =&gt; { document.getElementById('statusMsg').innerText = data; })";<br />
  html += "  .catch(err =&gt; { document.getElementById('statusMsg').innerText = 'Fehler beim Senden!'; });";<br />
  html += "}";<br />
  html += "function reconnectKnx(){";<br />
  html += "  fetch('/reconnect').then(r=&gt;r.text()).then(d=&gt;{ updateStatus(); });";<br />
  html += "}";<br />
  html += "function updateStatus(){";<br />
  html += "  fetch('/status').then(r=&gt;r.json()).then(d=&gt;{";<br />
  html += "    document.getElementById('dtNow').innerText = d.datetime;";<br />
  html += "    document.getElementById('knxStatus').innerHTML = d.connected ? (&#92;"&lt;b style='color:green;'&gt;Verbunden (Channel &#92;" + d.channel + &#92;")&lt;/b&gt;&#92;") : &#92;"&lt;b style='color:red;'&gt;Getrennt&lt;/b&gt;&#92;";";<br />
  html += "    var rows = '';";<br />
  html += "    d.log.forEach(function(e){ rows += '&lt;tr&gt;&lt;td&gt;'+e.time+'&lt;/td&gt;&lt;td&gt;'+e.ga+'&lt;/td&gt;&lt;td&gt;'+e.len+'&lt;/td&gt;&lt;td&gt;'+e.hex+'&lt;/td&gt;&lt;td&gt;'+e.value+'&lt;/td&gt;&lt;/tr&gt;'; });";<br />
  html += "    document.getElementById('logBody').innerHTML = rows || '&lt;tr&gt;&lt;td colspan=5&gt;Noch keine Telegramme empfangen&lt;/td&gt;&lt;/tr&gt;';";<br />
  html += "  }).catch(function(){});";<br />
  html += "}";<br />
  html += "setInterval(updateStatus, 1000);";<br />
  html += "updateStatus();";<br />
  html += "&lt;/script&gt;";<br />
<br />
  html += "&lt;/body&gt;&lt;/html&gt;";<br />
  server.send(200, "text/html", html);<br />
}<br />
<br />
void handleSend() {<br />
  if (server.hasArg("ga") &amp;&amp; server.hasArg("dpt") &amp;&amp; server.hasArg("val")) {<br />
    String ga = server.arg("ga");<br />
    String dpt = server.arg("dpt");<br />
    String val = server.arg("val");<br />
<br />
    bool ok = sendKnxValue(ga, dpt, val);<br />
    server.send(200, "text/plain", ok ? "Telegramm gesendet und per ACK bestaetigt!" : "Gesendet, aber KEIN ACK erhalten, siehe Serial Monitor!");<br />
  } else {<br />
    server.send(400, "text/plain", "Fehlende Parameter!");<br />
  }<br />
}<br />
<br />
void handleReconnect() {<br />
  connectKnx();<br />
  server.send(200, "text/plain", "Reconnected!");<br />
}<br />
<br />
void handleStatus() {<br />
  String json = "{";<br />
  json += "&#92;"project&#92;":&#92;"" + escapeJson(String(projectName)) + "&#92;",";<br />
  json += "&#92;"datetime&#92;":&#92;"" + escapeJson(getFormattedDateTime()) + "&#92;",";<br />
  json += "&#92;"connected&#92;":" + String(isKnxConnected ? "true" : "false") + ",";<br />
  json += "&#92;"channel&#92;":" + String(knxChannelId) + ",";<br />
  json += "&#92;"log&#92;":[";<br />
<br />
  for (int i = 0; i &lt; knxLogFilled; i++) {<br />
    int idx = (knxLogNext - 1 - i + KNX_LOG_SIZE) % KNX_LOG_SIZE;<br />
    KnxLogEntry &amp;e = knxLog[idx];<br />
<br />
    String hex = "";<br />
    for (int b = 0; b &lt; e.len; b++) {<br />
      char hb[4];<br />
      snprintf(hb, sizeof(hb), "%02X ", e.data[b]);<br />
      hex += hb;<br />
    }<br />
    hex.trim();<br />
<br />
    if (i &gt; 0) json += ",";<br />
    json += "{";<br />
    json += "&#92;"time&#92;":&#92;"" + escapeJson(String(e.timeStr)) + "&#92;",";<br />
    json += "&#92;"ga&#92;":&#92;"" + escapeJson(gaToString(e.ga)) + "&#92;",";<br />
    json += "&#92;"len&#92;":" + String(e.len) + ",";<br />
    json += "&#92;"hex&#92;":&#92;"" + escapeJson(hex) + "&#92;",";<br />
    json += "&#92;"value&#92;":&#92;"" + escapeJson(interpretKnxData(e.data, e.len)) + "&#92;"";<br />
    json += "}";<br />
  }<br />
  json += "]}";<br />
  server.send(200, "application/json", json);<br />
}<br />
<br />
void setup() {<br />
  Serial.begin(115200);<br />
  delay(1000);<br />
<br />
  Serial.printf("&#92;n===&gt; %s &lt;===&#92;n", projectName);<br />
<br />
  WiFi.begin(ssid, password);<br />
  while (WiFi.status() != WL_CONNECTED) {<br />
    delay(500);<br />
    Serial.print(".");<br />
  }<br />
<br />
  Serial.println("&#92;nWLAN Verbunden!");<br />
  Serial.print("IP Adresse - "); Serial.println(WiFi.localIP());<br />
  Serial.print("RSSI: "); Serial.println(WiFi.RSSI());<br />
<br />
  configTzTime(tzInfo, ntpServer);<br />
  Serial.println("Warte auf Zeitsynchronisation (NTP)...");<br />
  struct tm timeinfo;<br />
  if (getLocalTime(&amp;timeinfo, 5000)) {<br />
    Serial.println("Zeit synchronisiert - " + getFormattedDateTime());<br />
  } else {<br />
    Serial.println("Zeit konnte nicht synchronisiert werden (wird spaeter automatisch nachgeholt).");<br />
  }<br />
<br />
  udp.begin(localPort);<br />
<br />
  connectKnx();<br />
<br />
  server.on("/", handleRoot);<br />
  server.on("/send", handleSend);<br />
  server.on("/reconnect", handleReconnect);<br />
  server.on("/status", handleStatus);<br />
  server.begin();<br />
}<br />
<br />
void loop() {<br />
  server.handleClient();<br />
  handleKnxRx();<br />
<br />
  if (isKnxConnected &amp;&amp; (millis() - lastHeartbeat &gt; HEARTBEAT_INTERVAL)) {<br />
    sendConnectionStateRequest();<br />
    lastHeartbeat = millis();<br />
  }<br />
}</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Script PHP pour connexion par tunnel IP KNX]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16448</link>
			<pubDate>Tue, 15 Sep 2026 17:35:43 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=10826">Smart Guido 73</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16448</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">Bonjour,</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">Je mets à disposition ce petit code PHP pour ceux qui souhaitent créer davantage de choses avec PHP et KNX. Il établit une connexion par tunnel IP, envoie des données pour les DPT 1, 5 ou 9, puis se déconnecte.</span><br />
<span style="font-weight: bold;" class="mycode_b">Cela n'a rien à voir non plus avec mon wrapper, c'est totalement indépendant.</span><br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">Code PHP :</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br />header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type:&nbsp;text/html;&nbsp;charset=utf-8'</span><span style="color: #007700">);<br /><br />class&nbsp;</span><span style="color: #0000BB">KNXTunnel&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">string&nbsp;&#36;ip</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;port</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">&#36;socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;channelId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;sequenceNumber&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">__construct</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;port&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">3671</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;ip</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;port</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;msg</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">void&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;msg&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&gt;&#092;n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">ob_get_level</span><span style="color: #007700">()&nbsp;&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{&nbsp;@</span><span style="color: #0000BB">ob_flush</span><span style="color: #007700">();&nbsp;}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">@</span><span style="color: #0000BB">flush</span><span style="color: #007700">();<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">getLocalIp</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;sock&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">socket_create</span><span style="color: #007700">(</span><span style="color: #0000BB">AF_INET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOCK_DGRAM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_UDP</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;sock</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_getsockname</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;sock</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;addr</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_close</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;sock</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">&#36;addr</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">statusText</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;&#36;status</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;match&nbsp;(</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x00&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_NO_ERROR'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x22&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_CONNECTION_TYPE&nbsp;(Verbindungstyp&nbsp;nicht&nbsp;unterstützt)'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x23&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_CONNECTION_OPTION&nbsp;(Option&nbsp;nicht&nbsp;unterstützt)'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x24&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_NO_MORE_CONNECTIONS&nbsp;(max.&nbsp;Anzahl&nbsp;Tunnel-Verbindungen&nbsp;erreicht)'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x26&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_DATA_CONNECTION'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x27&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_KNX_CONNECTION'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x29&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_NO_MORE_UNIQUE_CONNECTIONS'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">default&nbsp;=&gt;&nbsp;</span><span style="color: #DD0000">'unbekannt&nbsp;(0x'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%02X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">')'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">};<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">connect</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">bool&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">socket_create</span><span style="color: #007700">(</span><span style="color: #0000BB">AF_INET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOCK_DGRAM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_UDP</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Socket&nbsp;konnte&nbsp;nicht&nbsp;erstellt&nbsp;werden&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">()));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_set_option</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_SOCKET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SO_RCVTIMEO</span><span style="color: #007700">,&nbsp;[</span><span style="color: #DD0000">'sec'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'usec'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;myPcIp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocalIp</span><span style="color: #007700">();<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"ℹ️&nbsp;Lokale&nbsp;IP&nbsp;:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(!@</span><span style="color: #0000BB">socket_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">))&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Fehler&nbsp;beim&nbsp;Binden&nbsp;an&nbsp;PC&nbsp;IP&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;localPort&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_getsockname</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;localPort</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;ipParts&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">array_map</span><span style="color: #007700">(</span><span style="color: #DD0000">'intval'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">explode</span><span style="color: #007700">(</span><span style="color: #DD0000">'.'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;hpaiControl&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C*'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x08</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x01</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;localPort</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;hpaiData&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C*'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x08</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x01</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;localPort</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;header&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x06&#092;x10&#092;x02&#092;x05&#092;x00&#092;x1a"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;cri&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x04&#092;x04&#092;x02&#092;x00"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;connectRequest&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;header&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;hpaiControl&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;hpaiData&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;cri</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_sendto</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;connectRequest</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;connectRequest</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;CONNECT_REQUEST&nbsp;gesendet&nbsp;an&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">}</span><span style="color: #DD0000">:</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;buffer&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;from&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;fromPort&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;bytes&nbsp;</span><span style="color: #007700">=&nbsp;@</span><span style="color: #0000BB">socket_recvfrom</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1024</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;from</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;fromPort</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;recvfrom&nbsp;Fehler&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Zu&nbsp;kurze&nbsp;Antwort&nbsp;empfangen&nbsp;(</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;bytes</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;Bytes)."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;Rohdaten&nbsp;empfangen&nbsp;von&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;from</span><span style="color: #007700">}</span><span style="color: #DD0000">:</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;fromPort</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;("&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;Bytes):&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;serviceType&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">])&nbsp;&lt;&lt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;|&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;serviceType&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0x0206</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Unerwarteter&nbsp;Service&nbsp;Type&nbsp;:&nbsp;0x"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%04X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;serviceType</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&nbsp;(erwartet&nbsp;:&nbsp;0x0206&nbsp;CONNECT_RESPONSE)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;status&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">7</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;status&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;IP&nbsp;Gateway&nbsp;abbruch,&nbsp;Status&nbsp;:&nbsp;0x"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%02X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&nbsp;("&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">statusText</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">")"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">6</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"✅&nbsp;IP&nbsp;Gateway&nbsp;Tunnel&nbsp;erfolgreich&nbsp;aufgebaut!&nbsp;(Channel&nbsp;ID&nbsp;:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">}</span><span style="color: #DD0000">)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">parseGroupAddress</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;ga</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;parts&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">explode</span><span style="color: #007700">(</span><span style="color: #DD0000">'/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;ga</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;main&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0x1F</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;middle&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0x07</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;sub&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;val&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">&#36;main&nbsp;</span><span style="color: #007700">&lt;&lt;&nbsp;</span><span style="color: #0000BB">11</span><span style="color: #007700">)&nbsp;|&nbsp;(</span><span style="color: #0000BB">&#36;middle&nbsp;</span><span style="color: #007700">&lt;&lt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;|&nbsp;</span><span style="color: #0000BB">&#36;sub</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;val</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #DD0000">"&#092;x00&#092;x00"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">encodeDPT</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;dptType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">switch&nbsp;(</span><span style="color: #0000BB">strtoupper</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;dptType</span><span style="color: #007700">))&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">case&nbsp;</span><span style="color: #DD0000">'DPT1'</span><span style="color: #007700">:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80&nbsp;</span><span style="color: #007700">|&nbsp;(</span><span style="color: #0000BB">&#36;value&nbsp;</span><span style="color: #007700">?&nbsp;</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">case&nbsp;</span><span style="color: #DD0000">'DPT5'</span><span style="color: #007700">:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;val&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">max</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">min</span><span style="color: #007700">(</span><span style="color: #0000BB">255</span><span style="color: #007700">,&nbsp;(int)</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;val</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">case&nbsp;</span><span style="color: #DD0000">'DPT9'</span><span style="color: #007700">:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;v&nbsp;</span><span style="color: #007700">=&nbsp;(float)</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;sign&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">&#36;v&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">0x8000&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">0x0000</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;v&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">abs</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;v</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;mantissa&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">round</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;v&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;exponent&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">while&nbsp;(</span><span style="color: #0000BB">&#36;mantissa&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">2047</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;mantissa&nbsp;</span><span style="color: #007700">&gt;&gt;=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;exponent</span><span style="color: #007700">++;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;sign</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">&#36;mantissa&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">&#36;mantissa</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;raw&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;sign&nbsp;</span><span style="color: #007700">|&nbsp;((</span><span style="color: #0000BB">&#36;exponent&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">0x0F</span><span style="color: #007700">)&nbsp;&lt;&lt;&nbsp;</span><span style="color: #0000BB">11</span><span style="color: #007700">)&nbsp;|&nbsp;(</span><span style="color: #0000BB">&#36;mantissa&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">0x07FF</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C*'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80</span><span style="color: #007700">,&nbsp;(</span><span style="color: #0000BB">&#36;raw&nbsp;</span><span style="color: #007700">&gt;&gt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;raw&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">default:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">throw&nbsp;new&nbsp;</span><span style="color: #0000BB">Exception</span><span style="color: #007700">(</span><span style="color: #DD0000">"DPT&nbsp;Typ&nbsp;'</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;dptType</span><span style="color: #007700">}</span><span style="color: #DD0000">'&nbsp;nicht&nbsp;unterstützt."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;groupAddress</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string&nbsp;&#36;dptType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">bool&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;send()&nbsp;ohne&nbsp;aktiven&nbsp;Tunnel&nbsp;aufgerufen,&nbsp;zuerst&nbsp;connect()&nbsp;erfolgreich&nbsp;ausführen."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;gaBytes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">parseGroupAddress</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;groupAddress</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;payload&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">encodeDPT</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;dptType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;payloadLen&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;payload</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;cemi&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x11&#092;x00&#092;xbc&#092;xe0&#092;x00&#092;x00"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;gaBytes&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;payloadLen</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&#092;x00"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;payload</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;totalLen&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">6&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">4&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;cemi</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;header&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x06&#092;x10&#092;x04&#092;x20"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;totalLen</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;connectionHeader&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x04</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;packet&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;header&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;connectionHeader&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;cemi</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_sendto</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;packet</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;packet</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;Telegramm&nbsp;an&nbsp;&lt;b&gt;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;groupAddress</span><span style="color: #007700">}</span><span style="color: #DD0000">&lt;/b&gt;&nbsp;gesendet!&nbsp;(Seq:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber</span><span style="color: #007700">}</span><span style="color: #DD0000">)"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;ack&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">receiveACK</span><span style="color: #007700">();<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;%&nbsp;</span><span style="color: #0000BB">256</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">&#36;ack</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">receiveACK</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">bool&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;buffer&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;from&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;port&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;bytes&nbsp;</span><span style="color: #007700">=&nbsp;@</span><span style="color: #0000BB">socket_recvfrom</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1024</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;from</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;port</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Kein&nbsp;ACK&nbsp;erhalten&nbsp;(Timeout)&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">&gt;=&nbsp;</span><span style="color: #0000BB">10&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">])&nbsp;===&nbsp;</span><span style="color: #0000BB">0x04&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;===&nbsp;</span><span style="color: #0000BB">0x21</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;status&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">9</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;status&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;ACK&nbsp;vom&nbsp;IP&nbsp;Gateway&nbsp;erhalten."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"⚠️&nbsp;ACK&nbsp;erhalten,&nbsp;aber&nbsp;mit&nbsp;Fehlerstatus:&nbsp;0x"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%02X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"⚠️&nbsp;Unerwartete&nbsp;Antwort&nbsp;statt&nbsp;ACK&nbsp;erhalten&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">disconnect</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">void&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;disconnectRequest&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x06&#092;x10&#092;x02&#092;x09&#092;x00&#092;x10"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&#092;x08&#092;x01&#092;x00&#092;x00&#092;x00&#092;x00&#092;x00&#092;x00"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">@</span><span style="color: #0000BB">socket_sendto</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;disconnectRequest</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;disconnectRequest</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;IP&nbsp;Gateway&nbsp;Tunnel&nbsp;Verbindung&nbsp;(Channel&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">}</span><span style="color: #DD0000">)&nbsp;ordnungsgemäß&nbsp;getrennt."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">@</span><span style="color: #0000BB">socket_close</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br />}<br /><br /></span><span style="color: #0000BB">&#36;Ip&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'192.168.178.42'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">&#36;knx&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">KNXTunnel</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;Ip</span><span style="color: #007700">);<br /><br />try&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;knx</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">())&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;knx</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #DD0000">'1/0/0'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'DPT1'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br />}&nbsp;finally&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;&#36;knx</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">disconnect</span><span style="color: #007700">();<br />}&nbsp;<br /></span></code></div></div></div>]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">Bonjour,</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">Je mets à disposition ce petit code PHP pour ceux qui souhaitent créer davantage de choses avec PHP et KNX. Il établit une connexion par tunnel IP, envoie des données pour les DPT 1, 5 ou 9, puis se déconnecte.</span><br />
<span style="font-weight: bold;" class="mycode_b">Cela n'a rien à voir non plus avec mon wrapper, c'est totalement indépendant.</span><br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">Code PHP :</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">&lt;?php<br />header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type:&nbsp;text/html;&nbsp;charset=utf-8'</span><span style="color: #007700">);<br /><br />class&nbsp;</span><span style="color: #0000BB">KNXTunnel&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">string&nbsp;&#36;ip</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;port</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">&#36;socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;channelId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;sequenceNumber&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">__construct</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;&#36;port&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">3671</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;ip</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;port</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;msg</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">void&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">&#36;msg&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&lt;br&gt;&#092;n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">ob_get_level</span><span style="color: #007700">()&nbsp;&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{&nbsp;@</span><span style="color: #0000BB">ob_flush</span><span style="color: #007700">();&nbsp;}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">@</span><span style="color: #0000BB">flush</span><span style="color: #007700">();<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">getLocalIp</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;sock&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">socket_create</span><span style="color: #007700">(</span><span style="color: #0000BB">AF_INET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOCK_DGRAM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_UDP</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;sock</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_getsockname</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;sock</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;addr</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_close</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;sock</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">&#36;addr</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">statusText</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;&#36;status</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;match&nbsp;(</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x00&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_NO_ERROR'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x22&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_CONNECTION_TYPE&nbsp;(Verbindungstyp&nbsp;nicht&nbsp;unterstützt)'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x23&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_CONNECTION_OPTION&nbsp;(Option&nbsp;nicht&nbsp;unterstützt)'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x24&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_NO_MORE_CONNECTIONS&nbsp;(max.&nbsp;Anzahl&nbsp;Tunnel-Verbindungen&nbsp;erreicht)'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x26&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_DATA_CONNECTION'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x27&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_KNX_CONNECTION'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x29&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'E_NO_MORE_UNIQUE_CONNECTIONS'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">default&nbsp;=&gt;&nbsp;</span><span style="color: #DD0000">'unbekannt&nbsp;(0x'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%02X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">')'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">};<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">connect</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">bool&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">socket_create</span><span style="color: #007700">(</span><span style="color: #0000BB">AF_INET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOCK_DGRAM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_UDP</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Socket&nbsp;konnte&nbsp;nicht&nbsp;erstellt&nbsp;werden&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">()));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_set_option</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_SOCKET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SO_RCVTIMEO</span><span style="color: #007700">,&nbsp;[</span><span style="color: #DD0000">'sec'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'usec'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;myPcIp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocalIp</span><span style="color: #007700">();<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"ℹ️&nbsp;Lokale&nbsp;IP&nbsp;:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(!@</span><span style="color: #0000BB">socket_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">))&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Fehler&nbsp;beim&nbsp;Binden&nbsp;an&nbsp;PC&nbsp;IP&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;localPort&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_getsockname</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;localPort</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;ipParts&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">array_map</span><span style="color: #007700">(</span><span style="color: #DD0000">'intval'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">explode</span><span style="color: #007700">(</span><span style="color: #DD0000">'.'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;myPcIp</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;hpaiControl&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C*'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x08</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x01</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;localPort</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;hpaiData&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C*'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x08</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x01</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">&#36;ipParts</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;localPort</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;header&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x06&#092;x10&#092;x02&#092;x05&#092;x00&#092;x1a"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;cri&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x04&#092;x04&#092;x02&#092;x00"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;connectRequest&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;header&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;hpaiControl&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;hpaiData&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;cri</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_sendto</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;connectRequest</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;connectRequest</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;CONNECT_REQUEST&nbsp;gesendet&nbsp;an&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">}</span><span style="color: #DD0000">:</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;buffer&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;from&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;fromPort&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;bytes&nbsp;</span><span style="color: #007700">=&nbsp;@</span><span style="color: #0000BB">socket_recvfrom</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1024</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;from</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;fromPort</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;recvfrom&nbsp;Fehler&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Zu&nbsp;kurze&nbsp;Antwort&nbsp;empfangen&nbsp;(</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;bytes</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;Bytes)."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;Rohdaten&nbsp;empfangen&nbsp;von&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;from</span><span style="color: #007700">}</span><span style="color: #DD0000">:</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;fromPort</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;("&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"&nbsp;Bytes):&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;serviceType&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">])&nbsp;&lt;&lt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;|&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;serviceType&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0x0206</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Unerwarteter&nbsp;Service&nbsp;Type&nbsp;:&nbsp;0x"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%04X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;serviceType</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&nbsp;(erwartet&nbsp;:&nbsp;0x0206&nbsp;CONNECT_RESPONSE)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;status&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">7</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;status&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;IP&nbsp;Gateway&nbsp;abbruch,&nbsp;Status&nbsp;:&nbsp;0x"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%02X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&nbsp;("&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">statusText</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">")"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">6</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"✅&nbsp;IP&nbsp;Gateway&nbsp;Tunnel&nbsp;erfolgreich&nbsp;aufgebaut!&nbsp;(Channel&nbsp;ID&nbsp;:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">}</span><span style="color: #DD0000">)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">parseGroupAddress</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;ga</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;parts&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">explode</span><span style="color: #007700">(</span><span style="color: #DD0000">'/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;ga</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;main&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0x1F</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;middle&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0x07</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;sub&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">&#36;parts</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;val&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">&#36;main&nbsp;</span><span style="color: #007700">&lt;&lt;&nbsp;</span><span style="color: #0000BB">11</span><span style="color: #007700">)&nbsp;|&nbsp;(</span><span style="color: #0000BB">&#36;middle&nbsp;</span><span style="color: #007700">&lt;&lt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;|&nbsp;</span><span style="color: #0000BB">&#36;sub</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;val</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #DD0000">"&#092;x00&#092;x00"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">encodeDPT</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;dptType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">string&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">switch&nbsp;(</span><span style="color: #0000BB">strtoupper</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;dptType</span><span style="color: #007700">))&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">case&nbsp;</span><span style="color: #DD0000">'DPT1'</span><span style="color: #007700">:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80&nbsp;</span><span style="color: #007700">|&nbsp;(</span><span style="color: #0000BB">&#36;value&nbsp;</span><span style="color: #007700">?&nbsp;</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">case&nbsp;</span><span style="color: #DD0000">'DPT5'</span><span style="color: #007700">:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;val&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">max</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">min</span><span style="color: #007700">(</span><span style="color: #0000BB">255</span><span style="color: #007700">,&nbsp;(int)</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;val</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">case&nbsp;</span><span style="color: #DD0000">'DPT9'</span><span style="color: #007700">:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;v&nbsp;</span><span style="color: #007700">=&nbsp;(float)</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;sign&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">&#36;v&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">0x8000&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">0x0000</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;v&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">abs</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;v</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;mantissa&nbsp;</span><span style="color: #007700">=&nbsp;(int)</span><span style="color: #0000BB">round</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;v&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;exponent&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">while&nbsp;(</span><span style="color: #0000BB">&#36;mantissa&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">2047</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;mantissa&nbsp;</span><span style="color: #007700">&gt;&gt;=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;exponent</span><span style="color: #007700">++;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;sign</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">&#36;mantissa&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">&#36;mantissa</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;raw&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;sign&nbsp;</span><span style="color: #007700">|&nbsp;((</span><span style="color: #0000BB">&#36;exponent&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">0x0F</span><span style="color: #007700">)&nbsp;&lt;&lt;&nbsp;</span><span style="color: #0000BB">11</span><span style="color: #007700">)&nbsp;|&nbsp;(</span><span style="color: #0000BB">&#36;mantissa&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">0x07FF</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C*'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x80</span><span style="color: #007700">,&nbsp;(</span><span style="color: #0000BB">&#36;raw&nbsp;</span><span style="color: #007700">&gt;&gt;&nbsp;</span><span style="color: #0000BB">8</span><span style="color: #007700">)&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;raw&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">0xFF</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">default:<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">throw&nbsp;new&nbsp;</span><span style="color: #0000BB">Exception</span><span style="color: #007700">(</span><span style="color: #DD0000">"DPT&nbsp;Typ&nbsp;'</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;dptType</span><span style="color: #007700">}</span><span style="color: #DD0000">'&nbsp;nicht&nbsp;unterstützt."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #0000BB">string&nbsp;&#36;groupAddress</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string&nbsp;&#36;dptType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">bool&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;send()&nbsp;ohne&nbsp;aktiven&nbsp;Tunnel&nbsp;aufgerufen,&nbsp;zuerst&nbsp;connect()&nbsp;erfolgreich&nbsp;ausführen."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;gaBytes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">parseGroupAddress</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;groupAddress</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;payload&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">encodeDPT</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;dptType</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;payloadLen&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;payload</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;cemi&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x11&#092;x00&#092;xbc&#092;xe0&#092;x00&#092;x00"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;gaBytes&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'C'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;payloadLen</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&#092;x00"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;payload</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;totalLen&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">6&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">4&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;cemi</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;header&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x06&#092;x10&#092;x04&#092;x20"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;totalLen</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;connectionHeader&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x04</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;packet&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;header&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;connectionHeader&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">&#36;cemi</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;socket_sendto</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;packet</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;packet</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;Telegramm&nbsp;an&nbsp;&lt;b&gt;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;groupAddress</span><span style="color: #007700">}</span><span style="color: #DD0000">&lt;/b&gt;&nbsp;gesendet!&nbsp;(Seq:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber</span><span style="color: #007700">}</span><span style="color: #DD0000">)"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;ack&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">receiveACK</span><span style="color: #007700">();<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">sequenceNumber&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;%&nbsp;</span><span style="color: #0000BB">256</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">&#36;ack</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">receiveACK</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">bool&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;buffer&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;from&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;port&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;bytes&nbsp;</span><span style="color: #007700">=&nbsp;@</span><span style="color: #0000BB">socket_recvfrom</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1024</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;from</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;port</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"❌&nbsp;Kein&nbsp;ACK&nbsp;erhalten&nbsp;(Timeout)&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;bytes&nbsp;</span><span style="color: #007700">&gt;=&nbsp;</span><span style="color: #0000BB">10&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">])&nbsp;===&nbsp;</span><span style="color: #0000BB">0x04&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;===&nbsp;</span><span style="color: #0000BB">0x21</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;status&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">[</span><span style="color: #0000BB">9</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;status&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;ACK&nbsp;vom&nbsp;IP&nbsp;Gateway&nbsp;erhalten."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"⚠️&nbsp;ACK&nbsp;erhalten,&nbsp;aber&nbsp;mit&nbsp;Fehlerstatus:&nbsp;0x"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">'%02X'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;status</span><span style="color: #007700">));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"⚠️&nbsp;Unerwartete&nbsp;Antwort&nbsp;statt&nbsp;ACK&nbsp;erhalten&nbsp;:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;buffer</span><span style="color: #007700">));<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">disconnect</span><span style="color: #007700">():&nbsp;</span><span style="color: #0000BB">void&nbsp;</span><span style="color: #007700">{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;disconnectRequest&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&#092;x06&#092;x10&#092;x02&#092;x09&#092;x00&#092;x10"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #DD0000">'CC'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0x00</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&#092;x08&#092;x01&#092;x00&#092;x00&#092;x00&#092;x00&#092;x00&#092;x00"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">@</span><span style="color: #0000BB">socket_sendto</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;disconnectRequest</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;disconnectRequest</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ip</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">port</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"?&nbsp;IP&nbsp;Gateway&nbsp;Tunnel&nbsp;Verbindung&nbsp;(Channel&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId</span><span style="color: #007700">}</span><span style="color: #DD0000">)&nbsp;ordnungsgemäß&nbsp;getrennt."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">channelId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">)&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">@</span><span style="color: #0000BB">socket_close</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#36;this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br />}<br /><br /></span><span style="color: #0000BB">&#36;Ip&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'192.168.178.42'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">&#36;knx&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">KNXTunnel</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;Ip</span><span style="color: #007700">);<br /><br />try&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">&#36;knx</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">())&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;&#36;knx</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #DD0000">'1/0/0'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'DPT1'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;</span><span style="color: #007700">}<br />}&nbsp;finally&nbsp;{<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;&#36;knx</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">disconnect</span><span style="color: #007700">();<br />}&nbsp;<br /></span></code></div></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Retour d'expérience sur ma certif KNX Partner]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16442</link>
			<pubDate>Mon, 14 Sep 2026 11:39:09 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=14998">p.alex</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16442</guid>
			<description><![CDATA[Salut à tous,<br />
<br />
Je viens d'avoir ma certif KNX Partner, et vu que j'ai pas mal stressé avant je me dis qu'un retour peut servir à d'autres.<br />
<br />
Mon gros souci c'était le QCM. J'avais lu le classeur en entier mais lire c'est pas se tester, donc aucune idée de mon niveau réel. Plus la peur de bloquer sur une question et de voir le temps passer.<br />
<br />
Au final le jour J ce qui m'a le plus surpris c'est la façon dont les questions sont tournées. Les tournures négatives, les propositions qui se ressemblent toutes. Tu connais la réponse et tu te plantes juste parce que t'as lu trop vite. Mon conseil : relire deux fois chaque question, ça vaut plus que dix pages de révision.<br />
<br />
Ce qui m'a vraiment débloqué c'est de faire des examens blancs. J'ai tapé "examen blanc knx" sur internet et je suis tombé sur un site qui propose des QCM dans les conditions de l'examen. Après franchement peu importe le support, c'est le fait de s'entraîner en conditions réelles qui enlève la pression. Le jour de l'examen le format te surprend plus, t'as juste le contenu à gérer.<br />
<br />
Le seul truc que je referais autrement, commencer ces QCM blancs plus tôt au lieu d'attendre d'avoir tout relu.<br />
<br />
Voilà, si ça peut en rassurer un ou deux tant mieux. Et vous vous aviez révisé comment ?]]></description>
			<content:encoded><![CDATA[Salut à tous,<br />
<br />
Je viens d'avoir ma certif KNX Partner, et vu que j'ai pas mal stressé avant je me dis qu'un retour peut servir à d'autres.<br />
<br />
Mon gros souci c'était le QCM. J'avais lu le classeur en entier mais lire c'est pas se tester, donc aucune idée de mon niveau réel. Plus la peur de bloquer sur une question et de voir le temps passer.<br />
<br />
Au final le jour J ce qui m'a le plus surpris c'est la façon dont les questions sont tournées. Les tournures négatives, les propositions qui se ressemblent toutes. Tu connais la réponse et tu te plantes juste parce que t'as lu trop vite. Mon conseil : relire deux fois chaque question, ça vaut plus que dix pages de révision.<br />
<br />
Ce qui m'a vraiment débloqué c'est de faire des examens blancs. J'ai tapé "examen blanc knx" sur internet et je suis tombé sur un site qui propose des QCM dans les conditions de l'examen. Après franchement peu importe le support, c'est le fait de s'entraîner en conditions réelles qui enlève la pression. Le jour de l'examen le format te surprend plus, t'as juste le contenu à gérer.<br />
<br />
Le seul truc que je referais autrement, commencer ces QCM blancs plus tôt au lieu d'attendre d'avoir tout relu.<br />
<br />
Voilà, si ça peut en rassurer un ou deux tant mieux. Et vous vous aviez révisé comment ?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Sonde de niveau KNX et fuite piscine, mon retour]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16441</link>
			<pubDate>Wed, 09 Sep 2026 17:37:13 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=16260">Olina</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16441</guid>
			<description><![CDATA[Salut à tous, Ça fait un moment que j'ai une sonde de niveau raccordée sur une entrée binaire KNX pour suivre le niveau de la piscine, couplée à l'actionneur qui gère l'appoint automatique. Chez moi à Puyricard ça tourne sans souci depuis des années, je regarde de temps en temps les logs dans la visu mais sans plus. Voilà. Cet été par contre j'ai commencé à voir un truc bizarre. L'appoint se déclenchait beaucoup trop souvent sur plusieurs semaines, genre presque tous les deux jours alors qu'en temps normal c'est plutôt une fois par semaine en pleine chaleur.<br />
<br />
J'ai regardé l'historique sur presque 6 semaines pour être sûr que c'était pas juste l'évaporation qui s'emballait avec la canicule, mais les chiffres collaient pas du tout. j'ai fini par me dire que ça servait à rien de continuer à interpréter des courbes tout seul dans mon coin. J'ai pris rdv pour une recherche de <a href="https://resoborvo.fr/fuite-piscine/" target="_blank" rel="noopener" class="mycode_url"><span style="color: #333333;" class="mycode_color">fuite piscine</span></a> histoire d'avoir un diagnostic clair, plutôt que de deviner à partir de la visu... Le technicien est venu, a fait ses tests (sans vidanger le bassin, ce qui m'arrangeait bien), et a localisé le point de fuite assez vite en fait.<br />
<br />
C'était au niveau d'un raccord sur le circuit de refoulement, invisible à l'oeil nu évidemment. Réparation faite dans la foulée. Comptez autour de 600 euros pour le diagnostic dans mon cas, apres ça dépend sûrement de la config de chacun. Depuis, la sonde est repassée à des cycles d'appoint normaux, ça confirme que c'était bien ça. Franchement sans le suivi via KNX j'aurais mis un bon moment à me rendre compte du problème, l'oeil nu ne voit rien sur une fuite de ce genre.]]></description>
			<content:encoded><![CDATA[Salut à tous, Ça fait un moment que j'ai une sonde de niveau raccordée sur une entrée binaire KNX pour suivre le niveau de la piscine, couplée à l'actionneur qui gère l'appoint automatique. Chez moi à Puyricard ça tourne sans souci depuis des années, je regarde de temps en temps les logs dans la visu mais sans plus. Voilà. Cet été par contre j'ai commencé à voir un truc bizarre. L'appoint se déclenchait beaucoup trop souvent sur plusieurs semaines, genre presque tous les deux jours alors qu'en temps normal c'est plutôt une fois par semaine en pleine chaleur.<br />
<br />
J'ai regardé l'historique sur presque 6 semaines pour être sûr que c'était pas juste l'évaporation qui s'emballait avec la canicule, mais les chiffres collaient pas du tout. j'ai fini par me dire que ça servait à rien de continuer à interpréter des courbes tout seul dans mon coin. J'ai pris rdv pour une recherche de <a href="https://resoborvo.fr/fuite-piscine/" target="_blank" rel="noopener" class="mycode_url"><span style="color: #333333;" class="mycode_color">fuite piscine</span></a> histoire d'avoir un diagnostic clair, plutôt que de deviner à partir de la visu... Le technicien est venu, a fait ses tests (sans vidanger le bassin, ce qui m'arrangeait bien), et a localisé le point de fuite assez vite en fait.<br />
<br />
C'était au niveau d'un raccord sur le circuit de refoulement, invisible à l'oeil nu évidemment. Réparation faite dans la foulée. Comptez autour de 600 euros pour le diagnostic dans mon cas, apres ça dépend sûrement de la config de chacun. Depuis, la sonde est repassée à des cycles d'appoint normaux, ça confirme que c'était bien ça. Franchement sans le suivi via KNX j'aurais mis un bon moment à me rendre compte du problème, l'oeil nu ne voit rien sur une fuite de ce genre.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Quel compteur d'énergie utilisez-vous pour vos installations KNX / GTB ?]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16440</link>
			<pubDate>Wed, 09 Sep 2026 08:58:35 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=16259">APOLIER</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16440</guid>
			<description><![CDATA[Bonjour, je travaille chez POLIER, spécialiste du comptage électrique (compteurs, centrales de mesure et TC). Nous avons de plus en plus de demandes en lien avec le Décret Bacs. Quels sont les protocoles de communication les plus utilisés ?<br />
Merci]]></description>
			<content:encoded><![CDATA[Bonjour, je travaille chez POLIER, spécialiste du comptage électrique (compteurs, centrales de mesure et TC). Nous avons de plus en plus de demandes en lien avec le Décret Bacs. Quels sont les protocoles de communication les plus utilisés ?<br />
Merci]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Présentation Alexis]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16439</link>
			<pubDate>Wed, 09 Sep 2026 08:55:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=16259">APOLIER</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16439</guid>
			<description><![CDATA[Bonjour, je travaille chez POLIER INGENIERIE, nous sommes spécialiste du compte électrique (compteurs, centrales de mesures, TC) : <a href="http://www.polier.fr" target="_blank" rel="noopener" class="mycode_url">www.polier.fr</a>. Je viens pour poser des questions sur le Décret BACS.]]></description>
			<content:encoded><![CDATA[Bonjour, je travaille chez POLIER INGENIERIE, nous sommes spécialiste du compte électrique (compteurs, centrales de mesures, TC) : <a href="http://www.polier.fr" target="_blank" rel="noopener" class="mycode_url">www.polier.fr</a>. Je viens pour poser des questions sur le Décret BACS.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[commande avec variation d'un ruban led]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16438</link>
			<pubDate>Tue, 08 Sep 2026 08:49:29 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=4111">richardpub</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16438</guid>
			<description><![CDATA[mon électricien m'ayant planté, je dois utiliser un autre électricien mais qui n'aura pas de compétences knx, ce que je suis capable d'assurer.<br />
par contre, je dois refaire l'électricité de la chambre pour un relookage, et le KNX sera une extension à l'autre bout de la maison.<br />
Je pense que le plus simple c'est d'installer un actionneur relativement simple avec assez peu d'actions, dans la chambre elle-même.<br />
La partie qui me pose problème, car je ne maîtrise très peu cela, c'est la commande de LED unique d'un ruban intégré dans les meubles étagères en tête de lit, qui dendra donner une ambiance à la chambre.<br />
Quel système que dois-je utiliser, sachant que je n'aurai qu'une seule commande de LED avec une variation.<br />
Est-ce que Dali est indispensable, ou il y a-t-il des solutions plus simples avec une alimentation par exemple en 24 volts avec variation commander par le KNX.<br />
merci pour vos avis expérimentés]]></description>
			<content:encoded><![CDATA[mon électricien m'ayant planté, je dois utiliser un autre électricien mais qui n'aura pas de compétences knx, ce que je suis capable d'assurer.<br />
par contre, je dois refaire l'électricité de la chambre pour un relookage, et le KNX sera une extension à l'autre bout de la maison.<br />
Je pense que le plus simple c'est d'installer un actionneur relativement simple avec assez peu d'actions, dans la chambre elle-même.<br />
La partie qui me pose problème, car je ne maîtrise très peu cela, c'est la commande de LED unique d'un ruban intégré dans les meubles étagères en tête de lit, qui dendra donner une ambiance à la chambre.<br />
Quel système que dois-je utiliser, sachant que je n'aurai qu'une seule commande de LED avec une variation.<br />
Est-ce que Dali est indispensable, ou il y a-t-il des solutions plus simples avec une alimentation par exemple en 24 volts avec variation commander par le KNX.<br />
merci pour vos avis expérimentés]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Contacter support Hager / Domovea v2]]></title>
			<link>https://www.knx-fr.com/showthread.php?tid=16437</link>
			<pubDate>Mon, 07 Sep 2026 09:10:57 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.knx-fr.com/member.php?action=profile&uid=6480">pierrem</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.knx-fr.com/showthread.php?tid=16437</guid>
			<description><![CDATA[Bonjour,<br />
<br />
Je voudrais remonter un bug à Hager concernant le TJA470 (Domovea v2).<br />
<br />
L'adresse email support@domovea.com renvoi un mail de automatique disant d'utiliser un formulaire pour Domovea v1.<br />
<br />
D'après la FAQ, il faut passer par un installateur agréé pour tout ce qui concerne Domovea v2.<br />
<br />
Bref, quelqu'un parmi vous aurait un email pour contacter le support Hager ? <br />
<br />
D'avance merci,<br />
Pierre]]></description>
			<content:encoded><![CDATA[Bonjour,<br />
<br />
Je voudrais remonter un bug à Hager concernant le TJA470 (Domovea v2).<br />
<br />
L'adresse email support@domovea.com renvoi un mail de automatique disant d'utiliser un formulaire pour Domovea v1.<br />
<br />
D'après la FAQ, il faut passer par un installateur agréé pour tout ce qui concerne Domovea v2.<br />
<br />
Bref, quelqu'un parmi vous aurait un email pour contacter le support Hager ? <br />
<br />
D'avance merci,<br />
Pierre]]></content:encoded>
		</item>
	</channel>
</rss>