knxd (0.11.18) experience on RaspberryPi/Debian 8.0

454 views
Skip to first unread message

aj.hu...@gmail.com

unread,
Jan 15, 2017, 4:27:01 PM1/15/17
to knxd
Hi!

I recently had/have severe issues with my OpenHAB/SelfBus server setup (cubietruck + raspberry pi).
As one of the possible fixes I tried to get knxd up and running on my raspi.

For this I followed closely the build instructions given in the github repository.

After several build issues (missing dependencies but mainly on knxd during the testing stage) I decided to upgrade to Debian 8 and try again - with success as it seems.

So, many thanks for continuing eibd/knxd development!

Things I needed to resolve during install:

As a user of the Selfbus Raspberry FT1.2 hat I use serial interface on /dev/ttyAMA0 (--layer2=ft12:/dev/ttyAMA0).
Permissions of the device are as follows:
crw-rw---- 1 root dialout 204, 64 Jan 15 21:31 /dev/ttyAMA0

So I had to add user knxd (generated during dpkg install) to the group dialout:
usermod -a -G dialout knxd

I start knxd with following KNXD_OPTS in /etc/knxd.conf:
KNXD_OPTS="--trace=65535 --error=255 --eibaddr 0.0.254 --client-addrs=0.0.200:10 --GroupCache --Discovery --Tunnelling --Routing --Server --layer2=ft12:/dev/ttyAMA0"
(I added the --trace and --error parameters in the hope to find out why I still do not see any telegrams from the bus. One of the current issues I do have to solve.)

As Debian 8 is systemd based all logging output goes straight to /var/log/syslog and starting knxd as daemon (to define a logfile) did not work. I do not want to have knxd messages there, especially when debugging is turned on. As rsyslogd is active on my raspi I added following to /etc/rsyslog.d/knxd.conf:
#
# knxd rsyslog
#
# Catch all knxd generated syslog messages and redirect to a dedicated file
#
if $programname == "knxd" then {
       
# collect all matching messages in one dedicated file
        action
(type="omfile" file="/var/log/knx/knxd.log")

       
# we do not want to have this kind of logs in other log files
        stop
}

With that I also want log rotation of course. Based on /etc/logrotate.d/rsyslogd (hence the postrotate script) I created new file /etc/logrotate.d/knxd:

#
# Rotate logfiles of knxd generated by systemd filter
#
/var/log/knx/knxd.log {
        compress
        daily
        dateext
        delaycompress
        missingok
        notifempty
       
# keep old logs for ~ 100 years :-)
        rotate
36500
        postrotate
                invoke
-rc.d rsyslog rotate > /dev/null
        endscript
}

Maybe it makes sense to add the above to the build package. If so, feel free to copy and adapt.

If someone sees any issues in my setup, you are very welcome to help out :-)

I have some questions according settings (documentation) and possible ideas. I will put them to dedicated threads later.

Greetings,
Alex.

Matthias Urlichs

unread,
Jan 19, 2017, 12:13:15 PM1/19/17
to knxd
Feel free to prepare a pull request.
(but no keeping for 100 years, folks …)

Marc Joliet

unread,
Dec 15, 2017, 6:38:57 AM12/15/17
to kn...@googlegroups.com

(I've got a bad habit of saving unfinished emails in the drafts folder and then forgetting about them. I found this one while cleaning it up and thought it might still be informative.)

 

On Sunday 15 January 2017 13:27:01 aj.hu...@gmail.com wrote:

> Hi!

 

Hi,

 

[...]

> Things I needed to resolve during install:

>

> As a user of the Selfbus Raspberry FT1.2 hat I use serial interface on

> /dev/ttyAMA0 (*--layer2=ft12:/dev/ttyAMA0*).

> Permissions of the device are as follows:

> crw-rw---- 1 root dialout 204, 64 Jan 15 21:31 /dev/ttyAMA0

>

> So I had to add user knxd (generated during dpkg install) to the group

> dialout:

> usermod -a -G dialout knxd

 

It seems to me like this could be fixed slightly more elegantly with a udev

rule that extends the ACL of the device allowing the knxd user access (akin to how systemd-logind adds ACLs dynamically at run-time, only this would be at device node creation time). Thoughts?

 

Addendum just now, almost a year later: I just checked and it looks like systemd-tmpfiles can set ACLs, so maybe it would make sense to extend the tmpfiles.d file? Or maybe this sort of thing is too site-specific?

 

[...]

 

Greetings

--

Marc Joliet

--

"People who think they know everything really annoy those of us who know we

don't" - Bjarne Stroustrup

 

signature.asc
Reply all
Reply to author
Forward
0 new messages