This is an old revision of the document!
Useful links:
Go to Flirc, and download the
install.sh
file.
Run:
sudo install.sh
To setup commands:
flirc_util record_api 1 30 # This is "CTRL+1"
To reset to default:
flirc_util format
/etc/xdg/openbox/lxde-pi-rc.xml
/* HID #Defines */ #define HID_a 4 #define HID_b 5 #define HID_c 6 #define HID_d 7 #define HID_e 8 #define HID_f 9 #define HID_g 10 #define HID_h 11 #define HID_i 12 #define HID_j 13 #define HID_k 14 #define HID_l 15 #define HID_m 16 #define HID_n 17 #define HID_o 18 #define HID_p 19 #define HID_q 20 #define HID_r 21 #define HID_s 22 #define HID_t 23 #define HID_u 24 #define HID_v 25 #define HID_w 26 #define HID_x 27 #define HID_y 28 #define HID_z 29 #define HID_1 30 #define HID_excl 30 #define HID_2 31 #define HID_address 31 #define HID_3 32 #define HID_pound 32 #define HID_4 33 #define HID_dollar 33 #define HID_5 34 #define HID_percent 34 #define HID_6 35 #define HID_carrot 35 #define HID_7 36 #define HID_amp 36 #define HID_8 37 #define HID_star 37 #define HID_9 38 #define HID_paren_right 38 #define HID_0 39 #define HID_paren_left 39 #define HID_return 40 #define HID_escape 41 #define HID_delete 76 #define HID_backspace 42 #define HID_tab 43 #define HID_space 44 #define HID_minus 45 #define HID_underscore 45 #define HID_equal 46 #define HID_plus 46 #define HID_brack_right 47 #define HID_curly_right 47 #define HID_brack_left 48 #define HID_curly_left 48 #define HID_back_slash 49 #define HID_pipe 49 #define HID_semi_colon 51 #define HID_colon 51 #define HID_apostrophe 52 #define HID_quote 52 #define HID_back_tick 53 #define HID_tilde 53 #define HID_comma 54 #define HID_less_than 54 #define HID_period 55 #define HID_greater_than 55 #define HID_fw_slash 56 #define HID_questionmark 56 #define HID_F1 58 #define HID_F2 59 #define HID_F3 60 #define HID_F4 61 #define HID_F5 62 #define HID_F6 63 #define HID_F7 64 #define HID_F8 65 #define HID_F9 66 #define HID_F10 67 #define HID_F11 68 #define HID_F12 69 #define HID_print_scr 70 #define HID_scroll 71 #define HID_pause 72 #define HID_insert 73 #define HID_home 74 #define HID_pageup 75 #define HID_end 77 #define HID_pagedown 78 #define HID_right 79 #define HID_left 80 #define HID_down 81 #define HID_up 82 #define HID_enter 88 #define HID_shift (1<<1) #define MOD_CTRL_LEFT (1<<0) #define MOD_SHIFT_LEFT (1<<1) #define MOD_ALT_LEFT (1<<2) #define MOD_COMMAND_LEFT (1<<3) #define MOD_CTRL_RIGHT (1<<4) #define MOD_SHIFT_RIGHT (1<<5) #define MOD_ALT_RIGHT (1<<6) #define MOD_COMMAND_RIGHT (1<<7) #define HID_EJECT (1<<7) #define HID_VOL_DOWN (1<<6) #define HID_VOL_UP (1<<5) #define HID_MUTE (1<<4) #define HID_PLAY_PAUSE (1<<3) #define HID_STOP (1<<2) #define HID_PREV_TRACK (1<<1) #define HID_NEXT_TRACK (1<<0) [/CODE]
<!-- FLIRC - IR reciever keyboard shortcuts START -->
<keybind key="C-1">
<action name="Execute">
<command>lights on</command>
</action>
</keybind>
<keybind key="C-2">
<action name="Execute">
<command>lights mood</command>
</action>
</keybind>
<keybind key="C-3">
<action name="Execute">
<command>lights off</command>
</action>
</keybind>
<keybind key="C-4">
<action name="Execute">
<command>lights pc on</command>
</action>
</keybind>
<keybind key="C-5">
<action name="Execute">
<command>lights pc off</command>
</action>
</keybind>
<keybind key="C-6">
<action name="Execute">
<command>lights ficus on</command>
</action>
</keybind>
<keybind key="C-7">
<action name="Execute">
<command>lights ficus off</command>
</action>
</keybind>
<keybind key="C-8">
<action name="Execute">
<command>lights turtle on</command>
</action>
</keybind>
<keybind key="C-9">
<action name="Execute">
<command>lights turtle off</command>
</action>
</keybind>
<keybind key="C-0">
<action name="Execute">
<command>lights crystal on</command>
</action>
</keybind>
<keybind key="C-F1">
<action name="Execute">
<command>lights crystal off</command>
</action>
</keybind>
<keybind key="C-F2">
<action name="Execute">
<command>ir tv</command>
</action>
</keybind>
<keybind key="C-F3">
<action name="Execute">
<command>ir speakers</command>
</action>
</keybind>
<keybind key="C-F4">
<action name="Execute">
<command>ir sound1</command>
</action>
</keybind>
<keybind key="C-F5">
<action name="Execute">
<command>ir sound2</command>
</action>
</keybind>
<keybind key="C-F6">
<action name="Execute">
<command>ir sound3</command>
</action>
</keybind>
<keybind key="C-F7">
<action name="Execute">
<command>ir bassUp</command>
</action>
</keybind>
<keybind key="C-F8">
<action name="Execute">
<command>ir bassDown</command>
</action>
</keybind>
<!-- FLIRC - END =========================== -->
* Note that RPI must be in GUI mode (to use keyboard shortcuts), maybe i will find a better way later…
Speakers-on/off speakers (audio):
sendir --pattern=0,8900,4441,522,634,470,577,471,603,471,1690,526,552,522,548,513,1702,501,1689,496,1690,496,526,578,548,500,522,552,1690,471,603,471,632,446,1759,427,630,470,604,470,578,501,577,552,497,552,588,460,547,526,552,548,1582,578,1664,500,1690,552,1608,604,1637,497,1663,527,1659,527,1663,527
Speakers-Sound 1:
sendir --pattern=0,9047,4365,666,412,639,448,630,442,640,1553,614,463,640,438,640,1557,636,1557,666,1527,640,438,640,438,640,437,640,1558,666,422,629,438,640,1553,640,438,639,1558,640,1552,666,1528,640,1553,640,1558,666,1527,666,426,651,1527,666,412,644,438,640,437,666,412,640,437,666,412,666,1528,614
Speakers-Sound 2:
sendir --pattern=0,9016,4390,614,467,610,467,610,468,609,1583,614,467,610,468,609,1582,610,1583,614,1578,614,468,610,467,610,468,609,1583,614,468,610,467,610,1583,617,1576,614,1583,609,1583,610,1583,614,1579,614,1583,609,1583,614,464,614,463,614,468,617,460,609,468,610,467,614,463,614,463,614,1583,610
Speakers-Sound 3:
sendir --pattern=0,9040,4365,640,438,644,437,640,438,640,1553,639,438,640,437,640,1553,645,1548,644,1553,640,437,640,438,666,412,665,1528,640,437,640,437,640,1557,640,438,640,437,640,437,640,438,639,438,640,438,639,438,644,1553,640,1553,666,1527,640,1553,588,1605,614,1583,609,1583,640,1553,610,468,615
TV-on/off
sendir --pattern=0,9027,4469,597,493,597,493,593,498,592,494,592,498,593,498,592,1614,597,493,593,1617,597,1618,593,1634,580,1618,597,1618,592,1618,597,498,592,1618,592,498,593,1617,592,498,593,493,592,1617,597,494,592,494,592,498,593,1617,593,498,592,1618,593,1617,597,494,592,1618,592,1622,593,1621,593
Speakers-Bass Up:
sendir --pattern=0,8982,4421,583,498,605,472,605,472,580,1626,596,467,610,468,609,1588,605,1587,605,1588,609,468,610,467,610,468,609,1587,606,471,606,471,580,1647,601,442,609,468,635,1557,610,1587,609,1583,609,468,610,1582,610,468,609,1587,610,1582,610,467,636,442,609,468,635,1561,605,472,636,1556,636
Speakers-Bass Down:
sendir --pattern=0,9056,4340,661,420,661,415,605,472,631,1565,630,446,631,446,656,1535,631,1560,635,1560,645,432,631,446,631,446,605,1586,635,446,605,472,630,1561,630,1561,635,442,635,1556,635,1560,631,1561,656,420,661,1531,635,446,630,446,631,1560,631,446,661,416,631,446,661,1530,635,442,635,1560,631
Speakers-Volume Up:
Speakers-Volume Down:
Speakers-mute:
#!/bin/bash
COMMAND=${1:-"help"};
# Master switches
if [ $COMMAND == "tv" ]; then # Master off switch
flirc_util sendir --pattern=0,9027,4469,597,493,597,493,593,498,592,494,592,498,593,498,592,1614,597,493,593,1617,597,1618,593,1634,580,1618,597,1618,592,1618,597,498,592,1618,592,498,593,1617,592,498,593,493,592,1617,597,494,592,494,592,498,593,1617,593,498,592,1618,593,1617,597,494,592,1618,592,1622,593,1621,593;
elif [ $COMMAND == "speakers" ]; then
flirc_util sendir --pattern=0,8900,4441,522,634,470,577,471,603,471,1690,526,552,522,548,513,1702,501,1689,496,1690,496,526,578,548,500,522,552,1690,471,603,471,632,446,1759,427,630,470,604,470,578,501,577,552,497,552,588,460,547,526,552,548,1582,578,1664,500,1690,552,1608,604,1637,497,1663,527,1659,527,1663,527;
elif [ $COMMAND == "sound1" ]; then
flirc_util sendir --pattern=0,9047,4365,666,412,639,448,630,442,640,1553,614,463,640,438,640,1557,636,1557,666,1527,640,438,640,438,640,437,640,1558,666,422,629,438,640,1553,640,438,639,1558,640,1552,666,1528,640,1553,640,1558,666,1527,666,426,651,1527,666,412,644,438,640,437,666,412,640,437,666,412,666,1528,614;
elif [ $COMMAND == "sound2" ]; then
flirc_util sendir --pattern=0,9016,4390,614,467,610,467,610,468,609,1583,614,467,610,468,609,1582,610,1583,614,1578,614,468,610,467,610,468,609,1583,614,468,610,467,610,1583,617,1576,614,1583,609,1583,610,1583,614,1579,614,1583,609,1583,614,464,614,463,614,468,617,460,609,468,610,467,614,463,614,463,614,1583,610;
elif [ $COMMAND == "sound3" ]; then
flirc_util sendir --pattern=0,9040,4365,640,438,644,437,640,438,640,1553,639,438,640,437,640,1553,645,1548,644,1553,640,437,640,438,666,412,665,1528,640,437,640,437,640,1557,640,438,640,437,640,437,640,438,639,438,640,438,639,438,644,1553,640,1553,666,1527,640,1553,588,1605,614,1583,609,1583,640,1553,610,468,615;
elif [ $COMMAND == "bassup" ]; then
flirc_util sendir --pattern=0,8982,4421,583,498,605,472,605,472,580,1626,596,467,610,468,609,1588,605,1587,605,1588,609,468,610,467,610,468,609,1587,606,471,606,471,580,1647,601,442,609,468,635,1557,610,1587,609,1583,609,468,610,1582,610,468,609,1587,610,1582,610,467,636,442,609,468,635,1561,605,472,636,1556,636;
elif [ $COMMAND == "bassdown" ]; then
flirc_util sendir --pattern=0,9056,4340,661,420,661,415,605,472,631,1565,630,446,631,446,656,1535,631,1560,635,1560,645,432,631,446,631,446,605,1586,635,446,605,472,630,1561,630,1561,635,442,635,1556,635,1560,631,1561,656,420,661,1531,635,446,630,446,631,1560,631,446,661,416,631,446,661,1530,635,442,635,1560,631;
elif [ $COMMAND == "volumeup" ]; then
sendir --pattern=0,9026,4399,615,464,616,464,615,464,615,1582,615,464,615,464,615,1582,615,1582,615,1581,616,464,615,464,619,460,620,1577,620,460,619,460,620,1577,620,460,619,1578,619,1578,620,1577,620,1577,620,460,620,460,620,460,620,1577,620,460,621,459,620,459,620,460,620,1578,619,1578,620,1577,620;
elif [ $COMMAND == "volumedown" ]; then
sendir --pattern=0,9021,4403,585,495,584,495,585,513,566,1616,607,473,581,498,581,1616,581,1616,581,1616,581,499,580,499,588,492,606,1591,581,498,641,439,637,1560,641,1556,615,1582,641,1556,641,1556,641,1555,642,438,667,412,642,438,641,439,641,438,641,439,641,443,663,416,663,1534,637,1560,637,1560,637;
elif [ $COMMAND == "mute" ]; then
flirc_util sendir --pattern=0,9114,4318,615,464,620,460,620,476,603,1578,619,460,620,460,619,1577,620,1577,620,1577,620,464,615,465,615,464,616,1581,616,464,616,481,599,1582,615,464,616,464,615,465,615,464,616,464,615,1582,616,464,615,465,615,1582,615,1582,615,1582,620,1577,620,1577,620,459,620,1577,620,1578,619;
elif [ $COMMAND == "help" ]; then
echo 'usage: ir [tv|speakers|sound1|sound2|sound3|bassup|bassdown|volumeup|volumedown|mute]';
echo ' see /etc/xdg/openbox/lxde-pi-rc.xml for keybindings...';
fi;