[LINUX] Lirc and Apple Remote long press hack
#16
Also note, that if you are using a non-apple system (macbook pro, etc.) you will need to buy an apple IR reciever (from a macbook pro) and solider in a usb cable.

I just loaded up xbmcbuntu and was thinking i'd try this out but just found out you cant used a standard serial IR receiver. Looks like i'm off to ebay searching~
Reply
#17
How can i start xbmcbuntu (live) with the parameter -l /var/run/lirc/lircmangled
the http://teknogeekz.com/blog/?p=422 dosn´t work with the spare part 820-1947 (05ac:8240) but it does work with 820-2155 (05ac:8242)
Reply
#18
I've tryed to set this up on a RaspBMC. I even went as far as to learn how to edit a service script to start/stop, but can't seem to make the silver remote have the long press.

Changed the startup script for XMBC by changing the /scripts/xmbc-watchdog.sh.
Where there was:
Code:
su - pi -c "export XBMC_HOME=$(readlink /home/pi/.xbmc-current)'/xbmc-bin/share/xbmc' ; LD_PRELOAD=/usr/lib/libcofi_rpi.so /home/pi
/.xbmc-current/xbmc-bin/lib/xbmc/xbmc.bin --standalone -fs --lircdev /var/run/lirc/lircd 2>&1 | logger -t xbmc"
I wrote:
Code:
su - pi -c "export XBMC_HOME=$(readlink /home/pi/.xbmc-current)'/xbmc-bin/share/xbmc' ; LD_PRELOAD=/usr/lib/libcofi_rpi.so /home/pi/.xbmc-current/xbmc-bin/lib/xbmc/xbmc.bin --standalone -fs --lircdev /var/run/lirc/lircmangled 2>&1 | logger -t xbmc"
XBMC actually starts, but i have to run the phyton script manualy for it to create the lircmangled at /var/run/lirc/. After all this, althoug irw shows the signals from the IR comand, XBMC doesn't. I would love to no how to check if everything is workning fine, but i don't know how to control the phyton proxy.

Any help with this would be apreciated.
Reply
#19
joiegils: I'm not sure how xbmcbuntu starts xbmc. It probably depends on which version you are running. It might be an xsession.. so maybe look in /usr/share/xsessions.. or edit the/usr/bin/xbmc-standalone if it is used?

designerferro: I dont have a RaspberryPI and have never used RaspBMC. Is it an openelec build? Perhaps ask on their forums. Last time I looked at OpenELEC it already had a daemon interpreting lircd output, and this conflicted with my python daemon. Not having a pressing need to find a solution, I gave up.
From your description it sounds a bit like you need to run lircmangled before you start xbmc. Can you add another line to start it just before you run xbmc?
maybe something like:

su - pi -c "/path/to/your/install/of/lircmangled" 2>&1 | logger -t lircmangled &

Jules
Reply
#20
Julian,

Thanks for the help. Raspbmc is Debian based as i understand it.

I am trying to run the lircmangled before XBMC starts, but for some reason it wont appear at /var/run/lirc/. Tryed changing ownership, but root take over at boot. Thought the su - pi -c was what it meant... Im not that versed at command line ninja. Smile
Reply
#21
Doing a small amount of reading, raspbmc uses upstart.. so the upstart script in my first post should work. Maybe we should go back a step.

Where did you save the lircmangled.py script?
Where did you save the upstart script? it should be in /etc/init/lircmangled.conf
If you run the stock raspbmc without any of my lircmangle additions.. what is the contents of the /var/run/lirc directory once xbmc is running?
How does raspbmc start xbmc?

Jules
Reply
#22
Actually.. reading a tiny bit further.. it looks like raspbmc uses eventlircd. I dont think my script plays very nicely with eventlircd, although it wouldn't be too hard to make them work together. sorry designerferro. This is the same issue I mentioned with OpenELEC. Unfortunately I dont really have the time (or a pressing need) to make them work together at the moment. You could always have a go yourself.

You'd need to make lircmangled sit in between lircd and eventlircd, because eventlircd does its own mangling of the lirc stream.

Jules
Reply
#23
Jules, I placed lircmangled at /usr/local/bin.

Im looking for the script that calls eventlircd to see what kind of changes it can be programmed to do for me. Smile
Reply
#24
(2013-04-23, 09:58)joiegils Wrote: How can i start xbmcbuntu (live) with the parameter -l /var/run/lirc/lircmangled
the http://teknogeekz.com/blog/?p=422 dosn´t work with the spare part 820-1947 (05ac:8240) but it does work with 820-2155 (05ac:8242)


