Re: problem with lirc over network under Ubuntu 18.04
André Weidemann <Andre.Weidemann-S0/[email protected]> Sun, 30 Dec 2018 16:02:14 +0100
| Newsgroups | gmane.comp.hardware.lirc |
|---|---|
| Message-ID | <[email protected]> |
On 29.12.2018 17:02, Alec Leamas wrote:
> Are you able to rebuild the debian 0.10.1-3 source package on your
> ubuntu machine and check?
I downloaded lirc_0.10.1.orig.tar.gz and lirc_0.10.1-3.debian.tar.xz
from here https://packages.debian.org/sid/lirc
I unpacked both in one directory. I then did the following:
cd lirc-0.10.1
patch -p1 <
../debian/patches/0001-lirc.org-Remove-non-free-advertising.patch
patch -p1 <
../debian/patches/0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch
./autogen.sh
This failed with : libtoolize: putting auxiliary files in '../..'.
libtoolize: copying file '../../ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:44: installing './config.guess'
configure.ac:44: installing './config.sub'
configure.ac:11: installing './install-sh'
configure.ac:44: error: required file './ltmain.sh' not found
configure.ac:11: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: automake failed with exit status: 1
I then did a simple:
autoreconf -i -f
which ran without errors:
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:19: installing './compile'
configure.ac:11: installing './missing'
Makefile.am: installing './depcomp'
after running:
make -j 12
daemons/lircd -c 192.168.3.125 --nodaemon -U ./plugins/.libs/
I ended up with a similar output as before:
lircd-0.10.1[22178]: Info: lircd: Opening log, level: Info
lircd-0.10.1[22178]: Warning: Running as root
lircd-0.10.1[22178]: could not open config file
'/usr/local/etc/lirc/lircd.conf': No such file or directory
lircd-0.10.1[22178]: Notice: lircd(devinput) ready, using
/var/run/lirc/lircd
lircd-0.10.1[22178]: Name lookup failure connecting to 192.168.3.125V:
Success
lircd-0.10.1[22178]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.10.1[22178]: Info: initializing 'auto'
lircd-0.10.1[22178]: Notice: No input device available for devinput
driver. Consider stopping lircd.socket or reconfigure lirc
lircd-0.10.1[22178]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22178]: Warning: Failed to initialize hardware
lircd-0.10.1[22178]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22178]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22178]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22178]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22178]: Name lookup failure connecting to 192.168.3.125V:
Success
starting:
tools/irw /var/run/lirc/lircd
again did not produce any output.
I was about to give up when I decided to take a short look into the
source of daemons/lircd.cpp.
At line 850 it reads:
if (r != 0) {
log_perror_err("Name lookup failure connecting to %s",
peer->host);
goto errexit;
}
According to this line "peer->host" must contain "192.168.3.125V" Which
could explain the lookup failure.
I dug a bit more and might have found a fix...
Applying below patch lets lircd connect to the remote host:
--- daemons/lircd.cpp.org 2018-12-30 15:44:13.879049870 +0100
+++ daemons/lircd.cpp 2018-12-30 15:44:35.206522371 +0100
@@ -790,7 +790,7 @@
struct servent* service;
char server[strlen(server_arg) + 1];
- strncpy(server, server_arg, sizeof(server) - 1);
+ strncpy(server, server_arg, sizeof(server));
if (peern < MAX_PEERS) {
peers[peern] = (struct peer_connection*) malloc(sizeof(
The output then reads (note the "...Connected to..." line):
daemons/lircd -c 192.168.3.125 --nodaemon -U ./plugins/.libs/
lircd-0.10.1[22277]: Info: lircd: Opening log, level: Info
lircd-0.10.1[22277]: Warning: Running as root
lircd-0.10.1[22277]: could not open config file
'/usr/local/etc/lirc/lircd.conf': No such file or directory
lircd-0.10.1[22277]: Notice: lircd(devinput) ready, using
/var/run/lirc/lircd
lircd-0.10.1[22277]: Notice: Connected to 192.168.3.125
lircd-0.10.1[22277]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.10.1[22277]: Info: initializing 'auto'
lircd-0.10.1[22277]: Notice: No input device available for devinput
driver. Consider stopping lircd.socket or reconfigure lirc
lircd-0.10.1[22277]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22277]: Warning: Failed to initialize hardware
lircd-0.10.1[22277]: Error: No /sys/class/rc/ devices found
lircd-0.10.1[22277]: Error: No /sys/class/rc/ devices found
Running:
tools/irw /var/run/lirc/lircd
no results in:
000000037ff07bdd 00 ok /etc/lirc/lircd.conf
000000037ff07bdd 01 ok /etc/lirc/lircd.conf
after pressing the "ok" button on the remote.
I don't quite understand the puls and minus length calculations of the
server variable. Is it because strings are usually zero-terminated?
Removing "- 1" from strncpy made it work. It is up to you to judge if it
is a real fix.
What I was unable to fix, are the error and warning messages for missing
hardware, while it is in network mode... It would be very nice if they
can be turned off.
Kind regards
André
smime.p7s
(application/pkcs7-signature, 3.9 KB) - not displayed