JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Conversion of pronto hex codes to lirc codes
Goto page 1, 2  Next
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Beginners
View previous topic :: View next topic  
Author Message
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Fri Feb 27, 2004 12:40 pm    Post subject: Conversion of pronto hex codes to lirc codes Reply with quote

Hello,

I have codes in pronto hex format, which I want to convert to lirc raw codes. Does anybody know how to do it?
Back to top
View user's profile Send private message
jon_armstrong
Expert


Joined: 03 Aug 2003
Posts: 1238
Location: R.I.P. 3/25/2005

PostPosted: Fri Feb 27, 2004 12:54 pm    Post subject: Reply with quote

Why don't you post them and we can probably tell you what they are and if they already exist in the LIRC library.

There is a hex generator, GenIRDB that can also generate cde files for the NIRVIS sLinke. There is apparently a conversion utility from cde files to LIRC, since many files in the LIRC library apparently came from the sLinke library.

Several of us have decoded commands from the LIRC and can probably figure out how to do the reverse if GenIRDB doesn't work.
_________________
-Jon
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Fri Feb 27, 2004 2:04 pm    Post subject: Reply with quote

Thank you for your reply. I couldn't find any useful information about GenIRDB. I'm an absolute beginner to this subject, what are cde files? Also, I can only use Linux utilities.

These are the Pronto hex codes (which I want to transmit to my Sony DVD Player):

Device Code: 26.73 Function: 127
0000 0068 0000 0015 0060 0018 0030 0018 0030 0018 0030 0018 0030 0018 0030 0018 0030 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 01AE

Device Code: 26.73 Function: 101-Angle
0000 0068 0000 0015 0060 0018 0030 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 01F6

Device Code: 26.73 Function: 85-Video Off
0000 0068 0000 0015 0060 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 01F6

Device Code: 26.73 Function: 95-SACD/CD
0000 0068 0000 0015 0060 0018 0030 0018 0030 0018 0030 0018 0030 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 01C6

Device Code: 26.73 Function: 21-Power Toggle
0000 0068 0000 0015 0060 0018 0030 0018 0018 0018 0030 0018 0018 0018 0030 0018 0018 0018 0018 0018 0018 0018 0030 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 020E

I would be interested how these codes work, but I was unable to find anything useful about it on the Internet.
Back to top
View user's profile Send private message
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Fri Feb 27, 2004 2:26 pm    Post subject: Reply with quote

You probably already know those are standard Sony DVD commands.

I don't know one Sony model number from another, so I don't know which of these:
http://lirc.sourceforge.net/remotes/sony/

are DVD's, but I assume several are.

So you can just grab the completed lirc data from there rather than do any translation.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Fri Feb 27, 2004 2:36 pm    Post subject: Reply with quote

I tried an obvious choice and was right on first guess:
http://lirc.sourceforge.net/remotes/sony/DVP-S505

The key to understanding it is that the bits are backwards.

That file says
post_data_bits 13
post_data 0xB92

If you convert B92 to binary as 13 bits it is 0 1011 1001 0010
You then need to break it into a 5 bit part an an 8 bit part and reverse each: 11010 and 01001001
Convert to decimal and you get 26 and 73, just as in your decoded pronto hex.

Similary, the POWER command is in that file as 0x0000000000000054

It is identified as 7 bits, so it is 101 0100. Turn that backwards to
0010101, which is 21 decimal, which is the power toggle, both in your decoded data and the best source of such info
http://www.anycities.com/rhm5757/Sony_dvd.htm

So any commands you want that are missing from that lirc file, just get the command number from RHM's site and turn the 7 bits backwards and add a line to the Lirc file.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Fri Feb 27, 2004 8:00 pm    Post subject: Reply with quote

Thank you for your good explanation, it helped me a lot, but I still need some time before I can try it out.
For what do I need the other codes (below the Device Code and Function)? How to convert them?
Back to top
View user's profile Send private message
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Fri Feb 27, 2004 8:18 pm    Post subject: Reply with quote

guest wrote:

For what do I need the other codes (below the Device Code and Function)? How to convert them?


You don't need them.

