Update LIRC 0.9.4b (IRToy/Girs/FTDI)


HelenF

Very Active Member
Joined
Jun 22, 2013
Messages
615
Location
UK
http://repo.openpandora.org/?page=detail&app=lirc.hf&dp=true

LIRC 0.9.4b, for use with the USB raw IR devices.

IRToy

http://dangerousprototypes.com/docs/USB_Infrared_Toy
Need to flash it with the v22 firmware before starting.

Girs

http://www.harctoolbox.org/arduino_nano.html
Build the firmware from source with the Arduino IDE:
https://github.com/bengtmartensson/AGirs/

It works for me with an Arduino Uno, or a clone Nano (CH340 type) as described in the linked article. My old Nano (FTDI type) and SparkFun Pro Micro don't work.

FTDI

http://www.huitsing.nl/irftdi/
The FT232R's bitbang mode works for receiving but isn't really accurate enough for sending - it can control some appliances but not others.

http://www.lirc.org/html/ftdix.html
0.9.4a includes the send-only "ftdix" driver, for FT230X chips. I don't currently have one of these to test with.

lircd setup

This is all meant to run as a normal user (not root). I made sure to test the PND on my other Pandora which has FAT32 SD cards and an almost fresh install, but if I've changed anything and forgotten I guess we'll find out...

Launching the app opens a terminal window. On the first run, the config files appear in appdata/lirc.hf .

lirc-setup does not work - even if I could figure it out, I would have to package python3, which seems excessive. It's not very hard to edit the config files.

First edit lirc_options.conf - it's set up for the IRToy, with commented-out groups of lines for Girs and FTDI.

Connect your device - the IRToy uses more than 100mA so needs to go on the main USB port with a hub. The other two might use less than 100mA depending on your circuit, so you can put them on the OTG port if you're sure about that. On the main USB port, they all need a hub. If at any point the device doesn't work, try unplugging and replugging the USB.

Run mode2 from the terminal window and fire a remote at the device. Numbers should appear.

Once it works on mode2, you need one or more remotes. Download from http://lirc-remotes.sourceforge.net/ if they have what you need, otherwise try to make one with irrecord (it gives interactive instructions). Put the file in the etc/lirc/lircd.conf.d folder in the appdata. Now run lircd in the terminal window.

The other programs communicate with lircd. I suggest leaving lircd open in a background window, and launching the app again to open a second window for the other programs. Alternatively, edit lirc_options.conf to add a log file, and set nodaemon=False or launch with "lircd &".

Run irw and fire a previously-configured remote at the device. If everything is working, it should print the names and codes of the buttons that are being pressed.

The irsend program can transmit signals. I'm working on a Pandora-friendly app for this.

The lircd socket is in /tmp/lircd . This works with no setup required. You can change it in lirc_options.conf but will then have to specify it for the other LIRC programs.

Kodi

http://kodi.wiki/view/Lirc
Create remote.xml and Lircmap.xml as described and put them in appdata/xbmc/.kodi/userdata .
Now we need to change the lircd socket. Kodi's default is /dev/lircd which would be wrong even for a normal LIRC install.
Copy scripts/xbmc.sh from the PND to the equivalent place in the appdata (can copy from /mnt/utmp/xbmc/scripts/xbmc.sh when the PND is mounted).
It has two places where it says
Code:
lib/kodi/kodi.bin $*
so let's make that
Code:
lib/kodi/kodi.bin --lircdev /tmp/lircd $*
(Maybe there's a better way to do this?)

More apps to figure out later...
 
Last edited:
As far as I've noticed, mplayer tries to connect to lircd whenever you use it to play a file or playlist, so presumably people could set up lircd, then run mplayer and control it using their remote.
 
Very nice. This reminds me, I need to figure out running SUMP on the Pandora. IR Logic Analyzer would be a lot of fun. Plus I just got all parts in to build a BeagleLogic BeagleBone Black based Logic Analyzer that also uses SUMP.
 
I'm using an Arduino Uno. The author uses a clone Nano (CH430 CH340 type) - I have ordered one of those and will report whether it works with the Pandora when it arrives. My old Nano (FTDI type) and SparkFun Pro Micro don't work.

The CH340 Nano is fine. It's cheaper than an Uno, and a much better size for this :)
 
Updated from early in the 0.9.4 development branch to the 0.9.4a release version.

Probably the main difference is that the FTDIX driver was completed, for use with FT230X chips. I don't currently have one of these to test with, so if any of you have one, please let me know if it works.
http://www.lirc.org/html/ftdix.html
 
Last edited:
Updated to approximately 0.9.4b - this is a bug-fix update.
 
Back
Top