Update your OpenWRT image
Pull down the fw image plug-update-irtest.bin from Github:
and transfer the resulting image to your Plug and upgrade the firmware, as described here (skip the part about building the image since we are supplying a pre-built image for the time being):
Turn off Alljoyn mode (optional)
In this version of the image, Alljoyn mode is enabled by default. This won't affect you unless you do a factory reset on your Plug. If you do, then you'll notice that the default SSID of the Plug is back to AJ_OpenWRT-something. It's not a big issue, since you can connect anyway. If you wish to disable Alljoyn mode, then after rebooting, enter the folowing command in your SSH terminal on the Plug:
chmod a-x /etc/init.d/allj*
This simply keeps the Alljoyn programs from running.
This image probably also has an issue with spaces in the SSID as that was fixed afterwards. We are working to get everything current in Github, so this fw image is temporary to get you going with IR Blaster development.
This should not affect you if your Plug is already attached to your home Wi-Fi network and you don't do a factory reset.
Get the IR executable and database
Please send me (Funkanzan) a private message with an e-mail I can use to send you the IR codes database and executable file. This information is proprietary and so I am not able to post it publicly at Github.
Save the ZIP file which contains the IR executable as well as the IR code database to your computer.
Copy the IR executable to the Plug (e.g. using SCP or wget), make it executable, and make sure it is in /usr/bin.
Example showing use of wget, assuming that web server where the ir binary was saved is at 192.168.2.67:
chmod +x ir
Install stty and set the baud rate
opkg install coreutils-stty
stty -F /dev/ttyS0 115200
stty -F /dev/ttyS0 115200
may need to be executed each time the plug reboots.
Test the IR executable
Check the IR version and revision.
root@OpenWrt:~# ir version
root@OpenWrt:~# ir revision
If you wish to confirm that the blaster LED is working, you can put it into a test loop.
ir loopsparkle 2
will flash the IR LED once very two seconds. You can use the camera mode of many cell phones (except newer iPhones which block IR), or a digital camera in preview mode pointed at the IR Blaster LED to check that it flashes briefly at the interval given. Hit control-C to terminate this test loop.
Finding the IR data for a particular brand and model of AV equipment
Open the supplied database file in an SQLIte database browser. For this example I am showing the sqlitebrowser application for Mac OS/X. This application also offers Windows and Linux versions (which I did not test).
Choose the tbBrandId table and select "Browse Data".
Scan down until you find the brand name you are looking for. For some reason I was not able to use the "Filter" on the brandName column to quickly find the TOSHIBA entry, which I am using (a Toshiba TV). Note the brandId for TOSHIBA is 3602.
Now you'll need to find all codeNums associated with the TOSHIBA brandId, which are in the tbCodeList_AV table. These correspond to all the possible models which Toshiba has made. You may have to try multiple codeNums to find one that works with your specific device. In this case, I got lucky and the first codeNum of 11 worked OK.
Now look up the keycode you wish to use in the tbKeyList_AV table. Here I am using the POWER key. Access the tbKeylistAV table and find the function under the keyLabel12 column. Note the keyId associated with this key label, or 1.
With the codeNum of 11 and keyId of 1, now go to the tbIrData_AV table and double click on the irData field.
This opens a dialog that allows you to copy the entire IR Data entry.
Now go back to your SSH session connected to the Smart Plug, and start typing the command:
then paste the IR data previously copied to complete the command line. Press enter and the IR data will be sent.
Note that while the database includes tables both AV (Audio-Video) and AC (Air Conditioner) code information, only tables for AV codes actually have any data in them.