An IR signal sender using ESP-WROOM-02.
This works as a web server and can send IR signal via Web APIs. The base URL is http://myesp8266.local:8080 as default and the method of each API is GET.
Path and query parameters | |
---|---|
/ir/aircon?power=...&mode=...&temp=...fan=...&swing=... | Send IR signal to control an air conditioner |
/ir/sony?value=...&bits=...&repeat=... | Send IR signal for Sony devices |
/ir/panasonic?value=...&bits=...&repeat=... | Send IR signal for Panasonic devices |
/ir/nec?value=...&bits=...&repeat=... | Send IR signal for NEC devices |
/temp | Get temperature in Celsius |
/press | Get pressure in Pascals |
/version | Get version information |
- Available query parameters
- power:
off
oron
- mode:
auto
(default),heat
,cool
,dry
, orfan
- temp: integer
18
–30
(default is24
) - fan:
auto
(default),level1
,level2
,level3
,level4
,level5
, orsilent
- swing:
swing
(default),up
,upmiddle
,middle
,downmiddle
, ordown
- value: hexadecimal (ex)
A50
- bits: integer
1
–64
(default is20
for Sony /48
for Panasonic /32
for NEC) - repeat: integer
0
–8
(defualt is2
for Sony /0
for otherwise)
- power:
- ESP-WROOM-02
- Temperature sensor: GY-BMP280-3.3
- LDO module (3.3V): M-3V3SIP
- IR LED: OSI5FU5111C-40
- NPN Transistor (hFE 280–560): 2SC536-G
- Electrolytic capacitor: 10µF
- Resistors: 10kΩ×7, 8.2kΩ×1, 22Ω×1
- Wires, connectors, switches, etc...
Clone the source code and open the project file "ESP8266SmartRemocon.ino" with Arduino IDE.
You must import ESP8266 board.
This sketch depends on following libraries. (You can add these by library manager)
You must modify "credential.h" according to your situation.
HOSTNAME
andPORT
if you like.- The URL to get version information will be http://myesp8266.local:8080/version if you don't modify.
STA_SSID
andSTA_PASSWORD
according to your Wi-Fi access point setting.- If you'd like to assign static IP address to the device, uncomment
#ifdef STATIC_ADDRESS
and editstaticIP
,gateway
,subnet
anddns
.
- If you'd like to assign static IP address to the device, uncomment
You can build the source code with following configuration.
- Board: "Generic ESP8266 Module"
- Builtin Led: "2"
- Upload Speed: "115200"
- CPU Frequency: "80 MHz"
- Crystal Frequency: "26 MHz"
- Flash Size: "4MB (FS:3MB OTA:~512KB"
- Flash Mode: "DOUT (compatible)"
- Flash Frequency: "40 MHz"
- Reset Method: "dtr (aka modemcu)"
- Debug port: "Disabled"
- Debug Level: "None"
- lwIP Variant: "v2 Lower Memory"
- VTables: "Flash"
- Exceptions: "Legacy (new can return nullptr)"
- Erase Flash: "Only Sketch"
- Espressif FW: "nonos-sdk 2.2.1+119 (191122)"
- SSL Support: "Basic SSL ciphers (lower ROM use)"
Then, you can transfer the firmware binary data to ESP-WROOM-02 by any means.
The top level path of URL is mapped to the root directory of file system. Therefore you can customize static HTML files if you transfer the file system binary data.
I provide the sample HTML files that can call /ir/aircon API with GUI. (See "data" directory)
These codes are licensed under MIT License.