Copernicus
|
2013-06-06
, 16:23
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#11
|
|
2013-06-07
, 01:19
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#12
|
Actually, I'm kind of late to the game with this. The LIRC server has apparently had support for this particular gadget for some years. (Of course, this also means that Irreco & co. have as well, as they are all using the LIRC server.)
So, in short, your N900 can already control it.
Let me see if I can't get the same support into Pierogi. I can probably get the software to you faster than you can get the hardware to me...
The Following 4 Users Say Thank You to Estel For This Useful Post: | ||
|
2015-05-28
, 02:06
|
Posts: 68 |
Thanked: 113 times |
Joined on Sep 2014
|
#13
|
The Following 4 Users Say Thank You to Swordfish II For This Useful Post: | ||
|
2015-05-28
, 02:30
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#14
|
Hey Copernicus did you ever end up converting pierogi files to audio to support this?
|
2015-05-28
, 12:03
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#15
|
The trick is just to create an audio waveform that matches the carrier signal being used by the remote (most often, this is something like a 38 kHZ frequency).
The Following 3 Users Say Thank You to pichlo For This Useful Post: | ||
|
2015-05-28
, 16:43
|
Posts: 68 |
Thanked: 113 times |
Joined on Sep 2014
|
#16
|
The Following 2 Users Say Thank You to Swordfish II For This Useful Post: | ||
|
2015-05-28
, 17:47
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#17
|
One question that maybe you could answer for me, Going through the LIRC database I see two different formats if you will. In one (usually in LIRC 0.6 or earlier) codes are very long, like this:
KEY_1 0x0000000000000144 # Was: 1
But in the newer LIRC format (usually 0.8 or higher) codes are expressed like this:
KEY_1 0x8877 # Was: ONE
Audio encoded as is, I know the top format works (tested it on my tv), but I am not sure the bottom format works...is the bottom format a shorthand to get rid of all those zeros?
begin remote name LG_MKJ61842704_TV bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 header 9069 4455 one 597 1651 zero 597 531 ptrail 591 repeat 9055 2222 pre_data_bits 16 pre_data 0x20DF gap 108123 toggle_bit_mask 0x0 begin codes ... KEY_1 0x8877 ... end codes end remote
As a side note, if you would like to add this to pierogi, I am willing to share my audio files (and would like to convert your files for my own personal use, not for distro)
The Following 2 Users Say Thank You to Copernicus For This Useful Post: | ||
|
2015-05-28
, 21:16
|
|
Posts: 435 |
Thanked: 684 times |
Joined on Apr 2012
@ Netherlands 020
|
#18
|
The Following 3 Users Say Thank You to jellyroll For This Useful Post: | ||
|
2015-05-28
, 21:49
|
Posts: 68 |
Thanked: 113 times |
Joined on Sep 2014
|
#19
|
Hmm. I don't knand how it convertsow much about earlier versions of LIRC; but, for most config files, the value provided for the key is the "code" that gets sent in the command. I don't really see how you can translate "0x0000000000000144" directly into an audio file that does something to your TV; you need to have the additional info at the top of the LIRC file in order to decipher how the command is encoded as IR pulses. For example, an LG tv config file will have something like this:
You can read this as follows:Code:begin remote name LG_MKJ61842704_TV bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 header 9069 4455 one 597 1651 zero 597 531 ptrail 591 repeat 9055 2222 pre_data_bits 16 pre_data 0x20DF gap 108123 toggle_bit_mask 0x0 begin codes ... KEY_1 0x8877 ... end codes end remote
Bits: this remote sends 16 bits of "command" data for each key pressed. Flags: the bits are "space encoded", meaning that the value of each bit (zero or one) is determined by the length of time the IR led is on or off; "constant length" means that, regardless of how long a single sequence of bits takes to finish, the next sequence will start at a fixed time after the start of the current one. (The "eps" and "aeps" values are only of interest when receiving commands, so I generally ignore them.)
The "header" specifies that, before any bits are sent, the LED should be left on for 9069 uSec, and off for 4455 uSec. (These are values determined by LIRC's "irrecord" utility off of a physical remote control; they may vary from the official timings for this protocol, but probably not enough to matter.) The "one" specifies that the binary bit "1" is sent by turning the IR on for 597 uSec and off for 1651 uSec, and the "zero" specifies that a "0" bit is on for 597 uSec and off for 531 uSec. (Again, these are a bit off from the official values, but close enough not to matter.) Finally, after the entire sequence has been sent, a last "on" pulse of 591 uSec is sent, and then the IR is kept off until the next sequence starts.
(The "repeat" value describes a special feature of the NEC protocol, which I'll skip here.)
The "gap", in this case, describes the amount of time, in uSec, between the start of one full sequence of pulses and the start of the next. (If the "CONST_LENGTH" flag hadn't been set, the gap would be the time from the end of one sequence to the beginning of the next.)
Now, we get to the interesting part. Before we start sending the "command" bits, we need to send the "device" bits. In this case, these are the 16 bits of "pre_data". In hexadecimal, they are shown as 0x20DF; so, in binary, that should be 0010000011011111. For each of these bits, you would now turn the LED on and off corresponding to the on/off times defined above.
Then, you can now send the command for the key. In this case, KEY_1 is 0x8877; which, in binary, should be 1000100001110111. Again, these get converted to IR timings using the values for 1 and 0 defined above.
So, in total, the IR should be flipped on and off once for the header, thirty-two more times for all the "device" and "command" bits, then flipped on once more for the trailing bit and then turned off until the next command starts.
Thanks! But, I don't think there is really a question of maintaining individual audio files here; both the LIRC and Pierogi construct their timing strings dynamically as needed. It'd be awfully unwieldy otherwise! All I really need to do is set up Pierogi to switch that particular sound on and off (in a precise enough manner to match the LED timings); everything else should fall into place after that...
The Following User Says Thank You to Swordfish II For This Useful Post: | ||
|
2015-05-28
, 21:53
|
Posts: 68 |
Thanked: 113 times |
Joined on Sep 2014
|
#20
|
The Following User Says Thank You to Swordfish II For This Useful Post: | ||
Tags |
ir transceiver, nokia n900 |
Thread Tools | |
|