remote control problem: no /dev/lirc0

rusane
Posts: 7
Joined: Sun Nov 08, 2009 10:18 am

remote control problem: no /dev/lirc0

Post by rusane »

Hello, I have Fit-PC2 1.6Ghz with bios version 23-Dec-2009.
I believe it is rev 1.21 as serial number starts with 091XXX-XXX.

I've followed fly's thread (http://www.fit-pc2.com/forum/viewtopic.php?f=58&t=1819) to install my 10.04 LTS 32bit and successfully configured video settings.

My problem right now is, that I couldn't use my remote controller.
I followed http://fit-pc2.com/wiki/index.php?title ... _in_Ubuntu and configured settings.
However, even after rebooting several times, I can only see /dev/lircd which is sym-linked to /var/run/lirc/lircd, but not /dev/lirc0 or /dev/lirc/0.

Code: Select all

# ls -al /dev/lirc*
lrwxrwxrwx 1 root root 19 2010-11-14 13:02 /dev/lircd -> /var/run/lirc/lircd
This is my hardware.conf:

Code: Select all

REMOTE="Igor Cesko's USB IR Receiver"
REMOTE_MODULES="lirc_dev lirc_igorplugusb"
REMOTE_DRIVER="default"
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""
START_LIRCD="true"
START_LIRCMD=""
LOAD_MODULES="true"
LIRCMD_CONF=""
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
And modules:

Code: Select all

# lsmod|grep lirc
lirc_igorplugusb        3838  0 
lirc_dev                8890  1 lirc_igorplugusb
And dmesg:

Code: Select all

# dmesg|grep lirc
[   13.443251] lirc_dev: IR Remote Control driver registered, major 61 
[   13.463536] lirc_igorplugusb: USB remote driver for LIRC v0.2
[   13.463546] lirc_igorplugusb: Jan M. Hochstein <hochstein@algo.informatik.tu-darmstadt.de>
[   13.463632] usbcore: registered new interface driver lirc_igorplugusb
If I do lsusb, I don't see any iR-receiver-related hardware. Is it normal?

Code: Select all

# lsusb
Bus 004 Device 002: ID 046d:c01d Logitech, Inc. MX510 Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046a:0021 Cherry GmbH 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
When I run irw, /var/log/daemons.log shows the following:

Code: Select all

Nov 14 13:13:46 sayyeah-net-mini lircd-0.8.6[927]: accepted new client on /var/run/lirc/lircd
Nov 14 13:13:46 sayyeah-net-mini lircd-0.8.6[927]: could not get file information for /dev/lirc0
Nov 14 13:13:46 sayyeah-net-mini lircd-0.8.6[927]: default_init(): No such file or directory
Nov 14 13:13:46 sayyeah-net-mini lircd-0.8.6[927]: Failed to initialize hardware
It doesn't work even if I manually make the node, i.e. "mknod /dev/lirc0 c 61 0":

Code: Select all

Nov 14 13:17:29 sayyeah-net-mini lircd-0.8.6[1741]: accepted new client on /var/run/lirc/lircd
Nov 14 13:17:29 sayyeah-net-mini lircd-0.8.6[1741]: could not open /dev/lirc0
Nov 14 13:17:29 sayyeah-net-mini lircd-0.8.6[1741]: default_init(): No such device
Nov 14 13:17:29 sayyeah-net-mini lircd-0.8.6[1741]: Failed to initialize hardware
Any ideas? Any advice would be greatly appreciated.
Last edited by rusane on Thu Dec 30, 2010 11:31 am, edited 1 time in total.

Denis
Posts: 301
Joined: Sun Apr 26, 2009 3:24 pm

Re: remote control problem: no /dev/lirc0

Post by Denis »

Try to install Ubuntu 9.10, it`s latest version Compulab supports officially. We applied some patches to lirc_igorplugusb module.
Compulab's Linux support

rusane
Posts: 7
Joined: Sun Nov 08, 2009 10:18 am

Re: remote control problem: no /dev/lirc0

Post by rusane »

@denis :
Is the module in Compulab's 9.10 very different from the generic one?
I found in an official document

Code: Select all

https://help.ubuntu.com/community/LIRC
that says if I get the receiver's vendor and remote id by running lsusb, I can manually recompile the lirc source to make it support.

The problem for me, is that I can't even find the receiver's USB ID. Could you tell me the brand/model of the equipped receiver so that I can at least search/know where to read in the log file?

As 10.04 is LTS, I'd prefer to have this version.. Do you have any plan to officially support this version?

Thanks,
K.

rusane
Posts: 7
Joined: Sun Nov 08, 2009 10:18 am

Re: remote control problem: no /dev/lirc0

Post by rusane »

bump.
:oops:

Denis
Posts: 301
Joined: Sun Apr 26, 2009 3:24 pm

Re: remote control problem: no /dev/lirc0

Post by Denis »

Regarding version upgrade - we will do it as soon as we get stable working EMGD graphic drivers and mplayer with vaapi acceleration.

Regarding lirc, attached lirc_igorplugusb.c from our kernel, you can try to recompile lirc modules coming with ubuntu 10.04.

Code: Select all

/* lirc_igorplugusb - USB remote support for LIRC
 *
 * Supports the standard homebrew IgorPlugUSB receiver with Igor's firmware.
 *
 * The device can only record bursts of up to 36 pulses/spaces.
 * Works fine with RC5.
 * (Maybe a better firmware or a microcontroller with more ram can help?)
 *
 * Changelog:
 * 2009 Denis Turischev    <denis@compulab.co.il>
 * 2004 Jan M. Hochstein  <hochstein@algo.informatik.tu-darmstadt.de>
 *
 * This driver was derived from:
 *   Paul Miller <pmiller9@users.sourceforge.net>
 *      "lirc_atiusb" module
 *   Vladimir Dergachev <volodya@minspring.com>'s 2002
 *      "USB ATI Remote support" (input device)
 *   Adrian Dewhurst <sailor-lk@sailorfrag.net>'s 2002
 *      "USB StreamZap remote driver" (LIRC)
 *   Artur Lipowski <alipowski@kki.net.pl>'s 2002
 *      "lirc_dev" and "lirc_gpio" LIRC modules
 *
 */

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#include <linux/version.h>
#include <linux/autoconf.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/ioctl.h>
#include <linux/fs.h>
#include <linux/usb.h>
#include <linux/poll.h>
#include <linux/smp_lock.h>
#include <linux/time.h>

#include "../kcompat.h"
#include "../lirc.h"
#include "../lirc_dev/lirc_dev.h"

/* lock irctl structure */
#define IRLOCK			down_interruptible(&ir->lock)
#define IRUNLOCK		up(&ir->lock)

/* module identification */
#define DRIVER_VERSION		"0.1"
#define DRIVER_AUTHOR		\
	"Jan M. Hochstein <hochstein@algo.informatik.tu-darmstadt.de>"
#define DRIVER_DESC		"USB remote driver for LIRC"
#define DRIVER_NAME		"lirc_igorplugusb"

/* debugging support */
#ifdef CONFIG_USB_DEBUG
static int debug = 1;
#else
static int debug;
#endif

#define dprintk(fmt, args...)					\
	do {							\
		if (debug)					\
			printk(KERN_DEBUG fmt, ## args);	\
	} while (0)

/* general constants */
#define SUCCESS		 0

/* One mode2 pulse/space has 4 bytes. */
#define CODE_LENGTH	     sizeof(lirc_t)

/* Igor's firmware cannot record bursts longer than 36. */
#define DEVICE_BUFLEN	   36

/** Header at the beginning of the device's buffer:
	unsigned char data_length
	unsigned char data_start    (!=0 means ring-buffer overrun)
	unsigned char counter       (incremented by each burst)
**/
#define DEVICE_HEADERLEN	3

/* This is for the gap */
#define ADDITIONAL_LIRC_BYTES   2

/* times to poll per second */
#define SAMPLE_RATE	     100

static int sample_rate = SAMPLE_RATE;

/**** Igor's USB Request Codes */

#define SET_INFRABUFFER_EMPTY   1
/**
 * Params: none
 * Answer: empty
 *
**/

#define GET_INFRACODE	   2
/**
 * Params:
 *   wValue: offset to begin reading infra buffer
 *
 * Answer: infra data
 *
**/

/* data structure for each usb remote */
struct irctl {

	/* usb */
	struct usb_device *usbdev;
	int devnum;

	unsigned char *buf_in;
	unsigned int len_in;
	int in_space;
	struct timeval last_time;

	dma_addr_t dma_in;

	/* lirc */
	struct lirc_driver *p;

	/* handle sending (init strings) */
	wait_queue_head_t wait_out;

	struct semaphore lock;
};

static int unregister_from_lirc(struct irctl *ir)
{
	struct lirc_driver *p = ir->p;
	int devnum;

	if (!ir->p)
		return -EINVAL;

	devnum = ir->devnum;
	dprintk(DRIVER_NAME "[%d]: unregister from lirc called\n", devnum);

	lirc_unregister_driver(p->minor);

	printk(DRIVER_NAME "[%d]: usb remote disconnected\n", devnum);

	lirc_buffer_free(p->rbuf);
	kfree(p->rbuf);
	kfree(p);
	kfree(ir);
	ir->p = NULL;
	return SUCCESS;
}

static int set_use_inc(void *data)
{
	struct irctl *ir = data;

	if (!ir) {
		printk(DRIVER_NAME "[?]: set_use_inc called with no context\n");
		return -EIO;
	}
	dprintk(DRIVER_NAME "[%d]: set use inc\n", ir->devnum);

	MOD_INC_USE_COUNT;

	if (!ir->usbdev)
		return -ENODEV;

	return SUCCESS;
}

static void set_use_dec(void *data)
{
	struct irctl *ir = data;

	if (!ir) {
		printk(DRIVER_NAME "[?]: set_use_dec called with no context\n");
		return;
	}
	dprintk(DRIVER_NAME "[%d]: set use dec\n", ir->devnum);

	MOD_DEC_USE_COUNT;
}


static void set_infrabuffer_empty(struct irctl *ir){
	int ret;	
	ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
		SET_INFRABUFFER_EMPTY, USB_TYPE_VENDOR | USB_DIR_IN,
		0, 0, ir->buf_in, ir->len_in, HZ * USB_CTRL_GET_TIMEOUT);
	if (ret < 0)
		printk(DRIVER_NAME "[%d]: SET_INFRABUFFER_EMPTY: error %d\n", ir->devnum, ret);
}


/**
 * Called in user context.
 * return 0 if data was added to the buffer and
 * -ENODATA if none was available. This should add some number of bits
 * evenly divisible by code_length to the buffer
**/
static int usb_remote_poll(void *data, struct lirc_buffer *buf)
{
	int ret, bytes_to_read, sequence_number, last_readed_index, i;
	struct irctl *ir = (struct irctl *)data;

	if (!ir->usbdev)  /* Has the device been removed? */
		return -ENODEV;

	memset(ir->buf_in, 0, DEVICE_HEADERLEN);

	
	ret = usb_control_msg(
	      ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
	      GET_INFRACODE, USB_TYPE_VENDOR|USB_DIR_IN,
	      0/* offset */, /*unused*/0,
	      ir->buf_in, DEVICE_HEADERLEN,
	      /*timeout*/HZ * USB_CTRL_GET_TIMEOUT);

	if (ret == 1) {
		/* ACK packet has 1 byte --> ignore */
		return -ENODATA;
	}

	if (ret != DEVICE_HEADERLEN) {
		printk(DRIVER_NAME "[%d]: CORRUPTED HEADER: length =  %d\n", ir->devnum, ret);

		/* Try to recover from unexpected error */
		set_infrabuffer_empty(ir);
		ir->in_space = 1;

		return -ENODATA;
	}

	bytes_to_read = ir->buf_in[0];
	sequence_number = ir->buf_in[1];
	last_readed_index = ir->buf_in[2];

	memset(ir->buf_in, 0, ir->len_in);

	ret = usb_control_msg( ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
		GET_INFRACODE, USB_TYPE_VENDOR | USB_DIR_IN,
		DEVICE_HEADERLEN, 0, ir->buf_in, bytes_to_read,HZ * USB_CTRL_GET_TIMEOUT);

	if ((ret == bytes_to_read) && (sequence_number != -1)) {
		lirc_t code, timediff;
		struct timeval now;

		do_gettimeofday(&now);
		timediff = now.tv_sec - ir->last_time.tv_sec;
		if (timediff + 1 > PULSE_MASK / 1000000)
			timediff = PULSE_MASK;
		else {
			timediff *= 1000000;
			timediff += now.tv_usec - ir->last_time.tv_usec;
		}
		ir->last_time.tv_sec = now.tv_sec;
		ir->last_time.tv_usec = now.tv_usec;

		/* create leading gap  */
		code = timediff;
		
		lirc_buffer_write_n(buf, (unsigned char *)&code, 1);
		ir->in_space = 1;   /* next comes a pulse */

		/* MODE2: pulse/space (PULSE_BIT) in 1us units */

		for(i = last_readed_index; i < bytes_to_read; i++){
			/* 1 Igor-tick = 85.333333 us */
			code = (unsigned int)ir->buf_in[i] * 85	+ (unsigned int)ir->buf_in[i] / 3;
			ir->last_time.tv_usec += code;
			if (ir->in_space)
				code |= PULSE_BIT;
			lirc_buffer_write_n(buf, (unsigned char *)&code, 1);
			/* 1 chunk = CODE_LENGTH bytes */
			ir->in_space ^= 1;
		}
		for(i = 0; i < last_readed_index - 1; i++){
			/* 1 Igor-tick = 85.333333 us */
			code = (unsigned int)ir->buf_in[i] * 85	+ (unsigned int)ir->buf_in[i] / 3;
			ir->last_time.tv_usec += code;
			if (ir->in_space)
				code |= PULSE_BIT;
			lirc_buffer_write_n(buf, (unsigned char *)&code, 1);
			/* 1 chunk = CODE_LENGTH bytes */
			ir->in_space ^= 1;
		}

		set_infrabuffer_empty(ir);

		return SUCCESS;
	} else
		printk(DRIVER_NAME "[%d]: GET_INFRACODE: error %d\n", ir->devnum, ret);

	return -ENODATA;
}



static int usb_remote_probe(struct usb_interface *intf,
				const struct usb_device_id *id)
{
	struct usb_device *dev = NULL;
	struct usb_host_interface *idesc = NULL;
	struct usb_host_endpoint *ep_ctl2;

	struct irctl *ir = NULL;
	struct lirc_driver *driver = NULL;
	struct lirc_buffer *rbuf = NULL;
	int devnum, pipe, maxp, bytes_in_key;
	int minor = 0;
	char buf[63], name[128] = "";
	int mem_failure = 0;
	
	dprintk(DRIVER_NAME ": usb probe called.\n");


	dev = interface_to_usbdev(intf);

	idesc = intf->cur_altsetting;

	if (idesc->desc.bNumEndpoints != 1)
		return -ENODEV;
	ep_ctl2 = idesc->endpoint;
	if (((ep_ctl2->desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK)
	    != USB_DIR_IN)
	    || (ep_ctl2->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
	    != USB_ENDPOINT_XFER_CONTROL)
		return -ENODEV;
	pipe = usb_rcvctrlpipe(dev, ep_ctl2->desc.bEndpointAddress);

	devnum = dev->devnum;
	maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));

	bytes_in_key = CODE_LENGTH;

	dprintk(DRIVER_NAME "[%d]: bytes_in_key=%d maxp=%d\n",
		devnum, bytes_in_key, maxp);


	/* allocate kernel memory */
	mem_failure = 0;
	ir = kmalloc(sizeof(struct irctl), GFP_KERNEL);
	if (!ir) {
		mem_failure = 1;
		goto mem_failure_switch;
	}

	memset(ir, 0, sizeof(struct irctl));

	driver = kmalloc(sizeof(struct lirc_driver), GFP_KERNEL);
	if (!driver) {
		mem_failure = 2;
		goto mem_failure_switch;
	}

	rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
	if (!rbuf) {
		mem_failure = 3;
		goto mem_failure_switch;
	}

	if (lirc_buffer_init(rbuf, bytes_in_key,
			DEVICE_BUFLEN+ADDITIONAL_LIRC_BYTES)) {
		mem_failure = 4;
		goto mem_failure_switch;
	}


	ir->buf_in = usb_buffer_alloc(dev,
			      DEVICE_BUFLEN,
			      GFP_ATOMIC, &ir->dma_in);

	if (!ir->buf_in) {
		mem_failure = 5;
		goto mem_failure_switch;
	}

	memset(driver, 0, sizeof(struct lirc_driver));

	strcpy(driver->name, DRIVER_NAME " ");
	driver->minor = -1;
	driver->code_length = bytes_in_key*8; /* in bits */
	driver->features = LIRC_CAN_REC_MODE2;
	driver->data = ir;
	driver->rbuf = rbuf;
	driver->set_use_inc = &set_use_inc;
	driver->set_use_dec = &set_use_dec;
	driver->sample_rate = sample_rate;    /* per second */
	driver->add_to_buf = &usb_remote_poll;
#ifdef LIRC_HAVE_SYSFS
	driver->dev = &dev->dev;
#endif
	driver->owner = THIS_MODULE;

	init_MUTEX(&ir->lock);
	init_waitqueue_head(&ir->wait_out);

	minor = lirc_register_driver(driver);
	if (minor < 0)
		mem_failure = 9;

mem_failure_switch:

	/* free allocated memory in case of failure */
	switch (mem_failure) {
	case 9:
		usb_buffer_free(dev, DEVICE_BUFLEN,
			ir->buf_in, ir->dma_in);

	case 5:
		lirc_buffer_free(rbuf);
	case 4:
		kfree(rbuf);
	case 3:
		kfree(driver);
	case 2:
		kfree(ir);
	case 1:
		printk(DRIVER_NAME "[%d]: out of memory (code=%d)\n",devnum, mem_failure);
		return -ENOMEM;
	}

	driver->minor = minor;
	ir->p = driver;
	ir->devnum = devnum;
	ir->usbdev = dev;
	ir->len_in = DEVICE_BUFLEN;
	ir->in_space = 1; /* First mode2 event is a space. */
	do_gettimeofday(&ir->last_time);

	if (dev->descriptor.iManufacturer
		&& usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
		strncpy(name, buf, 128);
	if (dev->descriptor.iProduct
		&& usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
		snprintf(name, 128, "%s %s", name, buf);
	printk(DRIVER_NAME "[%d]: %s on usb%d:%d\n", devnum, name,
	       dev->bus->busnum, devnum);

	set_infrabuffer_empty(ir);

	usb_set_intfdata(intf, ir);
	return SUCCESS;
}


static void usb_remote_disconnect(struct usb_interface *intf)
{
	struct usb_device *dev = interface_to_usbdev(intf);
	struct irctl *ir = usb_get_intfdata(intf);
	usb_set_intfdata(intf, NULL);

	if (!ir || !ir->p)
		return;

	ir->usbdev = NULL;
	wake_up_all(&ir->wait_out);

	IRLOCK;
	usb_buffer_free(dev, ir->len_in, ir->buf_in, ir->dma_in);
	IRUNLOCK;

	unregister_from_lirc(ir);
}

static struct usb_device_id usb_remote_id_table [] = {
	/* Igor Plug USB (Atmel's Manufact. ID) */
	{ USB_DEVICE(0x03eb, 0x0002) },
	{ USB_DEVICE(0x03eb, 0x21fe) },
	/* Terminating entry */
	{ }
};

static struct usb_driver usb_remote_driver = {
	LIRC_THIS_MODULE(.owner = THIS_MODULE)
	.name =		DRIVER_NAME,
	.probe =	usb_remote_probe,
	.disconnect =	usb_remote_disconnect,
	.id_table =	usb_remote_id_table
};

static int __init usb_remote_init(void)
{
	int i;

	printk(KERN_INFO "\n"
	       DRIVER_NAME ": " DRIVER_DESC " v" DRIVER_VERSION "\n");
	printk(DRIVER_NAME ": " DRIVER_AUTHOR "\n");
	dprintk(DRIVER_NAME ": debug mode enabled\n");

	request_module("lirc_dev");

	i = usb_register(&usb_remote_driver);
	if (i < 0) {
		printk(DRIVER_NAME ": usb register failed, result = %d\n", i);
		return -ENODEV;
	}

	return SUCCESS;
}

static void __exit usb_remote_exit(void)
{
	usb_deregister(&usb_remote_driver);
}

module_init(usb_remote_init);
module_exit(usb_remote_exit);

#include <linux/vermagic.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);


MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(usb, usb_remote_id_table);

module_param(sample_rate, int, 0644);
MODULE_PARM_DESC(sample_rate, "Sampling rate in Hz (default: 100)");

EXPORT_NO_SYMBOLS;
Compulab's Linux support

fly
Posts: 162
Joined: Thu Jul 22, 2010 2:02 pm

Re: remote control problem: no /dev/lirc0

Post by fly »

I am in a hurry, but LIRC support in lucid works out of the box for me. I will check back and post some config settings.


--edit--

Code: Select all

DEBIAN_FRONTEND=noninteractive sudo apt-get install  lirc
(
  echo REMOTE=\"Igor Cesko\'s USB IR Receiver\"
  echo REMOTE_MODULES=\"lirc_dev lirc_igorplugusb\"
  echo REMOTE_DRIVER=\"\"
  echo REMOTE_DEVICE=\"/dev/lirc0\"
  echo REMOTE_SOCKET=\"\"
  echo REMOTE_LIRCD_CONF=\"\"
  echo REMOTE_LIRCD_ARGS=\"\"
  echo START_LIRCD=\"true\"
  echo START_LIRCMD=\"\"
  echo LOAD_MODULES=\"\"
  echo LIRCMD_CONF=\"\"
  echo FORCE_NONINTERACTIVE_RECONFIGURATION=\"false\"
) | sudo tee /etc/lirc/hardware.conf
sudo /etc/init.d/lirc stop

sudo irrecord -n -f -d /dev/lirc0 /etc/lirc/lircd.conf  
# i need -f to force raw mode; without it does not work

sudo /etc/init.d/lirc restart
After that i can test with irw:

Code: Select all

$ irw
0000000000000012 00 KEY_6 kenwood-rc-m83
0000000000000003 00 KEY_MUTE kenwood-rc-m83
0000000000000002 00 KEY_VOLUMEDOWN kenwood-rc-m83
0000000000000001 00 KEY_VOLUMEUP kenwood-rc-m83
000000000000002f 00 KEY_CDPLAY kenwood-rc-m83
...

rusane
Posts: 7
Joined: Sun Nov 08, 2009 10:18 am

Re: remote control problem: no /dev/lirc0

Post by rusane »

@Denis:
Thanks, I'll try it and post if it works.

@fly:
I tried with your procedure but the problem is that I don't have /dev/lirc0 so I manually created a node with "mknod /dev/lirc0 c 61 0".
Then I ran "irrecord -n -f -d /dev/lirc0 /etc/lircd2.conf" but it says:

Code: Select all

# irrecord -n -d /dev/lirc0 /etc/lircd2.conf   

irrecord -  application for recording IR-codes for usage with lirc

Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de)

irrecord: could not open /dev/lirc0
irrecord: default_init(): No such device or address
irrecord: could not init hardware (lircd running ? --> close it, check permissions)
This is same even if I run lircd, i.e. /etc/init.d/lirc start

When I run "mode2", it says:

Code: Select all

# mode2 --device=/dev/lirc0
mode2: could not open /dev/lirc0
mode2: default_init(): No such device or address
Just to compare, I've got a few questions:
1. What's your lirc version? Is it official Ubuntu version?
2. What's your output of "ls -l /dev/lirc*" ? (I only have /dev/lircd)
3. When you run "lsusb" (list usb), do you see any receiver-related USB device name? (Because I don't..)
4. I tried installing lirc, lirc-x from repository but didn't work. Did you install any other related packages?
Thanks for your reply!

fly
Posts: 162
Joined: Thu Jul 22, 2010 2:02 pm

Re: remote control problem: no /dev/lirc0

Post by fly »

Just to compare, I've got a few questions:
1. What's your lirc version?
$ lircd -v
lircd 0.8.6

The lirc_igorplugusb driver reports itself being for LIRC v0.2 ..
Is it official Ubuntu version?
Yes, default lucid repo.
2. What's your output of "ls -l /dev/lirc*" ? (I only have /dev/lircd)
$ ls -l /dev/lirc*
crw-rw---- 1 root root 61, 0 2010-11-22 11:01 /dev/lirc0
lrwxrwxrwx 1 root root 19 2010-11-22 11:01 /dev/lircd -> /var/run/lirc/lircd
3. When you run "lsusb" (list usb), do you see any receiver-related USB device name? (Because I don't..)
$ lsusb
Bus 004 Device 002: ID 03eb:21fe Atmel Corp
...

Igor's IR Receiver is Atmel based, so this is the only thing i found related to it. The output from dmesg confirms the bus and device ids:

lirc_igorplugusb[2]: Cesko AVR309:USB to UART protocol converter (simple) on usb4:2
4. I tried installing lirc, lirc-x from repository but didn't work. Did you install any other related packages?
Just lirc.

rusane
Posts: 7
Joined: Sun Nov 08, 2009 10:18 am

Re: remote control problem: no /dev/lirc0

Post by rusane »

@fly:
Thanks a lot. Your information was really helpful.
It seems that I need to test with Compulab's 9.10 first to make sure that the receiver is properly working.
I will post again if I make any progress.
Cheers, K.

rusane
Posts: 7
Joined: Sun Nov 08, 2009 10:18 am

Re: remote control problem: no /dev/lirc0

Post by rusane »

@denis:
Hi Denis, I finally did a fresh-install of Ubuntu 9.10 with Fit-PC2 updates. Now I'm a bit worried that my receiver module has some hardware problem, after doing some tests below. All the packages were installed from the official Ubuntu and Fit-PC2 repositories only.(no source-compiled.)

Code: Select all

# uname -ar
Linux sayyeah-net-mini 2.6.31-34-fitpc2 #8 SMP Wed Jun 16 11:27:25 IDT 2010 i686 GNU/Linux

# mode2
mode2: could not get file information for /dev/lirc
mode2: default_init(): No such file or directory

# ls -al /dev/lirc*
lrwxrwxrwx 1 root root 19 2010-11-27 12:02 /dev/lircd -> /var/run/lirc/lircd

# mknod /dev/lirc c 61 0
# mode2
mode2: could not open /dev/lirc
mode2: default_init(): No such device

# lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 050d:0910 Belkin Components 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 018: ID 046a:0021 Cherry GmbH 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

# lircd -v
lircd 0.8.6

# lsmod|grep lirc
lirc_igorplugusb        6076  0 
lirc_dev               10772  1 lirc_igorplugusb

# dmesg|grep lirc
[   16.137204] lirc_dev: IR Remote Control driver registered, major 61 
[   16.156879] lirc_igorplugusb: USB remote driver for LIRC v0.1
[   16.156887] lirc_igorplugusb: Jan M. Hochstein <hochstein@algo.informatik.tu-darmstadt.de>
[   16.169199] usbcore: registered new interface driver lirc_igorplugusb
As you can see, my situation is exactly the same as 10.04
According to @fly, I should see at least some receiver-related USB device name from lsusb, but it seems that the receiver USB module is not even detected at the lowest level.

Is it something to do with wrong BIOS setting? (Can't see any menu related to IR receiver though.)
Or, should I get a replacement of the Fit-PC2?
This is my first time trying to use remote controller on Fit-PC2, so I have a feeling that it might not be a software issue.

Thanks.

Post Reply

Return to “Ubuntu 10.04”