项目作者: pezinek

项目描述 :
IR Blaster for ESP8266
高级语言: C++
项目地址: git://github.com/pezinek/ir_blaster.git
创建时间: 2017-02-08T12:04:10Z
项目社区:https://github.com/pezinek/ir_blaster

开源协议:

下载


WiFi IR Blaster for ESP8266

This is simple infrared sender/receiver controlled over MQTT.
It uses the Homie MQTT convention
and is based on Homie implementation for ESP8266 by
Marvin Roger.

Wiring diagram

The wirring bellow is the one I used and worked for me.
You will likely need to adjust the
resistor sizes based on the voltage drop and max current for your IR diodes.
The transistor is general purpose NPN transistor (I used BSY34)

wiring

Instalation

I recommend to use platformio which will resolve all the dependencies for you,
but to compile this sketch in Arduino IDE you have to manually install follwing libraries:

as well I recommend to install the Homie UI Bundle
to data/homie folder.
To upload the UI bundle you have to follow SPIFFS upload process
if using PlatformIO or if you use Arduino IDE you may use arduino-sep8266fs-plugin.

Once you upload the sketch, you have to configure the node as described in Homie Getting Started Tutorial
(this is where you device gets device id assigned)

Interface

  • To listen for received IR codes, subscribe to MQTT topic homie/<deviceid>/infrared/code:
  1. $ mosquitto_sub -h 192.168.1.50 -v -t 'homie/5ccf7fd38d01/infrared/code'
  2. homie/5ccf7fd38d01/infrared/code {"name":"UNKNOWN: 0x42D74094","value":1121403028,"frequency":38,"type":{"id":-1,"name":"UNKNOWN"},"raw":[9100,4600,600,650,600,1750,600,1750,600,1750,600,650,600,1750,600,1750,600,1750,600,1750,600,1750,600,1750,600,650,600,650,600,650,600,650,600,1800,600,650,600,650,600,1750,600,650,600,650,600,650,600,650,600,650,600,1750,600,1750,600,650,600,650,600,1750,600,1750,600,650,600,650,600]}
  • To send IR codes, publish to MQTT topic homie/<deviceid>/infrared/code/set:
    1. mosquitto_pub -h 192.168.1.50 -t 'homie/5ccf7fd38d01/infrared/code/set' -m "{"frequency":38,"raw":[900,900,1800,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,900,1800,900]}";