FHEM cannot write on the bus (via EIBD)

Begonnen von @lex99, 16 November 2015, 22:44:15

Vorheriges Thema - Nächstes Thema

@lex99

Hi,
I will write in English (German is too difficult  :-[ )

I have a Raspberry Pi model 2 (with Jessie), running linknx, knxweb & EIBD.   EIDB connects to a IP/KNX gateway (Siemens N148/22).

I have installed FHEM (fhem.cfg migrated from an older/slower Pi).  I have configured a TUL to connect to EIBD.  It can read messages from the bus, but cannot write on it.
The current status of TUL is "initialized".

Tul is defined as: eibd:localhost 15.15.251

I have this route defined in the Pi:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
224.0.23.12     *               255.255.255.255 UH    0      0        0 eth0

It won't work: FHEM sees what happens on the bus, but cannot write anything.

Thanks for your help.

Andi291

Hey,

what are the argumends to start the eibd?

Did you think about using the knxd instead of the eibd?

Regards, Andreas

@lex99

EIBD is started with:  /usr/local/bin/eibd --daemon=/var/log/eibd.log --pid-file=/var/run/eibd.pid -D -S -T --listen-tcp ipt:172.19.3.50

EIBD works OK with command line (groupswrite) and correctly with linknx.

Only for FHEM, it works read-only.

I am looking into knxd, but I cannot find a good step-by-step guide - perhaps you can point me to a thread on this forum ? (I can read German)

Thanks !

smurfix

ZitatI cannot find a good step-by-step guide

? the github page (mirroring the README file) has that, IMHO.

What do you think is missing?

Andi291

Good morning!

This config works fine for me:
eibd -e 1.1.241 -c -S -D -i -T -u --daemon=$home/log/eibd.log --pid-file=/var/run/eibd.pid ip:

smurfix

Note that for knxd, you'd need to change the arguments slightly, because I had to switch to processing the arguments in-order.
The line below should work for both eibd and knxd.

eibd -e 1.1.241 -c -DTS -i -u --daemon=$home/log/eibd.log --pid-file=/var/run/eibd.pid ip:

@lex99

This:
eibd -e 1.1.241 -c -DTS -i -u --daemon=$home/log/eibd.log --pid-file=/var/run/eibd.pid ip:

is giving me an error (initialisation of the backend failed)

I see that the switch "-T" is applied, so I have tried with this:
eibd -e 1.1.241 -c -DTS -i -u --daemon=$home/log/eibd.log --pid-file=/var/run/eibd.pid ipt:

and that works, but as before: linknx is OK, but FHEM still sees the bus as read-only.

Andi291

Hard to believe...

Please set to verbose 5, post your cfg and the fhem-log...

smurfix

Zitat(initialisation of the backend failed)
Does your system have a default route? What is your actual KNX interface?

"ipt:" without an IP address does not make sense.

Please use knxd if you have problems with eibd. The old eibd code is no longer supported. (Not by me, anyway.)

@lex99

Zitat von: smurfix am 23 November 2015, 06:31:02
? the github page (mirroring the README file) has that, IMHO.

What do you think is missing?

I get this error upon installation on Jessie:
*** You have old eibd libraries lying around in /usr/local/lib.
*** Remove them before building or installing knxd.

This is my /usr/local/lib:

total 1588
drwxrwsr-x  9 root staff   4096 Nov 14 22:53 .
drwxrwsr-x 14 root staff   4096 Oct 22 11:41 ..
-rw-r--r--  1 root staff 453136 Oct 24 22:35 libeibclient.a
-rwxr-xr-x  1 root staff    950 Oct 24 22:35 libeibclient.la
lrwxrwxrwx  1 root staff     21 Oct 24 22:35 libeibclient.so -> libeibclient.so.0.0.0
lrwxrwxrwx  1 root staff     21 Oct 24 22:35 libeibclient.so.0 -> libeibclient.so.0.0.0
-rwxr-xr-x  1 root staff 245180 Oct 24 22:35 libeibclient.so.0.0.0
-rw-r--r--  1 root staff 400182 Oct 24 22:28 libpthsem.a
-rwxr-xr-x  1 root staff    939 Oct 24 22:28 libpthsem.la
lrwxrwxrwx  1 root staff     20 Oct 24 22:28 libpthsem.so -> libpthsem.so.20.0.28
lrwxrwxrwx  1 root staff     20 Oct 24 22:28 libpthsem.so.20 -> libpthsem.so.20.0.28
-rwxr-xr-x  1 root staff 262928 Oct 24 22:28 libpthsem.so.20.0.28
-rw-r--r--  1 root staff 130052 Nov 14 22:53 libzlogger.a
-rwxr-xr-x  1 root staff    945 Nov 14 22:53 libzlogger.la
lrwxrwxrwx  1 root staff     19 Nov 14 22:53 libzlogger.so -> libzlogger.so.1.2.0
lrwxrwxrwx  1 root staff     19 Nov 14 22:53 libzlogger.so.1 -> libzlogger.so.1.2.0
-rwxr-xr-x  1 root staff  86176 Nov 14 22:53 libzlogger.so.1.2.0
drwxr-sr-x  2 root staff   4096 Nov 14 22:53 pkgconfig
drwxrwsr-x  5 root staff   4096 Oct 22 12:01 python2.7
drwxrwsr-x  4 root staff   4096 Oct 22 12:01 python3.4
drwxr-sr-x  3 root staff     28 Sep 24 16:27 site_ruby
drwxr-sr-x  3 root staff   4096 Nov 14 22:53 zlogger

What should I remove/do ?





smurfix

find /usr/local -name \*eib\*

Probably all files returned by this command.

If you want to remove all of them and you're lazy, do this:

find /usr/local -name \*eib\* -print0 | sudo xargs -0r rm -f

@lex99

Zitat von: smurfix am 23 November 2015, 17:53:39
find /usr/local -name \*eib\* -print0 | sudo xargs -0r rm -f
Nice one.  It worked.

I finished the install of knxd. 

I don't know what to do next.

I checked here: http://www.fhemwiki.de/wiki/Knxd
they talk about /etc/default/knxd

I don't have such a file.

They talk about /etc/init.d/knxd status

I dont have such a file either (/etc/init.d/knxd).

For info:
pi@PiMaster15 /etc/init.d $ which knxd
pi@PiMaster15 /etc/init.d $ which eibd
pi@PiMaster15 /etc/init.d $ groupswrite
groupswrite: error while loading shared libraries: libeibclient.so.0: cannot open shared object file: No such file or directory

I am on a Pi2 with Jessie.

smurfix

ZitatI don't know what to do next.
I don't understand the question. What do you mean, you "finished the install"? You should install by "dpkg -i". See the README.md file.
After doing that you definitely have /etc/knxd.conf and /etc/default/knxd; depending on whether you're using systemd or not, you edit the former or the latter.

@lex99

Sorry, I missed this last step.

KNXD is now working.  I can read & write messages on the bus via groupswrite.  Perfect !
Linknx can access the bus via KNXD.  Perfect !

But I still have the same problem with FHEM: read-only !  TUL won't write on the bus.

I now have these routes:

pi@PiMaster15 /opt/fhem $ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.19.3.1      0.0.0.0         UG        0 0          0 eth0
0.0.0.0         172.19.3.1      0.0.0.0         UG        0 0          0 eth0
172.19.3.0      0.0.0.0         255.255.255.0   U         0 0          0 eth0


At the moment, knxd runs with these arguments:
/usr/bin/knxd -e 15.15.241 -u /tmp/eib -b ipt:172.19.3.50

I have tried the earlier proposed arguments in this thread, but they won't work.

I have attached the fhem.cgf and the fhem log (verbose is set to 5).

I have Berryboot on this Pi (so that my storage is mapped onto an iSCSI target and not on the SD card).  I don't know whether this matters.

pi@PiMaster15 /opt/fhem $ more /etc/network/interfaces
# Static network configuration handled by Berryboot
iface eth0 inet manual

auto lo
iface lo inet loopback


Thanks !

Andi291

Good morning!

I do not think, it has any effect, but please try placing the TUL Statement at the beginning of the file (after the WEB-part, before the device part). Replacing the IP with localhost works as well:

define tul TUL eibd:localhost 15.15.222

Again, I would recommend you to use the following arguments to start the KNXD (...because they work for me :-)):