The code information you posted was redundant. The device.subdevice and function information (plus the protocol name, which we assume is Sony20) fully describes the signal. The thing below that was the same information encoded in Pronto Hex.

If you just had the ProntoHex, you could use a program called IrTool to get the protocol, name, device, subdevice, and function. If you had those others and wanted the Pronto Hex, you could use a Program called MakeHex (which I assume was used by the person you were quoting, who posted those commands in some other forum).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Sun Feb 29, 2004 6:30 am    Post subject: Reply with quote

I finally got lirc to work. When I try to send an IR signal to my DVD Player (which is a DVP-NS400D, the remote model is a RMT-D128P, but I'm actually not interested in sending signals that are supportet by my remote, rather signals to make my DVD Player region code free), the LED of my IR transmitter blinks. Therefore, I assume that the hardware works as well (the IR diode is new), but nothing happens with my DVD Player (for instance, I can't turn it on by sending the Power Toggle function described above). Do I maybe have use raw codes in the lircd.conf file? Any suggestions?
Back to top
View user's profile Send private message
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Sun Feb 29, 2004 7:06 am    Post subject: Reply with quote

Is your lirc hardware set up for only sending IR, or is it able to capture IR?

The commands you found somewhere are Sony DVD commands using the primary Sony DVD code set. But do we know for sure that this is the code set your Sony DVD uses? Maybe it uses one of the other three documented on the that page of RHM's site I linked above.

You could edit that lirc config file I linked for each of the three other device codes and try them. If the device code is the only mistake, you could solve it that way. But if there is more than one mistake you need a more systematic approach. If you can capture any signals from the original remote to lirc and post the details (or email the lirc config file to me) I can decode the results and see which Sony config file it is.

Were you using the config file I linked to above or something else? Did you edit it or try its power toggle without editing?

What lircd.conf file are you talking about above and what does "raw codes" refer to? (The only things I knoe about lirc are what I have deduced from the config files posted for devices I recognises).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Sun Feb 29, 2004 8:29 am    Post subject: Reply with quote

My IR transmitter is not able to receive IR signals, so unfortunately I can't capture any signals from the DVD Player remote control.
Below is the lirc config file (lircd.conf). I changed the "post_data" command to match the other three device codes according to your explanation (e.g. convert 34 to binary, reverse all 8 bits and take the hexadecimal number). Code 5 in the config file represents the Power Toggle function. A raw code is the "raw" description of a signal as far as I know, see also: http://winlirc.sourceforge.net/technicaldetails.html

begin remote
name DVD
bits 7
flags SPACE_ENC
eps 20
aeps 200

header 2400 600
one 1200 600
zero 600 600
post_data_bits 13
post_data 0xB92
gap 25000
min_repeat 2
toggle_bit 0
frequency 40000

begin codes

1 0x000000000000007f
2 0x0000000000000053
3 0x0000000000000055
4 0x000000000000007d
5 0x0000000000000054

end codes

end remote
Back to top
View user's profile Send private message
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Sun Feb 29, 2004 10:06 am    Post subject: Reply with quote

guest wrote:
I changed the "post_data" command to match the other three device codes according to your explanation


I assume you mean 26.34, 26.250, and 26.18 from RHM's page

26.34 = 11010 00100010
reversing to 0 1011 0100 0100 = B44

26.250 = 11010 11111010
reversing to 0 1011 0101 1111 = B5F

26.18 = 11010 00010010
reversing to 0 1011 0100 1000 = B48

You didn't specifically say, but I assume you tried them one at a time and none worked.

guest wrote:

A raw code is the "raw" description of a signal as far as I know, see also: http://winlirc.sourceforge.net/technicaldetails.html


I read that description. I'm still not sure which level of "raw" that means. But either way it couldn't help here. If we know what Sony signal we want, we can fully specify it using the regular (not raw) syntax. If the signals is something else (something strange enough to need raw syntax) then we don't know (without an IR capture from the original remote) what that should be in raw or any other form.

What sort of IR transmitting hardware do you have (relative to the description below)?

IR signals are "modulated". Sony signals are modulated at a frequency of 40000Hz.

