LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   problem with infrared usb stick ? (https://www.linuxquestions.org/questions/linux-general-1/problem-with-infrared-usb-stick-587807/)

frenchn00b 11-12-2007 11:41 AM

Quote:

Originally Posted by zlin50 (Post 2955431)
News:

I was able to make the i/r-receiver visible to the input layer (/dev/bus/input/...) by compiling "usbkbd" into the kernel.

I'm mentioning it here, since the kernel says:
"CONFIG_USB_KBD
Say Y here only if you are absolutely sure that you don't want
to use the generic HID driver for your USB keyboard and prefer
to use the keyboard in its limited Boot Protocol mode instead.

This is almost certainly not what you want.

This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called usbkbd.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>."


Next step: trying to get the remote control running with vdr.

http://yellowprotoss.ye.funpic.org/website/lirc-rc2400/
Please give us how-to if you manage to get something working... Many thanks to Ian & Jason

srd424 11-25-2007 01:18 PM

Hi,

147a:e017 (Formosa / Snowflake) seems to be emulating the MCE remote. If you add the vendor/product id pair to the lirc_mceusb2 module source (included with lirc) and recompile, it seems to work!

[Caveat: the dongle seems to be a little buggy, running lsusb -v kills my network connection (using a USB WiFi adaptor)

Cheers,
Steve

Jadedjay 11-27-2007 06:51 AM

Quote:

Originally Posted by srd424 (Post 2970325)
Hi,

147a:e017 (Formosa / Snowflake) seems to be emulating the MCE remote. If you add the vendor/product id pair to the lirc_mceusb2 module source (included with lirc) and recompile, it seems to work!

[Caveat: the dongle seems to be a little buggy, running lsusb -v kills my network connection (using a USB WiFi adaptor)

Cheers,
Steve

Steve

What flavour of Linux are you using?

I tried the same thing a while ago after I noticed that in the lirc_mceusb2.c file the Formosa vender code was already listed.

I tried recompiling the source and then used modprobe to remove the lirc_mceusb2 module and then load the new module. However my system still didnt seem to pick the device, even after reboot.

What version of LIRC are you using? Any pointers would be welcome. (eg. modules installed, steps taken etc)

frenchn00b has developed a great driver for this device, but I would like to have lirc_mceusb2 working if possible.

Cheers

srd424 11-28-2007 02:50 AM

Quote:

Originally Posted by Jadedjay (Post 2972132)
Steve

What flavour of Linux are you using?

I tried the same thing a while ago after I noticed that in the lirc_mceusb2.c file the Formosa vender code was already listed.

I'm using Ubuntu 7.10, but I was basing my mod on the upstream lirc 0.8.2 source, which didn't include the Formosa vendor id. Looking at Ubuntu's patch, they do include it, but only list product 0xe015.

Incidentally, note that I am talking about product e017 here, not e019. It's very possible that while e017 is MCE compatible, e019 is not - different products for different markets. I (sometimes) got some output out of the modified e019 drivers, but the data didn't seem to be usable, or analyzable by irrecord.

Quote:

Originally Posted by Jadedjay (Post 2972132)
I tried recompiling the source and then used modprobe to remove the lirc_mceusb2 module and then load the new module. However my system still didnt seem to pick the device, even after reboot.

What version of LIRC are you using? Any pointers would be welcome. (eg. modules installed, steps taken etc)

Did you move the new module into /lib/modules, or try to load it from your build directory? modprobe always looks in /lib/modules, I think, if you want to pass a filename, use insmod. You should get a kernel message along the lines of:

Code:

lirc_mceusb2[2]: Formosa21 SnowflakeEmulation on usb1:2
Incidentally, mceusb2 does some init work (device reset + config), without which e017 doesn't seem to reliably be able to send data (it seems like rather a cheap device, lsusb -v makes it hang and take out other devices on the USB bus!)

HTH,
Steve

srd424 11-28-2007 03:13 AM

Incidentally, I think there's possibly a problem if there's a long delay between the device being plugged in (or the PC switched on) and the module being loaded. I've noticed that if I wait for the GRUB menu to timeout, rather than selecting a kernel by hand, then the module doesn't always find the device until I unplug it and replug it; maybe moving the module into the initrd might help? I'll do some experiments soon and report my findings.

Steve

frenchn00b 11-28-2007 12:27 PM

Interesting information:
The 147a:e017 USB stick may be a problem if it locks up.
If you see the red LED permanently switched on, without any actions of the remote control, your lirc stick is locked.
the only way is the unplug & replug it ,then you have 3-4 sec to start the drivers, otherwise it'll lock.
That's what we noticed.

srd424 11-29-2007 02:23 AM

Quote:

Originally Posted by frenchn00b (Post 2973569)
Interesting information:
The 147a:e017 USB stick may be a problem if it locks up.
If you see the red LED permanently switched on, without any actions of the remote control, your lirc stick is locked.
the only way is the unplug & replug it ,then you have 3-4 sec to start the drivers, otherwise it'll lock.
That's what we noticed.

Interesting, my boot sequence is definitely longer than that, and most of the time it's OK. I wonder if it depends in part on what else is using the USB bus? I've got a Wifi USB dongle, but I imagine the LIRC driver gets loaded before the network is bought up. As I said before, doing lsusb -v with the Formosa stick plugged in nukes the wireless connection, which is a little worrying.

Steve

Jadedjay 11-29-2007 06:23 AM

Hey guys unless I am mistaken it appears that someone else has also been working on this problem.

I went to download the lastest version of lirc_mceusb2.c and update it, only to findout that someone else has submitted the same codes.
Edit: To state more clearly, 147a:e017 is now defined.

Have a look here
http://lirc.cvs.sourceforge.net/lirc.../lirc_mceusb2/

Now if only I can get it working.
So far I can

install kernel headers
download lirc-0.8.2 and untar in /usr/src/
copy latest lirc_mceusb2.c to /usr/src/lirc-0.8.2/drivers/lirc_mceusb2/
build the lirc_mceusb2 module (i.e. config, make, make install)
copy it to /lib/modules/2.6.22-14-generic/misc/
sudo /etc/init.d/lirc stop
modprobe -r lirc_mceusb2
modprobe lirc_mceusb2
Unplug and replug the receiver

Its mapped as a device

P: Vendor=147a ProdID=e017 Rev= 1.10
S: Manufacturer=Formosa21
S: Product=SnowflakeEmulation
S: SerialNumber=B0011517
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=lirc_mceusb2

/dev/lirc0 is also created.

Great!! So far so good!

Config /etc/lirc/hardware.conf

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER=""
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
DEVICE="/dev/lirc0"
MODULES="lirc_mceusb2"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""

Restart lirc
sudo /etc/init.d/lirc start

Run irw

Press a few buttons, but get nothing.

Try irrecord -d /dev/lirc0 test.conf
no luck.

Any ideas where Im going wrong???

srd424 11-30-2007 02:50 AM

Quote:

Originally Posted by Jadedjay (Post 2974336)
Hey guys unless I am mistaken it appears that someone else has also been working on this problem.

I went to download the lastest version of lirc_mceusb2.c and update it, only to findout that someone else has submitted the same codes.
Edit: To state more clearly, 147a:e017 is now defined.

That was me - I sent the author a (very small) patch ;-)

Quote:

Its mapped as a device

P: Vendor=147a ProdID=e017 Rev= 1.10
S: Manufacturer=Formosa21
S: Product=SnowflakeEmulation
S: SerialNumber=B0011517
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=lirc_mceusb2


/dev/lirc0 is also created.

Great!! So far so good!

Config /etc/lirc/hardware.conf
There's a default config file the MCE devices, at least with the Ubuntu version. I've got:

Code:

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Windows Media Center Remotes (new version Philips et al.)"

# Arguments which will be used when launching lircd
LIRCD_ARGS=""

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER=""
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
DEVICE=""
MODULES="lirc_dev lirc_mceusb2"

# Default configuration files for your hardware if any
LIRCD_CONF="mceusb/lircd.conf.mceusb"
LIRCMD_CONF=""

You could try:

Code:

sudo dpkg-reconfigure lirc
(Again, only for a Debian-based distro. On Ubuntu, this lets you pick the receiver type from a menu.)

Quote:

Press a few buttons, but get nothing.

Try irrecord -d /dev/lirc0 test.conf
no luck.

Any ideas where Im going wrong???
With the right config file, you shouldn't need to use irrecord, irw will print processed events from lircd instead. Is the light on your receiver flashing when you press buttons?

Steve

srd424 11-30-2007 02:57 AM

Quote:

Originally Posted by Jadedjay (Post 2974336)
modprobe -r lirc_mceusb2
modprobe lirc_mceusb2
Unplug and replug the receiver

The sequence that usually works for me is:

1. rmmod module
2. unplug receiver
3. plug in receiver (light usually flashes then stays on)
4. insert module (fairly quickly: light hopefully goes out)

But funnily enough, I just tried it and it didn't work the first couple of times. I think the device's USB support is a bit flakey, a problem well below the level that the driver operates at, sadly. I'm going to experiment and see whether having other devices on the bus is the problem, or whether there's a delay needed between disconnection and reconnection, or something like that.

Steve

Jadedjay 11-30-2007 02:49 PM

[QUOTE]That was me - I sent the author a (very small) patch ;-)

That would make sense.

Jadedjay 12-01-2007 08:11 AM

Some more experiments

Using the lirc_mceusb2 module/code.
Ive copied the lirc_mceusb2 code into the modules library. /lib/modules/2.6.22-14-generic/misc/ (for Kubuntu Gutsy 7.10)

The device is not plugged in.
$ sudo rmmod lirc_mceusb2
$ sudo rmmod lirc_mceusb2
ERROR: Module lirc_mceusb2 does not exist in /proc/modules
Plug the device in. No light comes on the device.
$ sudo rmmod lirc_mceusb2
$ sudo modprobe lirc_mceusb2
$ irw
000000037ff07bf2 00 Home mceusb (returned from a remote control press)

Then the device freezes with no light on.
Tried this process several timesm as its easily repeated, and this happens for any of the buttons pressed on the remote.

For a test I changed the vender id and usb_device id in the lirc_mceusb module to see if that module works better.
Following the above process I received exactly the same results.

Side note: So far Frenchnoob, your driver works much better. However it is still difficult to stop your driver from locking on Kubuntu reboot.

murisfurder 01-23-2008 11:05 AM

So has anyone actually gotten this remote to work with ubuntu gutsy?

So far I've gotten the dongle to work to the point that it flashes on and off with i press any buttons on it, but other than that I haven't been able to use it with mythtv.

If someone could write a "getting this thing to work" guide that would be great.

So far i see several methods proposed in this thread and to be honest I'm confused which driver or userspace application I'm supposed to install

srd424 01-24-2008 04:04 AM

We're still talking about 147a:e017 ? The initialization is still flaky for me, but once I've got it initialized, it works fine (using a version of lirc_mceusb2 that recognizes the device ID.) Plugging the dongle in after boot seems to be more reliable (lircd adds a udev rule to automatically insert the module and run lircd on insertion.)

Steve

Jadedjay 01-24-2008 06:00 AM

Quote:

Originally Posted by srd424 (Post 3033529)
We're still talking about 147a:e017 ? The initialization is still flaky for me, but once I've got it initialized, it works fine (using a version of lirc_mceusb2 that recognizes the device ID.) Plugging the dongle in after boot seems to be more reliable (lircd adds a udev rule to automatically insert the module and run lircd on insertion.)

Steve

Yes, I still havent got a full working solution yet either. I can get it working if I manually load the remote everytime I boot. Not really what I want to be doing. And before anyone asks, scripting the same commands I used, didnt always work. So still stuck on manual.

Quote:

Originally Posted by murisfurder (Post 3032709)
If someone could write a "getting this thing to work" guide that would be great.
install

I just built a new computer and are in the process of setting up the remote "right now". If I make any new discoveries Ill share them, and glady write a how-to. That is when I know How-to. :)

Quote:

Originally Posted by murisfurder (Post 3032709)
So far I've gotten the dongle to work to the point that it flashes on and off with i press any buttons on it, but other than that I haven't been able to use it with mythtv.

What did you do to get to that point? My dongle in off until I press something on the remote and the light locks up


All times are GMT -5. The time now is 10:37 AM.