knxd -e 1.1.241 -c -DTS -i -u --daemon=$home/log/eibd.log --pid-file=/var/run/eibd.pid ip:224.0.23.12

The routes seem to be ok. At least I have no further routes as well.

BUT...your main Problem are the device definitions - RTFM  :P

Example:

Garbage:
define 0_CuisineEvier EIB 010f 01db
Should be (please replace DPT1 with the correct Datapoint-type):
define 0_CuisineEvier EIB 010f 01db
attr 0_CuisineEvier IODev tul
attr 0_CuisineEvier model dpt1


All this Information is written in the logs as warning! Please use the logfile in the future for failure Analysis!

regards, Andi

@lex99

Zitat von: Andi291 am 25 November 2015, 08:40:31
I do not think, it has any effect, but please try placing the TUL Statement at the beginning of the file (after the WEB-part, before the device part). Replacing the IP with localhost works as well:

define tul TUL eibd:localhost 15.15.222

Crazy.  This worked ! (I did not change anything else)
So the problem arose when I changed the TUL from one server to the other, I deleted the TUL and recreated it (from the webinterface) with another IP, the system wrote the new TUL config at the end of the fhem.cfg file.  And that is what messed up everything (probably a suggestion for improvement here  ::) )

Zitat
BUT...your main Problem are the device definitions - RTFM  :P

Example:

Garbage:
define 0_CuisineEvier EIB 010f 01db
Should be (please replace DPT1 with the correct Datapoint-type):
define 0_CuisineEvier EIB 010f 01db
attr 0_CuisineEvier IODev tul
attr 0_CuisineEvier model dpt1


All this Information is written in the logs as warning! Please use the logfile in the future for failure Analysis!

I have never edited the fhem.cfg file myself.  All this has been done by the webinterface, and a lot of errors have appeared when I updated fhem a few weeks ago (just after my TUL communication problem appeared).

Anyway, now that it works I'll have a look at all this.

THANKS AGAIN !

Andi291

You are welcome!

Would you mind closing the thread?