1.下载固件并刷写
链接: https://pan.baidu.com/s/1089UtfUyu2YvZ_xPYwTZ2Q 提取码: k43h 复制这段内容后打开百度网盘手机App,操作更方便哦
红外库编译教程视频
https://www.bilibili.com/video/BV1qp4y1e7Uw?from=search&seid=11460441410395343384
https://gitpod.io/#https://github.com/benzino77/tasmocompiler
2.设置红外接口
3.遥控录码
开启录码命令 控制台输入
SetOption58 1 [手动输入,别复制进去,容易失败]
成功提示
06:32:34 MQT: loog/IR/RESULT = {“SetOption58”:“ON”}
遥控器对着红外接收头按下,控制台会反馈信息
09:04:14 MQT: loog/IR/RESULT = {“IrReceived”:{“Protocol”:“UNKNOWN”,“Bits”:50,“Data”:“65990CA7”,“RawData”:[8970,4576,504,1738,504,1740,504,656,502,658,502,658,502,620,504,658,502,1740,504,658,476,1768,502,1738,476,682,506,608,504,656,502,658,476,682,504,656,504,656,504,1738,478,684,504,654,506,654,504,654,504,654,506,656,482,1762,480,684,478,684,478,1764,488,1756,506,1708,478,682,480,680,478,686,480,682,480,680,478,680,478,684,476,682,480,682,478,682,478,708,452,712,452,710,452,668,344,758,448,712,450,706,454],"RawDataI …
复制RawData值 前面加个0,才能发送成功
0,8970,4576,504,1738,504,1740,504,656,502,658,502,658,502,620,504,658,502,1740,504,658,476,1768,502,1738,476,682,506,608,504,656,502,658,476,682,504,656,504,656,504,1738,478,684,504,654,506,654,504,654,504,654,506,656,482,1762,480,684,478,684,478,1764,488,1756,506,1708,478,682,480,680,478,686,480,682,480,680,478,680,478,684,476,682,480,682,478,682,478,708,452,712,452,710,452,668,344,758,448,712,450,706,454
注意mqtt消息中几个JSON元素,
“Bits”:196 196代表红外信号的比特率
“RawData”:[xx,xx,xx,xx,xx,xx],就是我们接收到的原始红外码,用作后续的红外发送
“RawDataInfo”:[391,391,0],这个是校验码,如果前面2个参数必须一样,记住这两个参数,测试发射的时候还会用上,具体参数的意义参考Theo的原文
https://github.com/arendst/Sonof … uecomment-440716483
4.发送红外代码
使用mqtt发送红外raw data,叉叉就是上面咱们收到的RawData里面的内容,0代表38kHz的发射频率,这里使用0即可
cmnd/sonoff/IRSend 0,xxx,xxx,xxx
如果进行的顺利会再收到2条mqtt消息,一条代表发送成功,如下所示
stat/sonoff/RESULT {“IRSend”:“Done”}
Tasmota固件
github.com
ESP1S设置
电机设置