I'm trying to create an application based on data generated by KNX devices on a smart home. For this reason I have downloaded the C# KNX Falcon SDK and use it to communicate with KNX Virtual. However, every time that I try to initiate a connection with KNX Virtual it crashes (the window closes).
This is the code that I use for creating a connection to the KNX Virtual:
static void Main(string[] args)
{
var options = new KnxIpTunnelingConnectorParameters(
"127.0.0.1", 3671, true);
using (var bus = new Bus(options)) {
try {
bus.Connect();
Console.WriteLine(bus.IsConnected);
} catch(Exception ex) {
Console.WriteLine(ex);
}
}
}
and here are the KNX Virtual settings:
IP address: 127.0.0.1
IP Port: 3671
KNXNet IP Router: 224.0.23.12
Interface TP: 1.1.255
My questions are:
This is a bug in KNX Virtual which does not support the "NAT mode".
Change your configuation to
var options = new KnxIpTunnelingConnectorParameters("127.0.0.1", 3671, false);
to connect without "NAT mode".