2013-09-28

Well the good news is that I now have the remote controller successfully testing with the mode2 utilty on the pcDuino. Also I have produced a clear set of instructions for compiling the pcDuino kernel on the board itself, (see below).

The bad news is that I'm still not quite at the stage of an auto-running LIRC daemon, (see the ToDo list at the end of this post). I am confident that I will eventually get this done, but feel free to offer any tips or advice to expedite the process.

ref:
https://element14.com/community/message ... on-pcduino

ref:
http://www.lirc.org/html/install.html

Rebuilding the pcDuino Kernel:
1. Login as root user: sudo su
2. Change to sources directory: cd /lib/modules/3.4.29+
3. Download kernel source code: wget
https://s3.amazonaws.com/linksprite/pcd ... xi.tar.bz2

4. Download default kernel configuration file: wget
https://s3.amazonaws.com/linksprite/pcd ... _defconfig

5. Extract kernel source code: tar -jxf linux-sunxi.tar.bz2
6. If you had previously installed the pcDuino headers package uninstall it:
apt-get remove --purge pcduino-linux-headers-3.4.29+
apt-get clean
7. Create a directory named "build" under "/lib/modules/3.4.29+": mkdir build
8. Copy "sun4i_defconfig" to the directory "build", and rename as ".config": cp ./linux-sunxi/sun4i_defconfig ./build/.config
9. Install some additional necessary packages: apt-get install u-boot-tools libncurses5 libncurses5-dev libsysfs-dev
(Note: You may also require apt-get install dialog)
10. Change to extracted sources directory: cd ./linux-sunxi
11. Configure the kernel: make menuconfig O=../build
12. After the kernel configuration menu appears, enter into "General setup --->" by moving the cursor to that line and press "ENTER". Locate the line “Initial RAM filesystem and RAM disk (initramfas/initrd) support", and press "N" to deselect it. Use the right arrow to select "Exit" and press "ENTER" to exit the sub-menu.
13. Use the right arrow to select "Exit" and press "ENTER" to exit the main menu and then select "Yes" and press "ENTER" to save the configuration.
Note: Building MCE RC Support directly into the kernel: If you are rebuilding the pcDuino kermel to provide support for an MCE compatible remote control, (as I am), you may wish to build support for this directly into the kernel, rather than modularise it which is the default configuration setting. If this is the case then use the following directions:
Enter into "Device Drivers --->" by moving the cursor to that line and press "ENTER". Locate the line “Multimedia Support --->" and press "ENTER". Locate the line “Remote controller adapters --->" and press "ENTER". Locate the line “Windows Media Center Ed. eHome Infrared Transceiver --->" and press "Y" to select it.
14. Change to the "build" directory: cd ./build
15. Build the kernel: make
(Note: This will take approximately 4 hours.)
16. Build the kernel modules: make modules
17. Install the kernal modules: make modules_install
18. Create an image file of the new kernel: make uImage
19. Mount the boot partition:
For booting from micro-SD card: ("/dev/mmcblk0p2"): mount /dev/mmcblk0p2 /boot
For booting from onboard NAND: ("/dev/nanda"): mount /dev/nanda /boot
20. Copy the kernel image file to the boot partition: cp arch/arm/boot/uImage /boot -f
21. Reboot the pcDuino: reboot

Compiling and Installing LIRC:
1. cd /root
2. mkdir lirc
3. cd ./lirc
4. Download v0.9.0 of LIRC from here:
http://www.lirc.org
and save in "/root/lirc"
5. Extract LIRC: tar -xjf lirc-0.9.0.tar.bz2 -C .
6. cd ./lirc-0.9.0
7. ./configure --with-driver=userspace
8. Run make
9. Run make install
10. insmod "/lib/modules/3.4.29+/build/drivers/media/rc/mceusb.ko"
(Confirm that mceusb module has been successfully installed by running "lsmod")
11. Test system by running "mode2 --device=/dev/lirc0" and clicking buttons on the remote.
12. Copy the "lirc.rules" file located in the "contrib" directory of the source package to "/etc/udev/rules.d/".
13. Adjust the file permissions of "/var/run/lirc/lircd": chmod 666 /var/run/lirc/lircd
(This is the Unix domain socket that clients use to connect to lircd so others than root can connect to lircd.)

ToDo:
1. Build MCE compatible remote control support directly into the kernel, (will do this next time I have 4 hours free)
2. Alternatively, work out how to use "modeprobe" instead of "insmod" to install the "mceusb" module.
3. Get LIRC device driver registering as "/dev/lirc"
4. Get "lircd" to install at "/var/run/lirc/lircd".
5. Add an init script for "lircd" and "lircmd" to start them automatically at boot time.

Statistics: Posted by Rat — Sat Sep 28, 2013 10:43 am

Show more