本文介绍了了解三星电视的红外代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我了解如何在使用 ESP8266-HTTP-IR-Blaster 库的项目中使用 RAW IR 数据吗?

我已经根据 https 创建了一个带有 IR 发送器和接收器的 NodeMCU 板://github.com/mdhiggins/ESP8266-HTTP-IR-Blaster

一切正常,只要我使用捕获的代码,例如:http://NodeMCU-IP/msg?code=E0E040BF:SAMSUNG:32这是电源按钮的代码 (E0E040BF)

当我在家庭自动化系统中使用它时,如果我有一个专用的开和关序列,这对我来说非常有益,我在这里找到了:http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?5780 ,但无法通过 RAW 数据进行翻译、修改或发送.

使用Node-red,尝试了很多方法,也给原项目实现了一个MQTT客户端,但是我试了还是不接受这些代码.不发送.

也尝试作为 JSON,没有帮助.

[{"类型":"原始",数据":[0000, 006D, 0000, 0022, 00AC, 00AC, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 015, 015, 015, 015, 015, 015, 015, 00150015,0040,0015,0040,0015,0040,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0040,0015,0040,0015,0015,0015,0015,0015,0040,0015,0040,0015,0040,0015,0040,0015,0015,0015,0015,0015,0040,0015,0040,0015,0015,0015,0689]",赫兹":38}]

知道我接下来可以尝试什么吗?

解决方案

对您在上面展示的Pronto 格式"的一个很好的介绍位于 远程中心

对于上面的具体示例,对于 您的远程中央链接,完整代码以十六进制表示的 16 位数字序列给出,中间有空格:

0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 00150015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0015 0015 05 05 015 05 010 05 010 05 010 0015

您可以将其分解为序言(出于兴趣在此处分解,但如果您已经有可用的三星代码则不需要):

  • 0x0000 - 这是原始代码格式数据
  • 0x006D - 频率 109 十进制 = 38.028kHz(计算见上面的链接)
  • 0x0000 - 第一个序列中没有突发对
  • 0x0022 - 34 个十进制 - 34 个突发信号对
  • 00AC 00AC - 第一个信号突发 - 在 38kHz 下开启 0xAC(十进制 172)周期,关闭相同数量
  • 之后是 32 对数据突发对"(如果您已经拥有用于同一设备的其他代码,这可能是您唯一需要的数据)
  • 0015 0689 - 信号的最终突发 - 开启 0x15(十进制 21)周期,关闭 0x689(十进制 1673)周期,保证在没有任何 IR 的情况下有 44ms 的时间才能传输下一个代码

要手动解释数据,请以 8 个数字为一组复制(例如复制到文本编辑器中):

0015 0040 0015 0040 0015 0040 0015 00150015 0015 0015 0015 0015 0015 0015 00150015 0040 0015 0040 0015 0040 0015 00150015 0015 0015 0015 0015 0015 0015 00150015 0015 0015 0015 0015 0015 0015 00400015 0040 0015 0015 0015 0015 0015 00400015 0040 0015 0040 0015 0040 0015 00150015 0015 0015 0040 0015 0040 0015 0015

那么:

  • 忽略所有数字都相同的列(即使是上面的列,代表接通时间 - 0x15 = 38kHz 下 IR 的 21 个十进制周期)
  • 对于剩余的列(代表关闭时间),将大数字(在本例中为 0x40)替换为1",将小数字 (0x15) 替换为0".

对于第一行

0015 0040 0015 0040 0015 0040 0015 0015

忽略偶数列离开:

0040 0040 0040 0015

用1和0替换那些

1 1 1 0

如果你把它转换成十六进制,就是'E'

下一行是0",然后是E",然后是0"(看到它以与上面启动其他三星代码相同的 E0E0 开头,这已经很令人欣慰了...),剩下的几行就完成了E0E019E6

对 ON 代码做同样的事情会给你E0E09966

由于我最近需要针对相同的代码解决相同的问题,因此我可以确认我的三星电视对这些代码的响应为关闭和开启.

毫不奇怪,有各种各样的软件工具可以在格式之间进行转换,并且有大量的格式来描述相同的信号(xkcd).例如,irdb.tk 会将上述字符串解码为Protocol NECx2, device 7, subdevice 7, OBC 152".由您决定是否必须

  • 位反转设备号07"得到E0"
  • 位反转子设备号(也是07")得到E0"
  • 将 152 转换为十六进制并反转位以得到 '19'
  • 计算最后两位数字为 ( 0xFF - 位反转 OBC ),0xFF - 0x19 = 0xE6,给出最后 8 位'E6'

Can somebody help me to understand how could I use RAW IR data in an project using ESP8266-HTTP-IR-Blaster library ?

I've created a NodeMCU board with an IR sender and receiver according to https://github.com/mdhiggins/ESP8266-HTTP-IR-Blaster

Everything is working fine as long as I'm using the captured codes for ex.:http://NodeMCU-IP/msg?code=E0E040BF:SAMSUNG:32This is the Code for the Power button (E0E040BF)

As I'm using it in a home automation system, it would very beneficial for me if I had a dedicated ON and OFF sequence, which I found here: http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?5780 , but unable to translate, modify, or send it via RAW data.

Using Node-red, tried many ways, also implemented a MQTT client to the original project, but did not accept these codes anyhow I try. Does not sends it.

Also tried as a JSON, didn't help.

[
    {
    "type":"raw",
    "data":"[0000, 006D, 0000, 0022, 00AC, 00AC, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0689]",
    "khz":38
    }
]

Any idea what could I try next?

解决方案

A good introduction to the 'Pronto format' that you show above is at Remote Central

For the specific example above, for a Samsung OFF code given at your remote central link, the full code is given as a sequence of 16-bit numbers represented in hexadecimal with spaces in between:

0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689

You can break that down as a preamble (broken out here for interest, but not needed if you already have a working Samsung code):

  • 0x0000 - This is raw code format data
  • 0x006D - Frequency 109 decimal = 38.028kHz (see above link for calculation)
  • 0x0000 - No burst pairs in first sequence
  • 0x0022 - 34 decimal - 34 burst pairs of signal follow
  • 00AC 00AC - First burst of signal - on for 0xAC (172 decimal) cycles at 38kHz, off for the same amount
  • After that comes 32 pairs of data "burst pairs" (which is likely the only bit you need if you already have other codes for the same device)
  • 0015 0689 - Final burst of signal - on for 0x15 (21 decimal) cycles, off for 0x689 (1673 decimal) cycles, guaranteeing 44ms without any IR before the next code can be transmitted

To interpret the data manually, copy it out (e.g. into a text editor) in groups of 8 numbers:

0015 0040 0015 0040 0015 0040 0015 0015
0015 0015 0015 0015 0015 0015 0015 0015
0015 0040 0015 0040 0015 0040 0015 0015
0015 0015 0015 0015 0015 0015 0015 0015
0015 0015 0015 0015 0015 0015 0015 0040
0015 0040 0015 0015 0015 0015 0015 0040
0015 0040 0015 0040 0015 0040 0015 0015
0015 0015 0015 0040 0015 0040 0015 0015

Then:

  • Ignore the columns where all the numbers are the same (even columns above, which represent the on time - 0x15 = 21 decimal cycles of IR at 38kHz )
  • For the remaining columns (which represent the off-time), replace the big numbers (0x40 in this case) with '1' and the small (0x15) with '0'.

For the first line

0015 0040 0015 0040 0015 0040 0015 0015

ignoring the even numbered columns leaves:

0040 0040 0040 0015

replacing those with 1's and 0's

1    1    1    0

and if you convert that into hexadecimal, it's 'E'

Next line is '0', then 'E' then '0' (already it's comforting to see it starting with the same E0E0 that starts your other Samsung code above...), and the remaining lines make it E0E019E6

Doing the same with the ON code gives you E0E09966

And as I've needed to solve the same problem just recently for the same codes, I can confirm that my Samsung TV responds to those codes as OFF and ON.

Not surprisingly, there are a variety of software tools to convert between formats, and a huge range of formats to describe the same signal (explained very well by xkcd). For example, irdb.tk will decode the above string to "Protocol NECx2, device 7, subdevice 7, OBC 152". It's up to you to know that you have to

  • bit-reverse the device number '07' to get 'E0'
  • bit-reverse the subdevice number (also '07') to get 'E0'
  • convert 152 to hexadecimal and reverse the bits to get '19'
  • calculate the last two digits as ( 0xFF - the bit-reversed OBC ), 0xFF - 0x19 = 0xE6, giving the final 8 bits 'E6'

这篇关于了解三星电视的红外代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-20 16:45