Quantcast

New tool for converting pronto hex codes to lircd.conf

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

New tool for converting pronto hex codes to lircd.conf

Olavi Akerman
Hello

I've written a small tool to convert pronto hex codes to lircd.conf format.
I've tested it in my setup and irsend is able to control the devices i have in my setup.

It's written in python and should work pretty much anywhere.
Hope you find it useful.

Olavi Akerman

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

pronto2lirc.py (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

Olavi Akerman
Hello

A couple of additions to the program to make CCF->lircd.conf easier. To translate CCF to lircd.conf first use CCFDecompiler (from CCFTools) to convert CCF to XML and then use the attached program to make lircd.conf. The new version (1.1) is attached.

Olavi

On Sat, May 10, 2008 at 1:02 PM, Olavi Akerman <[hidden email]> wrote:
Hello

I've written a small tool to convert pronto hex codes to lircd.conf format.
I've tested it in my setup and irsend is able to control the devices i have in my setup.

It's written in python and should work pretty much anywhere.
Hope you find it useful.

Olavi Akerman


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

pronto2lirc.py.gz (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

Christoph Bartelmus
Hi Olavi,

thanks for the tool. I already could make good use of it.
I plan to add the tool to the contrib/ folder in the lirc distribution if  
you don't mind.
Could you please write up some documentation on the process of converting  
.ccf files and how to use the tool.
Is the CCFDecompiler only available for Windows?

Christoph

Olavi Akerman "[hidden email]" wrote:
> A couple of additions to the program to make CCF->lircd.conf easier. To
> translate CCF to lircd.conf first use CCFDecompiler (from CCFTools) to
> convert CCF to XML and then use the attached program to make lircd.conf. The
> new version (1.1) is attached.
>
> Olavi
>
> On Sat, May 10, 2008 at 1:02 PM, Olavi Akerman <[hidden email]>
> wrote:

>> Hello
>>
>> I've written a small tool to convert pronto hex codes to lircd.conf format.
>>
>> I've tested it in my setup and irsend is able to control the devices i have
>> in my setup.
>>
>> It's written in python and should work pretty much anywhere.
>> Hope you find it useful.
>>
>> Olavi Akerman
>>


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: New tool for converting pronto hex codes to lircd.conf

Olavi Akerman
Hello

Yes I don't mind if you add it to contrib.
Regarding documentation: what is the format you would like the
documentation- to be in?
As far as I know CCFDecompiler is only available for Windows. If anyone
knows any other
platform independent library/tool that can be used to parse CCF files I
willing to consider
writing support for them as well.

Olavi

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Christoph
Bartelmus
Sent: Saturday, May 10, 2008 7:50 PM
To: [hidden email]
Subject: Re: New tool for converting pronto hex codes to lircd.conf

Hi Olavi,

thanks for the tool. I already could make good use of it.
I plan to add the tool to the contrib/ folder in the lirc distribution if  
you don't mind.
Could you please write up some documentation on the process of converting  
.ccf files and how to use the tool.
Is the CCFDecompiler only available for Windows?

Christoph

Olavi Akerman "[hidden email]" wrote:
> A couple of additions to the program to make CCF->lircd.conf easier. To
> translate CCF to lircd.conf first use CCFDecompiler (from CCFTools) to
> convert CCF to XML and then use the attached program to make lircd.conf.
The
> new version (1.1) is attached.
>
> Olavi
>
> On Sat, May 10, 2008 at 1:02 PM, Olavi Akerman <[hidden email]>
> wrote:

>> Hello
>>
>> I've written a small tool to convert pronto hex codes to lircd.conf
format.
>>
>> I've tested it in my setup and irsend is able to control the devices i
have
>> in my setup.
>>
>> It's written in python and should work pretty much anywhere.
>> Hope you find it useful.
>>
>> Olavi Akerman
>>


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao
ne


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

Christoph Bartelmus
Hi!

Olavi Akerman "[hidden email]" wrote:
> Yes I don't mind if you add it to contrib.
> Regarding documentation: what is the format you would like the
> documentation- to be in?

Html for simple inclusion on lirc.org would be perfect. Simple text would  
be fine as well.

Christoph

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

cassioli
In reply to this post by Olavi Akerman
Very interesting program.
If you can comment it a bit more, I could try to port it to BASIC: RapidQ basic compiler can produce standalone executables for both windows and linux (and maybe Mac), even with GUI.

How can I use this program to convert Pronto raw codes rather than a CCF file (which I do not have)?

These are the codes:
DVD ON

0000 006d 0022 0003 00ab 00aa 0016 003f 0016 0014 0016 003e 0016 003f 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003e 0016 003f 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003f 0016 0014 0016 003e 0016 003e 0016 003f 0016 0014 0016 0014 0016 003f 0016 0014 0016 003e 0016 0014 0016 0014 0016 0014 0016 003e 0016 06c3 00ab 00aa 0016 0014 0016 0e7d

DVD OFF

0000 006d 0022 0003 00ab 00aa 0016 003e 0016 0014 0016 003f 0016 003e 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003f 0016 003e 0016 0014 0016 003f 0016 0014 0016 0014 0016 0014 0016 003e 0016 003f 0016 0014 0016 003e 0016 003f 0016 003e 0016 0014 0016 003f 0016 0014 0016 0014 0016 003e 0016 0014 0016 0014 0016 0014 0016 003e 0016 06c3 00ab 00aa 0016 0014 0016 0e7d

A simple lirc raw sequence would be enough (no need to analyse the file looking for known patterns/protocols).


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

Olavi Akerman
cassioli wrote:

> Very interesting program.
> If you can comment it a bit more, I could try to port it to BASIC: RapidQ
> basic compiler can produce standalone executables for both windows and linux
> (and maybe Mac), even with GUI.
>
> How can I use this program to convert Pronto raw codes rather than a CCF
> file (which I do not have)?
>
> These are the codes:
> DVD ON
>
> 0000 006d 0022 0003 00ab 00aa 0016 003f 0016 0014 0016 003e 0016 003f 0016
> 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003e 0016 003f
> 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003f 0016
> 0014 0016 003e 0016 003e 0016 003f 0016 0014 0016 0014 0016 003f 0016 0014
> 0016 003e 0016 0014 0016 0014 0016 0014 0016 003e 0016 06c3 00ab 00aa 0016
> 0014 0016 0e7d
>
> DVD OFF
>
> 0000 006d 0022 0003 00ab 00aa 0016 003e 0016 0014 0016 003f 0016 003e 0016
> 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003f 0016 003e
> 0016 0014 0016 003f 0016 0014 0016 0014 0016 0014 0016 003e 0016 003f 0016
> 0014 0016 003e 0016 003f 0016 003e 0016 0014 0016 003f 0016 0014 0016 0014
> 0016 003e 0016 0014 0016 0014 0016 0014 0016 003e 0016 06c3 00ab 00aa 0016
> 0014 0016 0e7d
>
> A simple lirc raw sequence would be enough (no need to analyse the file
> looking for known patterns/protocols).
>
>
>
>  
Hello

Just create a file with 2 rows each containing the whole sequence of
commands:

DVDON:0000 006d 0022 0003 00ab 00aa 0016 003f 0016 0014 0016 003e 0016
003f 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016
003e 0016 003f 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016
0014 0016 003f 0016 0014 0016 003e 0016 003e 0016 003f 0016 0014 0016
0014 0016 003f 0016 0014 0016 003e 0016 0014 0016 0014 0016 0014 0016
003e 0016 06c3 00ab 00aa 0016 0014 0016 0e7d
DVDOFF:0000 006d 0022 0003 00ab 00aa 0016 003e 0016 0014 0016 003f 0016
003e 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016
003f 0016 003e 0016 0014 0016 003f 0016 0014 0016 0014 0016 0014 0016
003e 0016 003f 0016 0014 0016 003e 0016 003f 0016 003e 0016 0014 0016
003f 0016 0014 0016 0014 0016 003e 0016 0014 0016 0014 0016 0014 0016
003e 0016 06c3 00ab 00aa 0016 0014 0016 0e7d

Use this file as an input parameter. Please note that the whole sequence
for a each command should be on the same line.

Olavi

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

cassioli
>Just create a file with 2 rows each containing the whole sequence of
>commands:

Thank you very much, it works like a charm! ;-)

I attach the result and I add a couple of keywords, for people wandering around looking for UNIVERSAL LG DVD PLAYER/RECORDER DISCRETE ON/OFF COMMANDS  (at least I guess it is universal: the remote of my LG DVD player works with my LG DVD recorder too!)

RAW Pronto version:

DVD ON
 
 0000 006d 0022 0003 00ab 00aa 0016 003f 0016 0014 0016 003e 0016 003f 0016
 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003e 0016 003f
 0016 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003f 0016
 0014 0016 003e 0016 003e 0016 003f 0016 0014 0016 0014 0016 003f 0016 0014
 0016 003e 0016 0014 0016 0014 0016 0014 0016 003e 0016 06c3 00ab 00aa 0016
 0014 0016 0e7d

 DVD OFF
 
 0000 006d 0022 0003 00ab 00aa 0016 003e 0016 0014 0016 003f 0016 003e 0016
 0014 0016 003e 0016 0014 0016 0014 0016 003e 0016 0014 0016 003f 0016 003e
 0016 0014 0016 003f 0016 0014 0016 0014 0016 0014 0016 003e 0016 003f 0016
 0014 0016 003e 0016 003f 0016 003e 0016 0014 0016 003f 0016 0014 0016 0014
 0016 003e 0016 0014 0016 0014 0016 0014 0016 003e 0016 06c3 00ab 00aa 0016
 0014 0016 0e7d

RAW LIRC version is attached

DVD ON: dvd-on.wav
DVD OFF: dvd-off.wav

Tested on LG DVD Recorder RH 255.

Thanks again, now I'll try porting your program to Rapidq.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

cassioli
I started porting to RapidQ.
It was quite strightforward, but I need some help as I don't know Python very well.
What do these functions do?

sub CreatePulses(sItems as string)
'        dPulseWidths=[]               # Table of Pulse widths. Length is repsented in microseconds
'        for i in sItems:
'            self.dPulseWidths.append(1000000*long(i,16)/self.dIRFrequency) # Convert pulse widths to uS

'        if len(self.dPulseWidths)<>2*(self.lOnceSequenceLength+self.lRepeatableSequenceLength):
'            raise "Number of actual codes does not match the header information!"
end sub

function AnalyzeCode(sCodeName as string , sHexCodes as string) as string
'        sHexTable=sHexCodes.split()
'        sCodeName=sCodeName.rstrip()  # Name of the Code associated with code sequence
'        self.ProcessPreamble(sHexTable[:4]) # First four sequences make up Preamble
'        self.CreatePulses(sHexTable[4:])    # The rest are OnceSequence + RepeatableSequence
'        return self.dPulseWidths[-1]        # Final gap=last off signal length
end function

I don't know how lists, tables and arrays work in python... :-(
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: New tool for converting pronto hex codes to lircd.conf

Olavi Akerman
In reply to this post by Christoph Bartelmus
Hello

I've attached the documentation to the email.
It uses the base layout and references that are used www.lirc.org
documentation.

Please let me know if there is anything missing,

Best  Regards,
Olavi

Christoph Bartelmus wrote:

> Hi!
>
> Olavi Akerman "[hidden email]" wrote:
>  
>> Yes I don't mind if you add it to contrib.
>> Regarding documentation: what is the format you would like the
>> documentation- to be in?
>>    
>
> Html for simple inclusion on lirc.org would be perfect. Simple text would

> be fine as well.
>
> Christoph
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao
ne
>
>  


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

pronto2lirc.html.gz (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: New tool for converting pronto hex codes to lircd.conf

Olavi Akerman
In reply to this post by cassioli

Hello

AnalyzeCodes separates the header (first 4 ) and the main pulsesequences
from pronto codes for
futher processing.

CreatePulses converts the pronto type pulse lenghts (which have relative
lengths depending on the IR carrier defined in pronto header) to values
which contains the pulse lengths in microseconds.

To fully understand the logic of calculation I recommend reading up on the
pronto format. For example: http://majority.110mb.com/files/pronto.pdf or
from www.remotecentral.com.

Python tutorial is at http://docs.python.org/tut/tut.html.

Olavi
-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of cassioli
Sent: Monday, June 09, 2008 7:58 PM
To: [hidden email]
Subject: Re: New tool for converting pronto hex codes to lircd.conf


I started porting to RapidQ.
It was quite strightforward, but I need some help as I don't know Python
very well.
What do these functions do?

sub CreatePulses(sItems as string)
'        dPulseWidths=[]               # Table of Pulse widths. Length is
repsented in microseconds
'        for i in sItems:
'            self.dPulseWidths.append(1000000*long(i,16)/self.dIRFrequency)
# Convert pulse widths to uS

'        if
len(self.dPulseWidths)<>2*(self.lOnceSequenceLength+self.lRepeatableSequence
Length):
'            raise "Number of actual codes does not match the header
information!"
end sub

function AnalyzeCode(sCodeName as string , sHexCodes as string) as string
'        sHexTable=sHexCodes.split()
'        sCodeName=sCodeName.rstrip()  # Name of the Code associated with
code sequence
'        self.ProcessPreamble(sHexTable[:4]) # First four sequences make up
Preamble
'        self.CreatePulses(sHexTable[4:])    # The rest are OnceSequence +
RepeatableSequence
'        return self.dPulseWidths[-1]        # Final gap=last off signal
length
end function

I don't know how lists, tables and arrays work in python... :-(
--
View this message in context:
http://www.nabble.com/New-tool-for-converting-pronto-hex-codes-to-lircd.conf
-tp17161702p17737188.html
Sent from the LIRC mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: New tool for converting pronto hex codes to lircd.conf

Christoph Bartelmus
In reply to this post by Olavi Akerman
Hi!

Olavi Akerman "[hidden email]" wrote:
> I've attached the documentation to the email.
> It uses the base layout and references that are used www.lirc.org
> documentation.

Thanks. It's in CVS now.

Christoph

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Loading...