IR receiver setup - help needed

Hi,

I am a newbie with the RK3288 development board, but I have a fair amount of Linux experience (not a programmer though). I still cannot figure out how to setup the built-in IR receiver to work with e.g. a Microsoft MC remote. I have tried to locate the file and the directory discussed in the wiki (
http://wiki.t-firefly.com/index.php/Fir … 3288/IR/en
), but I haven’t gotten anywhere.

I gather that I have to do some low level hacking to enable the IR, and I am prepared to try if someone could help me out with a more thourough how-to description.

Thank you!

Tomas

What’s your problem on IR driver. Is there any interrupts while you press the Remote key?

Problem is that nothing happens, Firefly with kodi doesn’t react to any remote key presses (Microsoft MC remote) . I thought I had to activate the driver somehow, but I haven’t been able to figure out how.

open?DBG_CODE,then?the kernel log will show some useful message

Thanks for the help, but?I am not a software developer and still don’t understand the instructions. I have fair knowledge of a Linux system, but not on the level of compiling my own kernel etc. Let me post some questions to indicate which level I am at:

  1. Can I access the files referred to on the device through ADB on my PC? I tried to locate them from the Lubuntu boot, but no luck.

  2. Do I need to compile a new linux kernel in order to enable IR reception on the RK3288? If so, why is IR not enabled in the kernel that ships with the board?

  3. Once enabled, will the IR receiver work with the Microsoft MC remote, which works out of the box with Kodi (with a working IR receiver of course) or do I need to somehow remap the NEC encode format?

connect usb OTG and your PC ,turn on the USB connect of Setting . On PC Terminal clint “adb shell” .detail can see that webhttp://www.londatiga.net/it/how-to-use- … line-tool/

under terminal

1.root@firefly:/ #adb shell [be into board shell]

2.root@firefly:/ # echo 1 > /sys/module/rk_pwm_remotectl/parameters/dbg_level" [open IR Code debug]

3.then you use your IR remote . press random key one time. then ,

root@firefly:/ # dmesg | grep “USERCODE=”

find the “GET USERCODE=” and its tail is look like

“[ 772.156403] GET USERCODE=0xFF00” this is your IR usercode, mark down

4.after you mark down your usercode , begin to modify your Source Code .

you can read WIKI about how to configure IR Firefly-WIKI/IR_Configuration

modify file kernel/drivers/input/remotectl/rk_pwm_remotectl.c

find out the location of this line “static struct rkxx_remotectl_button remotectl_button =”

add your IR usercode . look like under

Example:

static struct rkxx_remotectl_button remotectl_button[] =
{
 +   {
 +       .usercode = 0xff00, /* need to get the usercode in next step */
 +       .nbuttons = 12, /* number of buttons */
 +       .key_table = &remote_key_table_myIR[0],
 +   },
#ifdef R66_REMOTE

5.when you done above step , save this code file and begin to make your SDK Kernel.img and burn kernel.img into your board.

repeat adb shell and open IR Code debug again. then begin to mark your keycode one by one .

Example:

press KEY_up ,then

root@firefly:/ # dmesg | grep “RMC_GETDATA=”

"[ 772.156403] RMC_GETDATA=“0xFCA2” /this is your keycode , you can set this key function/

one by one to press your key and mark down the keycode , and set function of the key below

static struct rkxx_remote_key_table remote_key_table_myIR[12] = {
    {0xeb, KEY_POWER},        // Power
    // Control
    {0xa3, 250},              // Settings
    {0xec, KEY_MENU},         // Menu
    {0xfc, KEY_UP},           // Up   --keycode above print
    {0xfd, KEY_DOWN},         // Down
    {0xf1, KEY_LEFT},         // Left
    {0xe5, KEY_RIGHT},        // Right
    {0xf8, KEY_REPLY},        // Ok
    {0xb7, KEY_HOME},         // Home
    {0xfe, KEY_BACK},         // Back
    // Vol
    {0xa7, KEY_VOLUMEDOWN},   // Vol-
    {0xf4, KEY_VOLUMEUP},     // Vol+
};

make your kernel.img and burn into your board.

after you done this job , you will complate your IR Configuration .

Firefly_WIKI many thing you can use on this web.

happy to use your own IR.

Thank you for the detailed input! I will try it out as soon I get the ADB tools working on any of my Ubuntu PCs. As it is now “adb devices” doesn’t show anything (I have USB debugging on the RK3288 turned on) and adb shell gives me “error: device not found”.

OK, several hours later I finally managed to adb into the board and I have come to step 3 in your description. Then I can’t find the “DATA DBG and its tail”…?Could you please just give me a hint of the filenames and directories I am looking for? Or which grep command should I use to find the files you are referring to?

Thank you!

sorry , I post wrong key work and fix the wrong above . you can see it again .

Thank you leungtek. Still a few questions:

In step 1. might there be a missing " in the line?root@firefly:/ # echo 1 > /sys/module/rk_pwm_remotectl/parameters/dbg_level" ?

In step 3. where (or how) do I find the file containing?“GET USERCODE=” ?

In step 4. when I try to cd into?kernel/drivers/input/remotectl/ I get error “no such file or directory”. Do I have to download the source code from the firefly site?

Ok, maybe I understand now. The command in step 3. dmesg | grep “USERCODE=” is supposed to output that line of dmesg. Problem is it shows nothing. I guess that means that the IR receiver registered nothing, or?

it will show the log when click the ir  remote.

Until I get a better understanding of the process, I went ahead and ordered a flirc usb IR receiver (
https://flirc.tv/product/flirc/
). It is supposed to work with Android, MCE remote and Kodi/XBMC.

Maybe there will be firmware with the IR enabled?available from Firefly in the future.

it will show the log when click the ir ?remote.

I don’t know where to find the log.

Hi eldflugan , you can use adb.

To see the kernel log:

$ adb shell cat /proc/kmsg

To see the Android logcat:

$ adb logcat

$ adb shell cat /proc/kmsg

I get /proc/kms: No such file or directory

$ adb logcat

I get an endless list scrolling down the screen

I have installed my flirc-dongle and configured it to work with Kodi, so I am fine for now. It would, however be nice to just download and install an image where the IR receiver could be set up through some app in Android or Lubuntu.

to see the data in dmesg type this

?echo 1 > /sys/module/rk_pwm_remotectl/parameters/code_print

Thank you for the article; it really piqued my interest. Boost your IT skills and enjoy free AZ-800 latest exam cram sheet file sharing. Wishing you success!