Firefly Open Source Community

   Login   |   Register   |
New_Topic
12
New Topic
Print Previous Topic Next Topic

IR receiver setup - help needed

11

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
11

IR receiver setup - help needed

Posted at 1/5/2015 23:52:36      View:14427 | Replies:15        Print      Only Author   [Copy Link] 1#

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
Reply

Use props Report

10

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
10
Posted at 1/6/2015 15:16:03        Only Author  2#
What's your problem on IR driver. Is there any interrupts while you press the Remote key?
Reply

Use props Report

11

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
11
Posted at 1/6/2015 18:21:34        Only Author  3#
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.
Reply

Use props Report

2442

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
2442
Posted at 1/7/2015 20:31:49        Only Author  4#

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

Use props Report

11

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
11
Posted at 1/8/2015 00:32:53        Only Author  5#

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?





Reply

Use props Report

308

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
308
Posted at 1/8/2015 15:53:24        Only Author  6#

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:

  1. static struct rkxx_remotectl_button remotectl_button[] =
  2. {
  3. +   {
  4. +       .usercode = 0xff00, /* need to get the usercode in next step */
  5. +       .nbuttons = 12, /* number of buttons */
  6. +       .key_table = &remote_key_table_myIR[0],
  7. +   },
  8. #ifdef R66_REMOTE
Copy the code

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


  1. static struct rkxx_remote_key_table remote_key_table_myIR[12] = {
  2.     {0xeb, KEY_POWER},        // Power
  3.     // Control
  4.     {0xa3, 250},              // Settings
  5.     {0xec, KEY_MENU},         // Menu
  6.     {0xfc, KEY_UP},           // Up   --keycode above print
  7.     {0xfd, KEY_DOWN},         // Down
  8.     {0xf1, KEY_LEFT},         // Left
  9.     {0xe5, KEY_RIGHT},        // Right
  10.     {0xf8, KEY_REPLY},        // Ok
  11.     {0xb7, KEY_HOME},         // Home
  12.     {0xfe, KEY_BACK},         // Back
  13.     // Vol
  14.     {0xa7, KEY_VOLUMEDOWN},   // Vol-
  15.     {0xf4, KEY_VOLUMEUP},     // Vol+
  16. };
Copy the code

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.

Reply

Use props Report

11

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
11
Posted at 1/9/2015 01:16:35        Only Author  7#

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!
Reply

Use props Report

308

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
308
Posted at 1/9/2015 09:02:38        Only Author  8#

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

Use props Report

11

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
11
Posted at 1/9/2015 16:03:16        Only Author  9#

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?
Reply

Use props Report

11

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
11
Posted at 1/9/2015 17:36:37        Only Author  10#
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?
Reply

Use props Report

Return to List
12
You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list