本帖最后由 BG8HQE 于 2023-8-6 11:10 编辑
涂鸦UFO-R1遥控器小巧颜值高,关键这货用的ESP8266芯片,带一个遥控接收,带7颗阵列红外发射二极管,刷开源OpenMQTTGateway,通过MQTT服务器接入homeasstant,不像博联智能用于局域网,MQTT远程也可以用,遥控红外电器,实测效果非常好用。开源地址:https://github.com/1technophile/OpenMQTTGateway
默认端口不一样,需要自己修改编译
修改User_config.h文件一下图示两处,启用红外功能和homeasstant自动发现。
对涂鸦还需要修改config_IR.h红外接收端口为GPIO5,发射端口为GPIO14
然后焊接刷机即可
从图上看,TXD和RXD接到了MicroUsb端口的,也可以用MicroUsb改装串口线刷机,短接IO0即可
用Visual Studio Code加PlatfromIO编译
无条件编译的,也可以下载我编译好的固件,AP密码为888888,设置WIF密码和MQTT服务器即可使用,不好意思,对不起大家,密码是8个8,少写了两位
也可以链接MQTT服务器,订阅+/+/IRtoMQTT,按下遥控器,收到诸如以下信息{"value":83495159,"protocol":3,"bits":32,"hex":"0x4FA08F7","protocol_name":"NEC","raw":"9028,4408,638,486,644,490,638,508,620,510,622,508,620,1596,664,496,634,494,634,1622,638,1622,636,1616,644,1560,700,1618,642,494,634,1618,642,490,642,494,634,508,618,512,618,510,620,1622,638,486,642,486,644,496,632,1620,638,1620,640,1624,638,1618,642,492,634,1624,636,1622,636,1616,640"}
需要发射红外码,只需要向主题:"home/<网关名称>/commands/MQTTtoIR",网关名称替换为自己的网关
发送如下内容{"value":83495159,"protocol_name":"NEC"}即可 也可以发送RAW格式,请参考作者说明文档
附件
firmware.zip
(448.4 KB, 下载次数: 70)
20230806:这个只是一种实现方案,其实这个开源软件支持很多功能,红外只是一种,红外功能也比较强大,空调发送存在问题的,可以通过.globalcache数据库发送,据说是全球最大红外数据库,地址为https://irdb.globalcache.com/ ,可惜我没有注册成功,老是提示要选择我不是机器人,找遍了都没找到这个选项。以下是官方手册机器翻译原话:
通过MQTT从全球Caché数据库发送数据,以在红外信号上转换数据code1: sendir,1:1,1,38000,1,69,340,169,20,20,20,20,20,64,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,64,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,1544,340,85,20,3663
提取这部分代码: 38000,1,69,340,169,20,20,20,20,20,64,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,64,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,1544,340,85,20,3663
并将其发布到 MQTT,主题包含IR_GC: mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"raw":"38000,1,1,171,171,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,64,21,64,21,64,21,1114","protocol_name":"GC"}'
您应该能够在没有使用红外接收器收听的情况下指挥您的设备,或者如果您的协议被 IRremote 库未知
|