A computer controlled IR transmitter could be completely raw. Then to transmit a 2400 uS pulse of 40000 Hz modulation, the computer must turn the IR transmitter on and off 96 times during the 2400 uS interval (On for 12.5 uS, Off for 12.5 uS). That presents quite a load on the computer.

You can also get modulated IR transmit hardware. Then to send a 2400 uS modulated pulse, the computer must turn the transmitter on, wait 2400 uS and turn it off. That's obviously much easier. BUT that hardware normally has the modulation frequency built in. If you bought a common modulated IR transmitter (38000 Hz) your Sony DVD might be too picky to accept the signal, since it expects 40000 Hz.

Also the lirc software needs to know which kind of IR transmit hardware you have (modulated or completely raw). I have no clue how you configure that, so that may be a source of error.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Sun Feb 29, 2004 11:10 am    Post subject: Reply with quote

Quote:
You didn't specifically say, but I assume you tried them one at a time and none worked.


Yes Sad

Quote:
What sort of IR transmitting hardware do you have (relative to the description below)?


It just consists of an IR diode (wavelength 950 nm) (together with a resistor, LED and diode) and is connected to the serial port. Maybe the current is too low because of the 1000 Ohm resistor? But the LED works just fine and I don't want to break the IR diode.
The lirc device drivers are compiled within the Linux kernel, there is an option "Serial Receiver Type" and I selected "Homebrew" and "With transmitter diode", so that shouldn't be a problem I think. Do you know what the option "With software carrier" is for?
What does the unit uS stand for?
Back to top
View user's profile Send private message
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Sun Feb 29, 2004 11:33 am    Post subject: Reply with quote

guest wrote:

It just consists of an IR diode (wavelength 950 nm) (together with a resistor, LED and diode) and is connected to the serial port. Maybe the current is too low because of the 1000 Ohm resistor? But the LED works just fine and I don't want to break the IR diode.


That all sounds reasonable. Do you happen to know the specs (appropriate current) for the IR diode? Do you have a way to measure the voltage of your serial port output?

I would expect the IR diode and the LED each drop about 1/2 volt. So the voltage across the resistor is about one volt less than the voltage of the serial port. The current through the IR diode is the voltage across the resistor divided by 1000. If possible, you should compare that to the specs on the IR diode.

What pin of the serial port is it connected to? What instructions were you using when you built that? Did it give a choice of pins? On many serial ports, the transmit pin cannot be controlled as well as the other ouput pins (DTR and RTS).

guest wrote:

The lirc device drivers are compiled within the Linux kernel, there is an option "Serial Receiver Type" and I selected "Homebrew" and "With transmitter diode", so that shouldn't be a problem I think. Do you know what the option "With software carrier" is for?


This hardware design requires software carrier. That is the direct computer modulation I described before. Not having "software carrier" means the software assumes the modulation is done by hardware.

Did you select that option?

guest wrote:
What does the unit uS stand for?


Microseconds.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4767
Location: Bedford, MA

PostPosted: Sun Feb 29, 2004 11:44 am    Post subject: Reply with quote

A friend of mine (an expert electrical engineer) built one of those MANY years ago (before lirc existed).

His opinion was that the current limiting on the serial port would be too large a factor, so he connected a resistor to each of RTS and DTR and then connected the other side of those resistors to each other and to a pair (in series) of IR diodes.

The software switched DTR and RTS together, so the diodes got double the current they would from just one (cutting the resistor value in half and using just one is less predictable because of the current limiting of the rs232 driver).

He used two IR diodes in series to reduce aiming problems (increasing effective range).

I don't know whether that is design is really better than what you did, but it worked (of course I don't remember the resistor values).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guest



Joined: 27 Feb 2004
Posts: 9

PostPosted: Sun Feb 29, 2004 12:12 pm    Post subject: Reply with quote

I use the simple transmitter described here: http://www.lirc.org/transmitters.html
I don't know the specs of the IR diode. The current should be less than 10 mA right now, I think I will increase it in small steps up to 100 mA and see what happens Wink I connected the anode to DTR, the kathode to GND. Also tried a few other pins, but the LED didn't blink then, so this should be the correct connection.

Quote:
Did you select that option?


I did not. Don't have much time right now, will try it later with this option on.

Thanks a lot for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Beginners All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central