We get started with the Sparkfun WRL-15031. The hook-up guide is a good place to start. I am using the IR Controller ESP8266 firmware.
I don’t have PlatformIO installed so I used the standard Arduino IDE. This was my first time with the ESP8266 so I needed to add the ESP8266 Arduino Core. In the current Arduino IDE this can be done by adding https://arduino.esp8266.com/stable/package_esp8266com_index.json
to the File>Preferences>Additional Boards Manager URLs field of the Arduino IDE. Then using the Board Manager from the Tools > Board menu you can install the esp8266 platform.
Once you have the IDE installed and the board set to Generic ESP8266 you need to make sure you have some libraries installed. ESP8266WebServer
, ESP8266WiFi
and WiFiManager
but you may need to install ArduinoJson
, Time
and IRremoteESP8266
.
It’s time to load the sketch, compile and upload.
The key here is to make sure you set the IO pin definitions correctly.
const int pinr1 = 13; // Receiving pin
const int pins1 = 4; // Transmitting preset 1
const int pins2 = 12; // Transmitting preset 2
const int pins3 = 12; // Transmitting preset 3
const int pins4 = 12; // Transmitting preset 4
const int configpin = 0; // Reset Pin
const int ledpin = 5;
I changed getExternalIP = false;
and removed the user_id
related and Alex integration code. I set ntpServerName
to my internal NTP server. I changed the ntp sync time from 5 minutes to 12 hours near the end of the setup()
function: setSyncInterval(43200);
.
Once the code is compiled and loaded some testing is needed. On the initial run the ESP will be in AP mode with a SSID of IR Controller Configuration
. You can connect and set access point info, hostname, static IP, subnet mask, port, default gateway and passcode.
Once you’re able to connect it is time to find some IR codes. There is a bit of good info in the Tasmota IR page. I found Sony DVD player remotes and some of the IR controlled LED votive candles. There is also good info for Samsung and Vizio TVs online. The codes from http://remotecentral.com often need to be manipulated before they are compatible with the ESP IR library. I created a Excel spreadsheet with worksheets for Vizio, Sony and Samsung.
Once we have the codes we can start controlling things from the web. For example:
http://someip:port/msg=msg?code=E0E040BF:SAMSUNG:32&pass=1234&simple=1
will send a power on/off command of 32 bits in SAMSUNG format. After testing a bit of this I created a simple webpage to send a variety of codes.
There is more Arduino IR blaster info at Ken Shirriff’s blog – post 1 and post 2. For more info on Sony codes refer to https://www.sbprojects.net/knowledge/ir/sirc.php and http://www.hifi-remote.com/sony/.
For the record: Toshiba remote: SE-R0047, Vivio Remote unmarked, Sony Remote RMT-B119A, JVC Remote: RM-S212U.