pypilot can optionally be controlled through any IR remote control, such as TV remotes.
This requires an IR sensor wired to the autopilot computer.
If you are using tinypilot and have the autopilot computer, the ir sensor is already configured and wired to gpio pin 4. These instructions assume tinypilot. If using openplotter or another distribution, use the correct system command (eg: sudo service lirc stop) rather than “sudo sv d lircd”
To calibrate and add a new type of remote, first ssh into the raspberry or otherwise access a terminal. From here you will need to stop lirc if it is running:
$ sudo sv down lircd $ sudo killall lircd
To test the remote:
$ sudo mode2 -d /dev/lirc0
press buttons on the remote and look for output to see the remote is working.
Now run irrecord to configure the keys
$ sudo irrecord -d /dev/lirc0 test.conf
If there already is a remote control of the same brand available at http://www.lirc.org/remotes/ you might also want to try using such a remote as a template. The config files already contain all parameters of the protocol used by remotes of a certain brand and knowing these parameters makes the job of this program much easier. There are also template files for the most common protocols available in the remotes/generic/ directory of the source distribution of this package. You can use a template files by providing the path of the file as command line parameter. Please send the finished config files to <email@example.com> so that I can make them available to others. Don't forget to put all information that you can get about the remote control in the header of the file. Press RETURN to continue. Now start pressing buttons on your remote control. It is very important that you press many different buttons and hold them down for approximately one second. Each button should generate at least one dot but in no case more than ten dots of output. Don't stop pressing buttons until two lines of dots (2x80) have been generated. Press RETURN now to start recording. ................................................................................ Found const length: 178418 Please keep on pressing buttons like described above. ................................................................................ Space/pulse encoded remote control found. Signal length is 43. Found possible header: 526 5050 Found trail pulse: 533 No repeat code found. Signals are space encoded. Removed header. Signal length is 21 Now enter the names for the buttons. Please enter the name for the next button (press <ENTER> to finish recording) KEY_LEFT Now hold down button "KEY_LEFT". Please enter the name for the next button (press <ENTER> to finish recording) KEY_RIGHT Now hold down button "KEY_RIGHT". Please enter the name for the next button (press <ENTER> to finish recording) KEY_UP Now hold down button "KEY_UP". Please enter the name for the next button (press <ENTER> to finish recording) KEY_DOWN Now hold down button "KEY_DOWN". Please enter the name for the next button (press <ENTER> to finish recording) KEY_POWER Now hold down button "KEY_POWER". Please enter the name for the next button (press <ENTER> to finish recording) KEY_MUTE Now hold down button "KEY_MUTE". Please enter the name for the next button (press <ENTER> to finish recording) KEY_SELECT Now hold down button "KEY_SELECT". Please enter the name for the next button (press <ENTER> to finish recording) Checking for toggle bit mask. Please press an arbitrary button repeatedly as fast as possible. Make sure you keep pressing the SAME button and that you DON'T HOLD the button down!. If you can't see any dots appear, then wait a bit between button presses. Press RETURN to continue. .............................. No toggle bit mask found. Successfully written config file.
Inspect the generated file
If you see “begin codes” then the recording is done.
If you see “begin raw_codes” then you will have to run the calibration several times and repeat the keys until you record 2 different codes for each key. From here, manually edit the config file to list both of the codes for each key. The /etc/lircd.conf has an example of a remote that uses raw codes.
Now append this remote to the config file
tc@box:~$ cat test.conf /etc/lircd.conf > lircd.conf tc@box:~$ sudo cp lircd.conf /etc/lircd.conf
Start lircd back up
$ sudo sv up lircd $ sudo sv restart pypilot_lcdclient
Verify the new remote works.
Store the changes for next reboot (tinypilot)
$ filetool.sh -b