It is also confirmed to work with the 820-2306-a
Reply
#25
Hello, this is exactly what i tried, it worked perfectly.

How could I change the code so that when I hold the button it only send one signal, instead of being sent while I holding?

That is, if you want to send two signals to keystrokes, I necessarily have to hold the key down for a while, release and press again.


If I keep holding the button only sends only one signal
Reply
#26
Hi eudesafp.
What output do you get on the raw lirc socket when you hold down a button.. and what output do you get on the mangled lirc socket when you hold down a button?
Reply
#27
(2013-11-07, 11:50)julian.neil Wrote: Hi eudesafp.
What output do you get on the raw lirc socket when you hold down a button.. and what output do you get on the mangled lirc socket when you hold down a button?

Hello Julian.neil, thanks for replying !

What i am wanting to do is the following , see eg this output when I hold down the "menu" of my remote Aple :

Code:
root@eudes-Macmini:/home# irw /var/run/lirc/lircmangled
0000000087ee0c02 00 KEY_MENU_HOLD A1156
0000000087ee0c02 01 KEY_MENU_HOLD A1156
0000000087ee0c02 02 KEY_MENU_HOLD A1156
0000000087ee0c02 03 KEY_MENU_HOLD A1156
0000000087ee0c02 04 KEY_MENU_HOLD A1156
0000000087ee0c02 05 KEY_MENU_HOLD A1156
0000000087ee0c02 00 KEY_MENU_HOLD A1156
0000000087ee0c02 01 KEY_MENU_HOLD A1156
0000000087ee0c02 02 KEY_MENU_HOLD A1156
0000000087ee0c02 03 KEY_MENU_HOLD A1156
0000000087ee0c02 04 KEY_MENU_HOLD A1156
0000000087ee0c02 05 KEY_MENU_HOLD A1156
0000000087ee0c02 06 KEY_MENU_HOLD A1156
0000000087ee0c02 07 KEY_MENU_HOLD A1156
0000000087ee0c02 08 KEY_MENU_HOLD A1156
0000000087ee0c02 09 KEY_MENU_HOLD A1156

I like it when I kept pressing the "menu" key appeared
only once " 0000000087ee0c02 KEY_MENU_HOLD A1156 00 "

I do not know if I have to change the script so I can do this by button , let's say I want the "menu" button and the "play" button , even when pressed it will only send a signal .

But the rest of the other buttons repeatedly keep sending signals .
when pressed .

If this is too complicated , I would help a lot if at least for this when held down the button , it was not repeatedly sent the signal , but only once .

Thanks again and any help is welcome !

Ps. Sorry for the bad english
Reply
#28
Ok I understand what you want. Try modifying the code to look like that below. I have added an if clause around the line "self.mangle_proxy.send(...)"
Code:
...
                        if (self.hold_repeats >= hold_repeats):
                            # if we get >= n repeats all within time t of eachother consider it a long press
                            bits[2] += '_HOLD'
                            bits[1] = "%0.2X" % (self.hold_repeats - hold_repeats)
                            if (self.hold_repeats == hold_repeats or ( 'PLAY' not in bits[2] and 'MENU' not in bits[2] )):
                                self.mangle_proxy.send(' '.join(bits) + '\n')
                            self.last_line = None
...
Reply
#29
It worked perfectly.

It was exactly what i needed, I believe that may be useful to more people.

Again, thank julian.neil.


(2013-11-11, 12:14)julian.neil Wrote: Ok I understand what you want. Try modifying the code to look like that below. I have added an if clause around the line "self.mangle_proxy.send(...)"
Code:
...
                        if (self.hold_repeats >= hold_repeats):
                            # if we get >= n repeats all within time t of eachother consider it a long press
                            bits[2] += '_HOLD'
                            bits[1] = "%0.2X" % (self.hold_repeats - hold_repeats)
                            if (self.hold_repeats == hold_repeats or ( 'PLAY' not in bits[2] and 'MENU' not in bits[2] )):
                                self.mangle_proxy.send(' '.join(bits) + '\n')
                            self.last_line = None
...
Reply
#30
No problem. It was a good suggestion. It does improve its usability when navigating menus..
I was so used to the timing of the button repeat that I automatically took my finger off when holding down play or menu to prevent repeats.
I'll edit the original post to include it.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] Lirc and Apple Remote long press hack1