Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Unable to initialise lirc #11

Closed
mosesmc52 opened this issue Jul 6, 2016 · 8 comments
Closed

Unable to initialise lirc #11

mosesmc52 opened this issue Jul 6, 2016 · 8 comments

Comments

@mosesmc52
Copy link

Hi,

I installed lirc on raspberry pie using the instructions from the readme page. lirc is not initializing. I get this error. Would you have any idea why this would be occurring?

Traceback (most recent call last):
File "", line 1, in
File "lirc.pyx", line 122, in lirc.init (lirc/lirc.c:1286)
lirc.InitError: Unable to initialise lirc (socket was -1 from C library).

@michaelarnauts
Copy link

Check if lirc is running. You can try irw to see if you get events there.

@nolton
Copy link

nolton commented Jul 15, 2016

Hola, yo tengo el mismo problema. cuando pruebo con irw este funciona correctamente.

@cadavre
Copy link

cadavre commented Nov 17, 2016

@nolton haven't you notices everyone here writes in ENGLISH, dude? <_<

+1

@nolton
Copy link

nolton commented Nov 21, 2016

@cadavre Lamento que debas esforzarte un poco más para leer lo que escribo, Amigo.

@lgcproductions
Copy link

Got the same issue as well. :(

@tompreston
Copy link
Owner

Try calling with verbose=True, like this:

lirc.init('myprog', verbose=True)

Also, can you show me the code where you call lirc.init() and your lirc config files: ~/.config/lircrc and /etc/lirc/lircrc

@ghost
Copy link

ghost commented Apr 24, 2018

Any further details on this? I'm having the same issue. I've taken these steps on a Raspberry Pi:

  1. sudo apt-get install lirc liblircclient-dev

  2. Add these lines to /etc/modules? Didn't work?
    lirc_dev
    lirc_rpi gpio_in_pin=14 gpio_out_pin=15

  3. Modify this line in /boot/config.txt:
    dtoverlay=lirc-rpi,gpio_in_pin=14

  4. Modify /etc/lirc/hardware.conf:
    LIRCD_ARGS=”–uinput –listen”
    DRIVER=”default”
    DEVICE=”/dev/lirc0″
    MODULES=”lirc_rpi”

  5. Stop lirc:
    sudo /etc/init.d/lirc stop

  6. Downloaded lircrd.conf from https://gist.github.com/pda/8252117 and place it in
    /etc/lirc/lircd.conf (for the Apple aluminum remote)

  7. Edit ~/lircrc to have the following contents:

begin
prog = myprogram
button = KEY_DOWN
config = KEY_DOWN
end

begin
prog = myprogram
button = KEY_UP
config = KEY_UP
end

begin
prog = myprogram
button = KEY_ENTER
config = KEY_ENTER
end

begin
prog = myprogram
button = KEY_RIGHT
config = KEY_RIGHT
end

begin
prog = myprogram
button = KEY_LEFT
config = KEY_LEFT
end

begin
prog = myprogram
button = KEY_MENU
config = KEY_MENU
end

begin
prog = myprogram
button = KEY_PLAYPAUSE
config = KEY_PLAYPAUSE
end

  1. Start lirc:
    sudo /etc/init.d/lirc start

  2. sudo pip install python-lirc

  3. In python running from home directory:
    import lirc
    sockid = lirc.init("myprogram", "lircrc")

This gives the error
lirc.InitError: Unable to initialise lirc (socket was -1 from C library).

I should add that I do see some blips of data piped out when I push buttons on the remote while running this command:
mode2 -d /dev/lirc0
So, I'm fairly certain that the hardware and remote are set up correctly.

@tompreston
Copy link
Owner

Since there's been no update from the issue creator I'm going to close this.

See also #28 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants