Basic help with KNXD / KNX IP ROUTER INTERFACE

1,590 views
Skip to first unread message

Marco Castellano

unread,
Oct 28, 2018, 6:26:37 AM10/28/18
to knxd
Hello everyone and sorry in advance the banality of my questions, unfortunately I do not have the basics of programming, but I am a KNX certificate (At least this!)
I have Stretch and Homebridge with KNX plugin installed on my new RB pi 3(static ip 192.168.1.6)
I have a KNX IP router interface (EKINEX https://en.ekinex.com/technical-area_knx-system-devices/ip-router_136.html) with static ip 192.168.1.60 in my network
With not a few difficulties I installed KNXD and now I have to configure it
How could I enter in edit mode?what parameters do I have to use?

I also have configured and put in place the KNX_CONFIG.JSON file (I can see all the KNX objects in the homekit without communications on the bus).

Of which device is the IP In the first line of Json file " knxd_ip | "192.168.1.6" ? of the KNX/IP router? of the RB pi?
I am working on 1.0.X area/sector on ETS 5
Thanks a lot for your big help!

Marco

Othmar Truniger

unread,
Oct 28, 2018, 8:57:03 AM10/28/18
to knxd

Personally I have no clue about Homebridge but reading the description of the knx plugin it clearly states that it needs a working knxd as background service. That should answer your second question.

No idea what you mean with edit mode. knxd is started with a few parameters depending on your environment. Parametes are set in the configuration file or it is started with the ini file.

First you have to determine a few free group addresses: one for the knxd and a few for the clients which connect through knxd. This defines the -e and -E parameters. For example -e 0.0.1 -E 0.0.2:9
Second: what's the exact type of your router or interface? if you use EK-BB1-TP it's a KNX interface which provides a tunnel for knxd to connect to the bus with the parameter -b ipt:192.168.1.60. But if it's EK-BC1-TP it's a router talking multicast and knxd also need to talk multicast by the parameter -b ip:

to check for a running knxd daemon, use "systemctl status knxd". There you see the startup parameters and the running status. If you need debugging add a -t1023 just before the -b. Please show the output of your service status if you need more support.


to verify knxd talking to the bus you can send on/off to a switch GA by this commands:
knxtool groupswrite ip: <GA> 1
knxtool groupswrite ip: <GA> 0

to watch bus traffice you can use:
knxtool vbusmonitor1 ip:

in these commands "ip:" is a shortcut for ip:localhost or ip:192.168.1.6

for a full description of the different parameters use knxd_args --help (you may need to search for knxd_args in the lib or libexec directory)

Matthias Urlichs

unread,
Oct 28, 2018, 9:21:32 AM10/28/18
to kn...@googlegroups.com
On 28.10.18 13:57, Othmar Truniger wrote:
> If you need debugging add a -t1023 just before the -b.

Actually, "-t 1022 -B log". Bit zero logs raw physical data, which is
mostly what you don't need (except if you suspect a seriously buggy
interface).

On the other hand, you also want to log the actual KNX packet-level data
as they're passed to/from the knxd core. -t* does not do this any more
because there now are multiple points where these packets might be
logged, and you need to specify which of these you're interested in.

--
-- Matthias Urlichs

Message has been deleted
Message has been deleted

Marco Castellano

unread,
Oct 29, 2018, 4:40:18 PM10/29/18
to knxd
Good evening
I tried  to do a SUDO NANO /etc/ knxd.conf writing this string in the file

KNXD_OPTS="-e 1.0.50 -E 1.0.51:18 -u /tmp/eib -b ip:192.168.1.60”


Now the daemon is not running anymore

As you suggest I wrote 

systemctl status knxd.service


and this is what I obtain:

● knxd.service - KNX Daemon

   Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: enabled)

   Active: activating (auto-restart) (Result: exit-code) since Mon 2018-10-29 21:32:37 CET; 2s ago

  Process: 18110 ExecStart=/usr/bin/knxd $KNXD_OPTS (code=exited, status=2)

 Main PID: 18110 (code=exited, status=2)


Oct 29 21:32:37 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Oct 29 21:32:37 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-code'.


I think I am very near to the solution, because i can see all the KNX devices in my HOME app.. I just think the KNXD Daemon is corrupted/badly configured..


This is how the Ekinex EK-BC1-TP interface is configured in ETS5

Parametri Ekinex IP Router.jpg

Thank in advance for your help

Marco

Marco Castellano

unread,
Oct 29, 2018, 4:52:21 PM10/29/18
to knxd

