Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to test the infrared reception of Cubieboard

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Cubieboard built-in infrared reception how to test the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this Cubieboard built-in infrared reception how to test the article will have a harvest, let's take a look.

First of all, you need to have your own compiled sun4i-ir.ko driver, but it seems to come with the default compiler, so every version of the kernel you use should already have a driver, but it may not be loaded automatically. Check your own lsmod to see if there is any. If not, go to the driver directory to insmod (insmod / lib/modules/3.0.57+ (change 3.0.57 + to your kernel version) / kernel/drivers/input/keyboard/sun4i-ir.ko).

First, take a look at the driver information, and the location where it was loaded:

If it is correct, it can be used directly.

To emphasize: please use the TV remote control at home to test, because I have tried the air conditioning remote control, because the frequency is wrong, can not receive, no response at all.

First look at where the infrared receiving device is loaded, it is actually loaded as a keyboard device, when the information is received, it will generate system events, so we just need to look at the events generated by this device. Well, it's input1. After testing, the system path of the event should be in / dev/input/event1.

Now let's look at the decoded data directly on the command line, because a bunch of binary 0101 is garbled on the command line, so I use hexdump to convert it to hexadecimal view.

See, this is the message you received. After you buy a remote control and record the information of each key, you can write a program to monitor these signals and realize the remote control board to control CB. Haha.

Finally, I would like to explain the signal interpretation of my guess, such as:

00003f0 0b7f 0000 312b 0007 0000 0000 0000

0000400 0b7f 0000 861b 000a 0001 005b 0001 0000

0000410 0b7f 0000 8621 000a 0000 0000 0000

0000420 0b80 0000 a199 0000 0001 005b 0000 0000

0000430 0b80 0000 a19e 0000 0000 0000

0000440 0b80 0000 d641 0005 0001 005b 0001 0000

0000450 0b80 0000 d646 0005 0000 0000 0000

0000460 0b80 0000 502c 000b 0001 005b 0000 0000

0000470 0b80 0000 5031 000b 0000 0000 0000

0000480 0b81 0000 6b30 000b 0001 005b 0001 0000

0000490 0b81 0000 6b36 000b 0000 0000 0000

00004a0 0b82 0000 8c76 0001 0001 005b 0000 0000

00004b0 0b82 0000 8c7b 0001 0000 0000 0000

00004c0 0b82 0000 6927 0009 0001 005b 0001 0000

00004d0 0b82 0000 692c 0009 0000 0000 0000

00004e0 0b82 0000 d320 000e 0001 005b 0000 0000

00004f0 0b82 0000 d325 000e 0000 0000 0000

0000500 0b84 0000 6dc5 0005 0001 005b 0001 0000

0000510 0b84 0000 6dcb 0005 0000 0000 0000

0000520 0b84 0000 dbd7 000a 0001 005b 0000 0000

0000530 0b84 0000 dbdc 000a 0000 0000 0000

This is the message I get from repeatedly pressing and releasing the same key. first of all, it can be confirmed that when you press a key, it will produce a set of signals, and when your infrared moves out of the receiving range of the IR or release the button, another set of signals will be generated.

I'm going to intercept four of these signals for analysis:

00004c0 0b82 0000 6927 0009 0001 005b 0001 0000 # these two lines are generated when you press for the first time

00004d0 0b82 0000 692c 0009 0000 0000 0000

00004e0 0b82 0000 d320000e 0001 005b 0000 0000 # these two lines are generated when they are released for the first time

00004f0 0b82 0000 d325 000e 0000 0000 0000

0000500 0b84 0000 6dc5 0005 0001 005b 0001 0000 # these two lines are generated on the second press

0000510 0b84 0000 6dcb 0005 0000 0000 0000

0000520 0b84 0000 dbd7 000a 0001 005b 0000 0000 # these two lines are generated when the second release

0000530 0b84 0000 dbdc 000a 0000 0000 0000

First put aside the first column (the red part), which is the memory address of the decoded signal printed out by hexdump.

The second column, should be each press and release is the same value, the second press will be + 2, then we can understand as each press the signal of the self-increasing ID, if multiple remote controls are sending a signal to him, you can receive the signal will not be chaotic, because a press and release of the value is always the same.

The third column, I don't know, could be an extension of the second column, or the beginning of the fourth column (first half)

Columns 4 and 5, I don't understand. It's all the same key. These changing data must have nothing to do with the value of the key.

Every time you press the same key, the same part is the next four columns. And when I press all the keys, the second row of each group (two rows) and the last four columns are always 0. 0.

So can it be understood as the last four columns of the first row of each set of data:

0001 005b 0001 0000 means that the xx key on my remote control is pressed

0001 005b 0000 0000 means that the xx on my remote control is pressed and released

Then 0001 005b represents the identifier of my key, and 0001 0000 indicates that 0000 0000 is pressed and released.

If you think about it further, changing the 0x10000 to a decimal system is 65536. No one would use 65536 for pressing and 0 for letting go, right?

So the last four zeros should not be cared about, and there may be other uses, then 0001 should indicate that it is pressed and 0000 means to let go.

This is the end of the article on "how to test the infrared reception of Cubieboard". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to test the infrared reception of Cubieboard". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report