Connecting to siemens 148-1ab21

Hi,
I moved to a home with a KNX system. I would like to connect to it from my home network. The KNX/IP interface is 148-1ab21.

I couldn’t find any documentation on the KNX/IP protocol. Instead I am using code as a reference.

I am trying to connect to the interface but it fails. Wireshark output is as follows:

  1. First packet to 148-1ab21:
KNX/IP Search Request, Discovery @ 10.0.0.54:55640

0000   01 00 5e 00 17 0c 54 e1 ad b4 fb 05 08 00 45 00  
0010   00 2a 56 9f 00 00 02 11 00 00 0a 00 00 36 e0 00 
0020   17 0c d9 58 0e 57 00 16 23 21 06 10 02 01 00 0e 
0030   08 01 0a 00 00 36 d9 58                          
  1. Second packet from 148-1ab21:
KNX/IP Search Response, Control @ 10.0.0.210:3671, 1.0.251 "IP Interface N148"

0000   54 e1 ad b4 fb 05 00 0e 8c 00 99 82 08 00 45 00 
0010   00 68 00 1c 40 00 10 11 55 62 0a 00 00 d2 0a 00 
0020   00 36 0e 57 d9 58 00 54 85 d5 06 10 02 02 00 4c 
0030   08 01 0a 00 00 d2 0e 57 36 01 02 00 10 fb 00 00 
0040   00 01 00 21 42 b3 00 00 00 00 00 0e 8c 00 99 82  
0050   49 50 20 49 6e 74 65 72 66 61 63 65 20 4e 31 34   
0060   38 00 00 00 00 00 00 00 00 00 00 00 00 00 08 02 
0070   02 01 03 01 04 01                                
  1. Third packet to 148-1ab21:
KNX/IP Connect Request, Control @ 10.0.0.54:55640, Data @ 10.0.0.54:55640, Tunnel

0000   00 0e 8c 00 99 82 54 e1 ad b4 fb 05 08 00 45 00
0010   00 36 59 42 00 00 80 11 00 00 0a 00 00 36 0a 00
0020   00 d2 d9 5a 0e 57 00 22 15 3b 06 10 02 05 00 1a
0030   08 01 0a 00 00 36 d9 5a 08 01 0a 00 00 36 d9 5a
0040   04 04 02 00                                       ....
  1. Fourth packet from 148-1ab21:
KNX/IP Connect Response: E_KNX_CONNECTION

0000   54 e1 ad b4 fb 05 00 0e 8c 00 99 82 08 00 45 00
0010   00 24 00 1d 40 00 10 11 55 a5 0a 00 00 d2 0a 00 
0020   00 36 0e 57 d9 5a 00 10 fa cf 06 10 02 06 00 08
0030   00 27 27 27 27 27 27 27 27 27 27 27              

In some library I found E_KNX_CONNECTION described as:

    # The KNXnet/IP Server device detects an error concerning
    # the KNX subnetwork connection with the specified ID.
    E_KNX_CONNECTION = 0x27

As I couldn’t find any documentation I don’t know where in the connect datagram there is an ID field.

Any idea how to further debug this?
Thanks
Guy

Is another device connecting via the interface?

You can get documentation for the protocol at my.knx.org - I think you need to create an account. You can also get a demo version of ETS there wich you can use to monitor the bus.

Does home-assistant log any errors?
xknx (github.com/xknx/xknx) is the Library used in HA. You can set a higher log-level:
Activate debug log for KNX

Hi,
I’ve just downloaded the specification.
This is the only device connected (I think) as I am connected from my PC to the KNX/IP interface with a crossover cable (this is temporary for debug, of course).
Reading the KNXnet/IP core specification it is strange that I send a CONNECT_REQUEST message (0x0205) but get error E_KNX_CONNECTION 0x27 on a CONNECT_RESPONSE message (0x0206). This is funny because the specification indicates that error 0x27 is an error for a CONNECTIONSTATE_REQUEST (0x0207).
This evening I will try sending other packets to the KNX/IP interface (such as DESCRIPTION_REQUEST, CONNECTIONSTATE_REQUEST, DISCONNECT_REQUEST) and see which replies I get.
Thanks again

I did some more testing…

When I send CONNECTIONSTATE_REQUEST on connection ID 1,2 or 3 I get E_CONNECTION_ID.
When I send CONNECTIONSTATE_REQUEST on connection 0 I get E_NO_ERROR.
I tried sending DISCONNECT_REQUEST to connection ID 0 - and received OK.
I then sent CONNECT_REQUEST but received E_KNX_CONNECTION.

I don’t understand how/why I get this error for CONNECT_REQUEST as the KNX/IP spec doesn’t specify E_KNX_CONNECTION as a possible error code for CONNECT_REQUEST.

Note: I am connected to the Siemens 5WG1 148-1AB21 with a crossover Ethernet cable (and to via a LAN). There is no other device that can connect to the KNX/IP interface except my laptop. I also tried connecting with “KNX dashboard” but received the same results.

Any idea on how to debug?
Thanks.

BTW, I am using the XKNX python package

Can you connect with ETS?

I do not have ETS installed. I will try this evening.

This is what I get when trying to connect using ETS5 bus monitor:

Knx.Ets.TelegramRecorder.Recorder.TelegramMonitorException: The interface can be connected from the PC, but is not connected to the KNX bus. —> Knx.Bus.Common.Exceptions.ConnectorException: The KNXnet/IP server device detects an error concerning the KNX subnetwork connection
at aih.a(ConnectResponseStatusCodes A_0)
at aih.a(ConnectorMode A_0, agy A_1, CancellationToken A_2)
at aih.d.c(CancellationToken A_0)
at af5.c.c()
at System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at af5.a(agy A_0, Action1 A_1, Action1 A_2)
at aih.a(ConnectionTypes A_0, ConnectorMode A_1, Action1 A_2) at aih.hi(ConnectorMode A_0) at Knx.Falcon.Bus.a(ConnectorMode A_0, Boolean& A_1) at Knx.Falcon.Bus.a(ConnectorMode A_0) at Knx.Falcon.Bus.r() at Knx.Ets.ViewModel.OnlineOperations.Connection.<OpenBusmonConnection>b__49_0(FalconOpenParameters openParams) at Knx.Ets.ViewModel.OnlineOperations.FalconWrapper.CallFalconMethodWithOpenParametersAndRetryWithMacIfPossible(Action1 action, FalconOpenParameters openParameters, Boolean checkUserLogin)
at Knx.Ets.ViewModel.OnlineOperations.Connection.OpenBusmonConnection()
at Knx.Ets.TelegramRecorder.Recorder.FalconReceiver.Start(IMonitorConnectionService connectionService, ConnectorParameters openParams, Boolean isDefaultConnection, Boolean busmonMode)
at Knx.Ets.TelegramRecorder.Recorder.TelegramRecorder.RecordStart(ConnectorParameters openParameters, Boolean isDefaultConnection, Boolean busmonMode)
at Knx.Ets.TelegramRecorderView.ViewModel.MonitorViewModel.<get_Start>b__60_0()
— End of inner exception stack trace —
at Knx.Ets.TelegramRecorderView.ViewModel.MonitorViewModel.<get_Start>b__60_0()

Does the GroupMonitor work? I think some interfaces don’t support busmonitor.