Othmar Truniger

unread,
Oct 30, 2018, 1:59:25 AM10/30/18
to kn...@googlegroups.com
It only works with correct syntax: it's "-b ipt:192.168.1.60" if you use a KNX interface and it's just "-b ip:" if it's a KNX router. For a router it takes default multicast IP address. Don't change it.

Marco Castellano

unread,
Oct 31, 2018, 3:00:09 PM10/31/18
to knxd
Hello everyone,
I just re-edit the file /etc/knxd.conf
adding this string KNXD_OPTS="-e 1.0.50 -E 1.0.51:18 -u /tmp/eib -b ip:”


after giving systemctl status knxd
this is what I receive


● knxd.service - KNX Daemon

   Loaded: loaded (/lib/systemd/system/knxd.service; enabled; vendor preset: ena

   Active: activating (auto-restart) (Result: exit-code) since Wed 2018-10-31 19

  Process: 747 ExecStart=/usr/bin/knxd $KNXD_OPTS (code=exited, status=2)

 Main PID: 747 (code=exited, status=2)


Oct 31 19:51:44 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Oct 31 19:51:44 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-c

lines 1-8/8 (END)



What's wrong?

Marco

Othmar Truniger

unread,
Oct 31, 2018, 3:22:40 PM10/31/18
to knxd
No idea, works for me.
Did you do a restart after editing?

Matthias Urlichs

unread,
Oct 31, 2018, 4:02:29 PM10/31/18
to kn...@googlegroups.com
Hi,
What's wrong?

No idea. Please retrieve error messages with "journalctl -u knxd -n20 --no-pager", your output has been cut off.

Also you might want to add "-f9 -t1022" to the beginning of your argument list, for more debug info.

-- 
-- Matthias Urlichs

Marco Castellano

unread,
Nov 1, 2018, 4:22:33 PM11/1/18
to knxd
Hi Matthias,
this is the output

pi@raspberrypi:~ $ journalctl -u knxd -n20 --no-pager

-- Logs begin at Thu 2016-11-03 18:16:42 CET, end at Thu 2018-11-01 21:17:26 CET. --

Nov 01 21:17:11 raspberrypi systemd[1]: ': /etc/knxd.conf

Nov 01 21:17:11 raspberrypi systemd[1]: Starting KNX Daemon...

Nov 01 21:17:11 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Nov 01 21:17:11 raspberrypi systemd[1]: Failed to start KNX Daemon.

Nov 01 21:17:11 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Nov 01 21:17:11 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-code'.

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Service hold-off time over, scheduling restart.

Nov 01 21:17:21 raspberrypi systemd[1]: Stopped KNX Daemon.

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Ignoring invalid environment assignment 'KNXD_OPTS=-e 1.0.50 -E 1.0.51:8 -u /tmp/eib -b ip:192.168.1.60”

Nov 01 21:17:21 raspberrypi systemd[1]: # configuration for knxd.service using new configuration format in /etc/knxd.ini

Nov 01 21:17:21 raspberrypi systemd[1]: # use only this line if you used knxd_args to convert your old startup options

Nov 01 21:17:21 raspberrypi systemd[1]: # KNXD_OPTS=/etc/knxd.ini

Nov 01 21:17:21 raspberrypi systemd[1]: # The default options are -u /tmp/eib -b ip:"': /etc/knxd.conf

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Ignoring invalid environment assignment 'KNXD_OPTS=-e 1.0.50 -E 1.0.51:18 -u /tmp/eib -b ip:”

Nov 01 21:17:21 raspberrypi systemd[1]: ': /etc/knxd.conf

Nov 01 21:17:21 raspberrypi systemd[1]: Starting KNX Daemon...

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Nov 01 21:17:21 raspberrypi systemd[1]: Failed to start KNX Daemon.

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-code'.

Matthias Urlichs

unread,
Nov 1, 2018, 4:36:30 PM11/1/18
to kn...@googlegroups.com
On 01.11.18 21:22, Marco Castellano wrote:

Nov 01 21:17:21 raspberrypi systemd[1]: knxd.service: Ignoring invalid environment assignment 'KNXD_OPTS=-e 1.0.50 -E 1.0.51:8 -u /tmp/eib -b ip:192.168.1.60”

*Sigh* You might want to fix the quoting on that line.

-- 
-- Matthias Urlichs
signature.asc

Marco Castellano

unread,
Nov 1, 2018, 5:41:10 PM11/1/18
to knxd
Hello Matthias.
This is the new output, after correcting the previous wrong setting. I deleted the string KNXD_OPTS="-e 1.0.50 -E 1.0.51:18 -u /tmp/eib -b ip:192.168.1.60"      in etc/knxd.conf
I think I understand the file KNXD.service is not relevant for a new installation of KNXD daemon. I have to edit the KNX.ini. So I put the right string KNXD_OPTS="-e 1.0.50 -E 1.0.51:18 -u /tmp/eib -b ip:" in the file etc/knxd.ini (originally empty file)
Where am I wrong?


pi@raspberrypi:~ $ journalctl -u knxd -n20 --no-pager

-- Logs begin at Thu 2018-11-01 22:32:47 CET, end at Thu 2018-11-01 22:35:06 CET. --

Nov 01 22:34:42 raspberrypi systemd[1]: Stopped KNX Daemon.

Nov 01 22:34:42 raspberrypi systemd[1]: Starting KNX Daemon...

Nov 01 22:34:42 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Nov 01 22:34:42 raspberrypi systemd[1]: Failed to start KNX Daemon.

Nov 01 22:34:42 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Nov 01 22:34:42 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-code'.

Nov 01 22:34:52 raspberrypi systemd[1]: knxd.service: Service hold-off time over, scheduling restart.

Nov 01 22:34:52 raspberrypi systemd[1]: Stopped KNX Daemon.

Nov 01 22:34:52 raspberrypi systemd[1]: Starting KNX Daemon...

Nov 01 22:34:52 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Nov 01 22:34:52 raspberrypi systemd[1]: Failed to start KNX Daemon.

Nov 01 22:34:52 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Nov 01 22:34:52 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-code'.

Nov 01 22:35:03 raspberrypi systemd[1]: knxd.service: Service hold-off time over, scheduling restart.

Nov 01 22:35:03 raspberrypi systemd[1]: Stopped KNX Daemon.

Nov 01 22:35:03 raspberrypi systemd[1]: Starting KNX Daemon...

Nov 01 22:35:03 raspberrypi systemd[1]: knxd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Nov 01 22:35:03 raspberrypi systemd[1]: Failed to start KNX Daemon.

Nov 01 22:35:03 raspberrypi systemd[1]: knxd.service: Unit entered failed state.

Nov 01 22:35:03 raspberrypi systemd[1]: knxd.service: Failed with result 'exit-code'.

Marco Castellano

unread,
Nov 3, 2018, 7:16:44 AM11/3/18
to knxd
This is my KNXD.CONF

# configuration for knxd.service

KNXD_OPTS="-e 1.0.50 -E 1.0.51:18 -u /tmp/eib -b ip:”

# configuration for knxd.service using new configuration format in /etc/knxd.ini

# use only this line if you used knxd_args to convert your old startup options

# KNXD_OPTS=/etc/knxd.ini


# The default options are "-u /tmp/eib -b ip:"

# which tell knxd to route between all of

#  /tmp/eib (legacy socket (-u))

#  multicast client (-b ip:).

# knxd's own bus address is 0.0.1; it will assign 0.0.2…0.0.9 to clients.

# The knxd.socket file also tells knxd to listen to

#  /run/eib (socket activation via systemd)

#  TCP port 6720 (socket activation via systemd)

# You *need* the -e option. Clients cannot connect without "-E".


# You can read knxd's logs with

# $ journalctl -u knxd --since "10 min ago"

# (or whatever). See the manpage for details.

# You need to be a member of the "adm" group.

# Add "-f9 -t1023" to the beginning of the command line for extensive logging.


# *** DO NOT use "-u" / "-u /run/knx" or "-i" / "-i 6720" here.

# Systemd already does that on behalf of knxd, via 'knx.socket'.


# *** DO NOT use both "-RS" and "-b ip:" (unless you specify a

# different multicast address on one of them). You'd create a loop.


# If you have KNX hardware on a serial port or USB, add the appropriate

# "-b TYPE:…" option. In this case, you probably want to set up a multicast

# server, not a client (i.e. use "-D -T -R -S", not "-b ip:").

# DO NOT use both.

#

# If your KNX hardware is a KNX/IP gateway that doesn't do multicast,

# use "-b ipt:192.168.1.2" (or its DNS name) to talk to it.

#

# KNX MUST NOT have more than one path between any two devices. Thus,

# you need to make sure that the KNX/IP gateway does not route multicast

# before you use both "-S" and "-b ipt:".

Reply all
Reply to author
Forward
0 new messages