NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me

TOPIC: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #46

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Great, you know, killall -9 xbmc.bin helps me, xbmc restarts and remote work, after manual restarting of the script, after that i make full restart (reboot) and all works fine....
here cat from my autostart.sh for Katch:

put it without any special forum formating

root ~ # cat /storage/.config/autostart.sh
#!/bin/sh
(killall lircd; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&


My recomendations, make all editing in vi (check man for commands, it's help me, remove all extraspaces and empty strings)
Last Edit: 5 years 1 week ago by DmitrySh.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #47

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
some details could be helpful
ls -al /dev/lirc* and ls -Ral /var/run/lirc/
if irw shows keypresses from remote try to killall -9 xbmc.bin
Raspberry Pi Rev2 512MB
CuBox-i4Pro
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #48

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
roadkill wrote:
some details could be helpful
ls -al /dev/lirc* and ls -Ral /var/run/lirc/
if irw shows keypresses from remote try to killall -9 xbmc.bin

I've never managed to get output from IRW yet. I can get mode2 /dev/lirc0 output however.

This is after a fresh reboot
root ~ # ls -Ral /var/run/lirc/
/var/run/lirc/:
total 4
drwxr-xr-x    2 root     root             0 Jan  1  1970 .
drwxrwxrwt   10 root     root             0 Nov  6 21:02 ..
srw-rw-rw-    1 root     root             0 Jan  1  1970 lircd
srw-rw-rw-    1 root     root             0 Jan  1  1970 lircd-lirc0
-rw-r--r--    1 root     root             5 Jan  1  1970 lircd.pid
root ~ # ls -al /dev/lirc*
crw-------    1 root     root      251,   0 Jan  1  1970 /dev/lirc0
root ~ #

i currently get this;
root ~/.config # ./autostart.sh
root ~/.config # ./autostart.sh: line 4: --pidfile=/var/run/lirc/lircd-lirc0.pid: No such file or directory

if i manually execute ./autostart.sh after reboot

Cat log of autostart.sh

root ~/.config # cat /storage/.config/autostart.sh
#!/bin/sh
(killall lircd; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd
--pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&
root ~/.config #
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #49

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
roadkill: you know, it's looks that something missing or corrupted in new build r12369, couse after update (just copy 4 files in update folder) autostart.sh don't load automatically. Doublecheked this, downgrade to 12350 and all works there without any intrusions. After this upgrades again to 12369 and don't work again.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #50

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
I'm using the r12369 pre-built from the 1st post.
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #51

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Katch wrote:
i currently get this;
root ~/.config # ./autostart.sh
root ~/.config # ./autostart.sh: line 4: --pidfile=/var/run/lirc/lircd-lirc0.pid: No such file or directory

if i manually execute ./autostart.sh after reboot

Cat log of autostart.sh

root ~/.config # cat /storage/.config/autostart.sh
#!/bin/sh
(killall lircd; \
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd
--pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf; \
)&
root ~/.config #
it's looks like u have carridge return after ...--output=/var/run/lirc/lircd
chek it in vi editor
if you give command (all in one string without enters)
/usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput --output=/var/run/lirc/lircd --pidfile=/var/run/lirc/lircd-lirc0.pid /storage/.config/lircd.conf
what happend?
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #52

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
just starting again from scratch with the r12350 build
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #53

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Ok getting closer - finally got it working but it won't start up on boot.

I've installed the r12350

On a fresh boot the remote isn't working.

ssh in and manually run ./autostart.sh

returns

killall: lircd: no process killed

and waits for me to press return to go back to prompt.

./autostart.sh a second time and all is well

irw now returns keypresses

after;

killall -9 xbmc.bin

xbmc is now controlled by my remote.

Any idea how to get the autostart.sh working so the remote works when booted without needing to ssh in and mess around?

EDIT

Here's a pastebin of my autostart.sh

sprunge.us/AMRL

you can do your own pastebin by using this command

cat /storage/.config/autostart.sh | pastebinit

this way we can avoid any more formatting errors.
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #54

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Wait for few minutes after boot, in my case i need some time for remote start working, after reboot you can check if the proces is in process list "ps -efa | grep lirc" if this long string is present there so you need some time to wait (in my case). Hope this helps
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #55

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Nope - each time I turn on the Pi I have to ssh in and manually run ./autostart.sh twice.

first time reports

killall: lircd: no process killed

and waits for me to hit enter (irw not working at this point)

second time completes fine and irw starts working

killall -9 xbmc.bin now needed to gain control.

Still trying to work out how to get it to start successfully at first boot.

EDIT

More observations.

Sometimes when I manually run ./autostart.sh it works 1st time sometimes it stalls at killall: lircd: no process killed. It stalls more often than not.

On very very rare occasions the remote works at first boot (I've had it work twice) the rest of the times I need to ssh in and manually run the autostart.sh...

strange.
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #56

  • roadkill
  • roadkill's Avatar
  • Offline
  • Senior Boarder
  • Posts: 120
  • Thank you received: 13
  • Karma: 5
probably you have a stale pid file you simply need to remove it
I used that build and it worked perfectly for me
Raspberry Pi Rev2 512MB
CuBox-i4Pro
Last Edit: 5 years 1 week ago by roadkill.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #57

  • DmitrySh
  • DmitrySh's Avatar
  • Offline
  • Junior Boarder
  • Posts: 65
  • Thank you received: 2
  • Karma: 0
Good idea, will check this at evening. If this confirms, that means that this process doesn't closes correctly if i send reboot command (don't remove pid file)?
Mayby some another metod exists to start and stop this? init.d? or something more traditional for RasPi (sorry i don't know this OS so deeply).
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #58

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
roadkill wrote:
probably you have a stale pid file you simply need to remove it
I used that build and it worked perfectly for me

Agree with the post above - maybe there is something wrong with the way openelec is cleaning up. How do you shut down your Pi when done?

I thought this might be the issue and did some testing but couldn't find any causality. In fact using the XBMC reboot or exit commands both resulted in needing to manually start autostart.sh the next time and one of the occasions it worked straight off the bat was after I'd accidentally pulled the plug while xbmc was streaming.

Could we just add;
rm /var/run/lirc/*.pid; \

somewhere in the autostart.sh to make sure any old pid files are removed before restarting lircd?

EDIT

Ok just fired up my Pi - remote not working - this is in an untouched state right now

this is the contents of /var/run/lirc
root ~ # ls /var/run/lirc
lircd        lircd-lirc0

no pid files.

I issued a reboot via ssh and the next boot remote is working...

3 more rounds of reboot - same /var/run/lirc contents and not working...
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #59

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
FIXED IT!

Ok as I suggested above;

add
(rm /var/run/lirc/*.pid; \

don't forget to remove the ( from the kill all line below so it reads
#!/bin/sh
(rm /var/run/lirc/*.pid; \
killall lircd; \
/usr/sbin/lircd --driver=default ......... long command make sure its all on one line
)&

works every single time now
Last Edit: 5 years 1 week ago by Katch.
The administrator has disabled public write access.

Re: Raspberry Pi GPIO IR Receiver with OpenELEC compilation patches and snapshot 5 years 1 week ago #60

  • Katch
  • Katch's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
I'm going to try the newer build again and then write a quick step by step guide.
The administrator has disabled public write access.