I used the knxlib to connect to two different knx gateways (tunneling connection to ethernet interface) on the same knx-bus with the same machine and with the same network adapter.
they are physically different gateways.
connection works fine with the first connection.
when connecting to the second interface (using a different program but from the same machine) the connection opens briefly. I even get a package or three. but then it just disconnects.
the reason why I have multiple knx gateways in the first place is because i want to use different machines on the same bus. (which works). but for testing I wanted to run the program on a machine that's already connected.
I use linux on a raspberry pi and mono to run the .net application.
I use a simple test program to inject and log knx messages. here is the output of that test program when running wit with another connection open at the same time:
16:44:37.167 [ERROR] KNXLib.KnxConnectionTunneling: Cannot access a disposed object.
Object name: 'System.Net.Sockets.UdpClient'.
16:44:37.181 [ERROR] KNXLib.KnxConnectionTunneling: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.UdpClient'.
at System.Net.Sockets.UdpClient.CheckDisposed () [0x00016] in <bd46d4d4f7964dfa9beea098499ab597>:0
at System.Net.Sockets.UdpClient.Send (System.Byte[] dgram, System.Int32 bytes, System.Net.IPEndPoint endPoint) [0x00000] in <bd46d4d4f7964dfa9beea098499ab597>:0
at KNXLib.KnxSenderTunneling.SendData (System.Byte[] datagram) [0x00000] in <SOMEPATH>\knx.net\src\KNXLib\KnxSenderTunneling.cs:36
at KNXLib.KnxConnectionTunneling.DisconnectRequest () [0x000b3] in <SOMEPATH>\knx.net\src\KNXLib\KnxConnectionTunneling.cs:257
at KNXLib.KnxConnectionTunneling.Disconnect () [0x00006] in <SOMEPATH>\knx.net\src\KNXLib\KnxConnectionTunneling.cs:128
16:44:37.208 [ERROR] KNXLib.KnxConnectionTunneling: at System.Net.Sockets.UdpClient.CheckDisposed () [0x00016] in <bd46d4d4f7964dfa9beea098499ab597>:0
at System.Net.Sockets.UdpClient.Send (System.Byte[] dgram, System.Int32 bytes, System.Net.IPEndPoint endPoint) [0x00000] in <bd46d4d4f7964dfa9beea098499ab597>:0
at KNXLib.KnxSenderTunneling.SendData (System.Byte[] datagram) [0x00000] in <SOMEPATH>\knx.net\src\KNXLib\KnxSenderTunneling.cs:36
at KNXLib.KnxConnectionTunneling.DisconnectRequest () [0x000b3] in <SOMEPATH>\knx.net\src\KNXLib\KnxConnectionTunneling.cs:257
at KNXLib.KnxConnectionTunneling.Disconnect () [0x00006] in <SOMEPATH>\knx.net\src\KNXLib\KnxConnectionTunneling.cs:128
16:44:37.229 Disonnected
16:44:37.260 [DEBUG] KNXLib.KnxConnection: KNX is disconnected
16:44:37.266 [DEBUG] KNXLib.KnxConnection: Send locked - 0 free locks
16:44:37.276 [INFO] KNXLib.KnxConnectionTunneling: KNXLib connecting...
16:44:37.302 Connected
16:44:37.310 [DEBUG] KNXLib.KnxConnection: KNX is connected. Unlocking send - 1 free locks
16:44:39.453 [DEBUG] KNXLib.KnxReceiver: -----------------------------------------------------------------------------------------------------
16:44:39.471 [DEBUG] KNXLib.KnxReceiver: 29-00-BC-D0-14-31-34-15-03-00-80-0C-4E
16:44:39.483 [DEBUG] KNXLib.KnxReceiver: Event Header Length: 6
16:44:39.495 [DEBUG] KNXLib.KnxReceiver: Event Protocol Version: 10
16:44:39.510 [DEBUG] KNXLib.KnxReceiver: Event Service Type: 0x0420
16:44:39.523 [DEBUG] KNXLib.KnxReceiver: Event Total Length: 23
16:44:39.540 [DEBUG] KNXLib.KnxReceiver: Event Message Code: 29
16:44:39.558 [DEBUG] KNXLib.KnxReceiver: Event Aditional Info Length: 0
16:44:39.574 [DEBUG] KNXLib.KnxReceiver: Event Control Field 1: 10111100
16:44:39.583 [DEBUG] KNXLib.KnxReceiver: Event Control Field 2: 11010000
16:44:39.593 [DEBUG] KNXLib.KnxReceiver: Event Source Address: 1.4.49
16:44:39.602 [DEBUG] KNXLib.KnxReceiver: Event Destination Address: 6/4/21
16:44:39.611 [DEBUG] KNXLib.KnxReceiver: Event Data Length: 3
16:44:39.619 [DEBUG] KNXLib.KnxReceiver: Event APDU: 0x00800C4E
16:44:39.636 [DEBUG] KNXLib.KnxReceiver: Event Data: 0x0C4E
16:44:39.644 [DEBUG] KNXLib.KnxReceiver: -----------------------------------------------------------------------------------------------------
16:44:39.815 [DEBUG] KNXLib.KnxReceiver: -----------------------------------------------------------------------------------------------------
16:44:39.826 [DEBUG] KNXLib.KnxReceiver: 29-00-BC-D0-14-64-0C-7C-03-00-80-02-BC
16:44:39.836 [DEBUG] KNXLib.KnxReceiver: Event Header Length: 6
16:44:39.843 [Event] 1.4.49 ==( 0x00000C4E [2] )==> 6/4/21
16:44:39.850 [DEBUG] KNXLib.KnxReceiver: Event Protocol Version: 10
16:44:39.857 [DEBUG] KNXLib.KnxConnection: Device 1.4.49 sent event 0x0C4E to 6/4/21
16:44:39.864 [DEBUG] KNXLib.KnxReceiver: Event Service Type: 0x0420
16:44:39.882 [DEBUG] KNXLib.KnxReceiver: Event Total Length: 23
16:44:39.890 [DEBUG] KNXLib.KnxReceiver: Event Message Code: 29
16:44:39.911 [DEBUG] KNXLib.KnxReceiver: Event Aditional Info Length: 0
16:44:39.919 [DEBUG] KNXLib.KnxReceiver: Event Control Field 1: 10111100
16:44:39.926 [DEBUG] KNXLib.KnxReceiver: Event Control Field 2: 11010000
16:44:39.935 [DEBUG] KNXLib.KnxReceiver: Event Source Address: 1.4.100
16:44:39.945 [DEBUG] KNXLib.KnxReceiver: Event Destination Address: 1/4/124
16:44:39.954 [DEBUG] KNXLib.KnxReceiver: Event Data Length: 3
16:44:39.962 [DEBUG] KNXLib.KnxReceiver: Event APDU: 0x008002BC
16:44:39.971 [DEBUG] KNXLib.KnxReceiver: Event Data: 0x02BC
16:44:39.979 [DEBUG] KNXLib.KnxReceiver: -----------------------------------------------------------------------------------------------------
16:44:39.989 [Event] 1.4.100 ==( 0x000002BC [2] )==> 1/4/124
[...]
16:45:19.076 [DEBUG] KNXLib.KnxConnection: Device 1.2.10 sent event 0x00C8 to 1/2/4
16:45:20.375 [DEBUG] KNXLib.KnxReceiver: -----------------------------------------------------------------------------------------------------
16:45:20.402 [DEBUG] KNXLib.KnxReceiver: 29-00-BC-D0-1C-28-09-22-03-00-80-00-C8
16:45:20.427 [DEBUG] KNXLib.KnxReceiver: Event Header Length: 6
16:45:20.450 [DEBUG] KNXLib.KnxReceiver: Event Protocol Version: 10
16:45:20.468 [DEBUG] KNXLib.KnxReceiver: Event Service Type: 0x0420
16:45:20.487 [DEBUG] KNXLib.KnxReceiver: Event Total Length: 23
16:45:20.501 [DEBUG] KNXLib.KnxReceiver: Event Message Code: 29
16:45:20.516 [DEBUG] KNXLib.KnxReceiver: Event Aditional Info Length: 0
16:45:20.531 [DEBUG] KNXLib.KnxReceiver: Event Control Field 1: 10111100
16:45:20.545 [DEBUG] KNXLib.KnxReceiver: Event Control Field 2: 11010000
16:45:20.560 [DEBUG] KNXLib.KnxReceiver: Event Source Address: 1.12.40
16:45:20.575 [DEBUG] KNXLib.KnxReceiver: Event Destination Address: 1/1/34
16:45:20.603 [DEBUG] KNXLib.KnxReceiver: Event Data Length: 3
16:45:20.617 [DEBUG] KNXLib.KnxReceiver: Event APDU: 0x008000C8
16:45:20.631 [DEBUG] KNXLib.KnxReceiver: Event Data: 0x00C8
16:45:20.645 [DEBUG] KNXLib.KnxReceiver: -----------------------------------------------------------------------------------------------------
16:45:20.662 [Event] 1.12.40 ==( 0x000000C8 [2] )==> 1/1/34
16:45:20.677 [DEBUG] KNXLib.KnxConnection: Device 1.12.40 sent event 0x00C8 to 1/1/34
16:45:22.127 [DEBUG] KNXLib.KnxReceiverTunneling: Received connection state response - No active connection with channel ID 92
16:45:22.153 Disonnected
16:45:22.177 [DEBUG] KNXLib.KnxConnection: KNX is disconnected
16:45:22.203 [DEBUG] KNXLib.KnxConnection: Send locked - 0 free locks
sometimes the connection lasts 2 minutes, sometimes it dies right away after just a few seconds.
I used the knxlib to connect to two different knx gateways (tunneling connection to ethernet interface) on the same knx-bus with the same machine and with the same network adapter. they are physically different gateways.
connection works fine with the first connection. when connecting to the second interface (using a different program but from the same machine) the connection opens briefly. I even get a package or three. but then it just disconnects.
the reason why I have multiple knx gateways in the first place is because i want to use different machines on the same bus. (which works). but for testing I wanted to run the program on a machine that's already connected.
I use linux on a raspberry pi and mono to run the .net application.
I use a simple test program to inject and log knx messages. here is the output of that test program when running wit with another connection open at the same time:
sometimes the connection lasts 2 minutes, sometimes it dies right away after just a few seconds.