Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Barf

62
USB Infrared Toy / Re: convert LIRC file to IRToy raw commands
Ok, guys, so you have persuaded me that there is such an animal like "IrToy format", sort-of. So I decided to add it to IrScrutinizer. Fortunately,it is quite easy, see http://www.harctoolbox.org/IrScrutinize ... rt+formats

So, add this stuff
Code: [Select]
<exportformat name="IrToy" extension="txt" multiSignal="false" simpleSequence="true">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <!--xsl:param name="noRepeats" select="4"/-->
    <xsl:param name="period" select="21.3333"/>
    <xsl:output method="text" />

    <xsl:template match="/remotes">
<xsl:apply-templates select="remote[position()=1]/commandSet[position()=1]/command[position()=1]"/>
    </xsl:template>

    <xsl:template match="command">
        <xsl:apply-templates select="raw"/>
    </xsl:template>

    <xsl:template match="raw">
        <xsl:apply-templates select="intro/*"/>
        <xsl:call-template name="repeat"/>
        <xsl:apply-templates select="ending/*"/>
    </xsl:template>

    <xsl:template name="repeat">
        <xsl:param name="n" select="number($noRepeats)"/>
        <xsl:if test="not($n = 1)">
            <xsl:call-template name="repeat">
                <xsl:with-param name="n" select="$n - 1"/>
            </xsl:call-template>
        </xsl:if>
        <xsl:apply-templates select="repeat/*"/>
    </xsl:template>

    <xsl:template match="gap|flash">
        <xsl:variable name="periods" select="floor(number(.) div $period)"/>
    <xsl:call-template name="hexnum">
        <xsl:with-param name="value" select="floor($periods div 256)"/>
    </xsl:call-template>
    <xsl:call-template name="hexnum">
        <xsl:with-param name="value" select="$periods mod 256"/>
    </xsl:call-template>
    </xsl:template>

    <xsl:template name="hexnum">
        <xsl:param name="value"/>
        <xsl:call-template name="hexdigit">
            <xsl:with-param name="val" select="floor($value div 16)"/>
        </xsl:call-template>
        <xsl:call-template name="hexdigit">
            <xsl:with-param name="val" select="$value mod 16"/>
        </xsl:call-template>
        <xsl:text> </xsl:text>
    </xsl:template>

    <xsl:template name="hexdigit">
        <xsl:param name="val"/>
          <xsl:value-of select="substring('0123456789ABCDEF',$val+1,1)"/>
        </xsl:template>
</xsl:stylesheet>
</exportformat>
to the exportformats.xml, for example just before the last line reading </exportformats>. There will now be a new export format "IrToy", that however only takes a single signal, the first one in the export. (Note that it does not adjust the last duration to FFFF, possibly it should.)

Quote
I have noticed that the IRToy does tend to record the "lead in" times much shorter than reality. I'm guessing that this has to do with the AGC response time in the demod detector.
Well, some people distrust demodulating receivers for capturing,,, But the Lirc file posted has 8811 microseconds for the leadin, shorter than the theoretical number of  9024. but not very much, so that is probably not an issue. (There is a reason why it it called "lead-in".)
63
USB Infrared Toy / Re: convert LIRC file to IRToy raw commands
[quote author="zoulou"]...
But how do I get from a LIRC file to the bytes that I need to send to the IRToy[/quote]

Sending an IR signal to the 'toy is not THAT easy, it involves timing and checking return values and such. It is not just the matter of transforming a string into another representation. So I suggest that you use one existing driver. For example the one in IrScrutinizer :-).

Assuming that Java is an allowed solution, I would suggest that you try to write a program like this (Java >= 7):

Code: [Select]
// This code is in the public domain.

package javaapplication47;

import org.harctoolbox.IrpMaster.IrSignal;
import org.harctoolbox.harchardware.ir.IrToy;

public class JavaApplication47 {

    public static void main(String[] args) {
        try {
            String parameters = null;
            switch (args[0]) {
                case "NEXT":
                    parameters = "D=128 F=154";
                    break;
                case "PREVIOUS":
                parameters = "D=128 F=158";
                    break;
                default:
                    System.err.println("Unknown command");
                    System.exit(1);
            }
            IrSignal irSignal = new IrSignal("IrpProtocols.ini", "NEC1", parameters);
            IrToy irToy = new IrToy("/dev/ttyACM0");
            irToy.open();
            irToy.sendIr(irSignal, 1, null);
            irToy.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
which would generate the signals you want and send iit to the 'toy. Note that this is examle code, but should be enough to try the idea. You will need IrpProtocols.ini, IrpMaster.jar, HarcHardware.jar, antlr-3.4-complete.jar, and  rxtx.jar and you need to have librxtxSerial in your java.library.path.(All contained in IrScrutinizer dist.)

If you have a working LIRC setup, including a working IrToy driver, that should also work. But that is a big IF.
64
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
Quote
... showed a lot of keys and I could export this data to a .lirc file. If have not used these .lirc file in the app of my smartphone , so I cannot say, if the values are valid.
Why don't you test it directly from IrScrutinizer? Open the IrToy as sender on "Sending hardware", set "count on that pane to 2 (or more) (problem that is fixed in the development version), and you can send, e.g. from the "Parametric Remote" by the right mouse menu, Transmit selected. (The tooltip text says "Not implemented", which is wrong, sorry).

Quote
All keys have the protocol NEC2 or NEC but not Pioneer-Mix.
I have explained this above.

Quote
got "UnknownProtocolException: Protocol NEC not known.".
Also this was explained above. This is what I wrote:
Quote
There are the protocols NEC1 and NEC2 (among others), but there is no protocol "NEC". Sometimes the decoder cannot decide between NEC1 and NEC2, and says just "NEC". A "NEC" signal can thus not be rendered, and produces the error message you quoted. If you receive a "NEC", you can either re-capture the signal, or, if you know what you are doing, manually change it to NEC1 or NEC2.
I cannot explain it simpler than that. But let me add that NEC1 or NEC2 are the same as Pioneer, except for the repeat and the frequency.

To the first screen shot: The decodes means D0 = 165  F0 =90  D = 165 F = 203. What is disturbing is the "silly" numbers in the upper window. Likely the irtoy delivered a completely wrong frequency. Note that the documentation says (it I remember it correctly) that for accurate frequency measurement, you have to hold the remote very close to the irtoy.
65
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
The "Pioneer-mix" protocol has four parameters: In the first version, I called them D, F, D2, and F2, in the second version D0, F0, D, and F. Due to imperfection is DecodeIR, these signals cannot be directly captured in "Parametric Remote". Instead, when you capture such a signal, for example on the "scrutinize signal" pane (make sure that the option "print decodes to the console" is on), two lines like
Code: [Select]
protocol = Pioneer, device = 161, obc = 129
protocol = Pioneer, device = 175, obc = 188
are printed to the console. (If it says "NEC" instead of "Pioneer", that is OK.) These numbers correspond (using the newer parametrization) to D0 = 161, F0 = 129, D = 175, and F = 188. You have to enter these signals manually in the parametric remote table (or you fix an existing row). D and F are entered in the respective colums; for D0 and F0 there are no columns, so they have to be entered as "Misc. Parameters" Your screendump shows how it is supposed to look like.

The WARNINGs in your sceendump means that the changes to IrpProtocols.ini either were  not correct, or did not take effect. They are fatal. Not that the program reads the file IrpProtocols.ini  only on startup.

Hope this helps.
66
USB Infrared Toy / Re: IrScrutinizer: Software for IR capture etc, supporting I
Nice that it is working. Actually, I interpreted the documentation so as the last 0xFFFF was simply an end-indicator, not a combined end-indicator AND gap/pulse duration. So now the last gap is overwitten by 0xFFFF. It can probably be argued that this is described in the documentation...

I hope to release the next release ("1.1.1") in a few weeks, including sources.
67
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
[quote author="pope5"]
Today, I have added the lines you told me to the file IrpProtocols.ini . I started IrScrutinizer, set the options "Print decodes to console" on and started to recode. Apperently, there is no change.[/quote]

The decoding in IrScrutinizer is done in the library DecodeIR, which was written in C++ a number of years ago, and subsequently improved by others. Even though the sources are available, I consider it as completely unmaintainable code with severe internal problems (see http://www.hifi-remote.com/forums/viewtopic.php?t=14219). There is no possibility to extend it; in particular, adding a protocol to IrpProtocols.ini does not make it aware of the new protocol. There may come a day when I write my own decoder, but that day is not in 2014.

Quote
But I didn't understand, what you mean with the "four parameters D, F, D2, F2".
For example, in the last code snippet, it is 171, 0, 175, and 255.

Quote
I can drag the bottom line (marked with a blue arrow) up and down. I can also drag the line, marked with the yellow arrow. This increases however only the grey area. But the line, marked with the red arrow always remains at its position. And I can not drag this line!
Sorry. That is a bug that will be fixed for the next release.

Actually, everything is in the last message, although possibly a bit brief :-).

But I also converted this file: http://hifi-remote.com/forums/dload.php ... le_id=8635. You can download the result: http://www.harctoolbox.org/storage/pioneer-bluray.girr and import it in IrScrutinizer (Import -> Girr, just paste the URL in the File/URL field, press "Load File/URL", then "Import all"). This should do as a starting poing. But you have to change the Pioneer-mix protocol to
Code: [Select]
[protocol]
name=Pioneer-Mix
irp={40k,564}<1,-1|1,-3>(16,-8,D0:8,~D0:8,F0:8,~F0:8,1,^108m,(16,-8,D:8,~D:8,F:8,~F:8,1,^108m)+) [D0:0..255,F0:0..255,D:0..255=D0,F:0..255=F0]
EFC_translation=LSB comp
[documentation]
Two-signal version of the Pioneer protocol; first sends the "normal" signal (parameters D0 and F0, then, as repeat, the one determined by D and F.

(It is just the parametrization that is changed.)
69
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
What first strikes me is the bad quality of the learns: frequency (should be around 40kHz) often way off, some have intro sequences, some have repeat sequences, some have ending sequences, protocol differs. If trying to caputure raw signals, you have to reject and recapture the bad ones. They should have both a (long) intro and a (long) repeat, but no ending. (BTW, Lirc cannot reproduce a long intro and a long repeat.)

The standard tips on capturing are: Fresh batteries, avoid ambient light in particular sun light and other light sources with IR content. Experiment with the relative locatons of sensor and remote. You can press the keys fairly long: IrScrutinizer identifies the repeats; if the outcome is bad, the capture was bad.

But there is a way to use "cooked" (opposite of raw) signals, just that DecodeIR does not cooperate: Add the following lines to the end of your IrpProtocols.ini:
Code: [Select]

[protocol]
name=Pioneer-Mix
irp={40k,564}<1,-1|1,-3>(16,-8,D:8,~D:8,F:8,~F:8,1,^108m,(16,-8,D2:8,~D2:8,F2:8,~F2:8,1,^108m)+) [D:0..255,F:0..255,D2:0..255=D,F2:0..255=F]
EFC_translation=LSB comp
[documentation]
Two-signal version of the Pioneer protocol; first sends the "normal" signal,
then, as repeat, the one determined by D2 and F2.

Restart the program, which will now know a new protocol "Pioneer-Mix", taking the four parameters D, F, D2, F2.
When you (successfully) capture such a signal in the scrutinizer, (make sure that the option "Print decodes to console" is on), the decoder  will print two lines to the console, like

Code: [Select]
p
rotocol = Pioneer, device = 171, obc = 0
protocol = Pioneer, device = 175, obc = 255
These correspond to the parameters D, F, D2, F2. You then generate, with a mix of captures and manual typing, the desired remote configuration in the "Parametric Remote" table. It should use "Pioneer-mix" as protocol, F, D, D2, F2 per the captures. Since there are no columns for F2 and D2, you have to enter them in the "Misc. Parameters" column, format like "D2=175 F2=255"

Quote
And by the way: when there are more lines than fit in the screen, I do not see, if the next key has added another line (exept I look to the scroll bar - but that is very bad). Wouldn't it be better, to leave the table at the end than always going to the top? Then I would see, that all entries have been shifted up one line.
It should work like that. I will see if there is something flaky, and if so, I will fix it to next version.

Quote
Or wouldn't it be possible, also to drag the lower limit of that window down, to show more lines?
The window is resizeable, and the divider between the middle part and the console can adjusted. So I actually do not understand your wish.
70
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
Nice that it works now. Good example on when parametric captures fails, although my bottom line would be that a better and/or more flexible decoder would be the ultimate solution.

Quote
The new version has only a partial success. When I klick an entry (line) and klick rmb, I select move up (or move down) and the entry is moved up and done. However, when i click an entry and press ctlr-up or ctrl-down, only the blue rectangle moves up or down but the selected entry remains at its position.
Glad that the real problem is solved. The unexpected behavior with ctrl-up and ctrl-down is, I admit, unexpected and confusing, but it is strictly speaking not a bug. If you press ctrl-up or -down while the popup menu has focus, it will work correctly. But it does not "work" if the menu is not visible. That is because the Java table (class JTable) gets these key events, not the menu, and invokes some default actions, which are not really useful. The accelerators on the poput menus are not invoked.

It is not obvious how to proceed. If you have a good suggestion, please let me know. Anyhow, it is a pretty minor GUI-only issue. I might remove the accelerators, since they lead to confusion -- as you convincingly demonstrated!

Quote
it is not my Lirc, it is the program IrScrutinizer, which writes NEC in its log.
You are right. Let me explain: There are the protocols NEC1 and NEC2 (among others), but there is no protocol "NEC". Sometimes the decoder cannot decide between NEC1 and NEC2, and says just "NEC". A "NEC" signal can thus not be rendered, and produces the error message you quoted. If you receive a "NEC", you can either re-capture the signal, or, if you know what you are doing, manually change it to NEC1 or NEC2.

Thank you very much for your feedback!
71
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
Quote
3.) I wanted to record some of the keys again. How can I move the line to the appropriate position. I klick the newly recorded line at the end of the Parametric Remote Table, then i press the right mouse button an select "move up". The field above the marked line is framed with a blue rectangle. I press some more ctrl-up, the rectangle move up more lines. But how do I get the desired line to the rectangle?
OMG. Sorry for that. Try http://www.harctoolbox.org/storage/IrScrutinizer.jar

Thanx for finding the bug.
72
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
[quote author="pope5"]
1.) The bad news is, that all keys seem to have the same value. That was already the fact, when I used the program winlirc.
As previously Qwlciguk (Thu Jul 03, 2014 6:03 pm) said, the remote has multi-part IR protocols. And for me it seems, that all
keys have only the first part.
[/quote]
I explained what is going on in the other thread. The easy ("obvious")  solution is to instead capture as raw (select Scrutinize Remote -> Raw Remote instead. Capture and export as before.  In particular since you seem to be interested in generating LIRC files, and LIRC definitely does not know what "dual Pioneer" is.

Quote
2.) Besides, I get problems with some keys of the remote control.
When creating the LIRC File, there are some errors in the log:
Warning: Signal named secondary_video (null) could not be rendered (Protocol NEC not known.); ignored.
Here is something that you do not tell me/us. How is your Lirc coming up with the idea that it is NEC?

Quote
3.) I wanted to record some of the keys again. How can I move the line to the appropriate position. I klick the newly recorded line at the end of the Parametric Remote Table, then i press the right mouse button an select "move up". The field above the marked line is framed with a blue rectangle. I press some more ctrl-up, the rectangle move up more lines. But how do I get the desired line to the rectangle?
Oops, I will have a closer look

Quote
I just tried the play button again and got:
0000 A8AAA 0000 0044 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

The log reads:
protocol = NEC, device = 161, obc = 129
protocol = NEC, device = 175, obc = 57
protocol = NEC, device = 161, obc = 129
protocol = NEC, device = 175, obc = 57
I have a problem in that the Hex form and the decodes are not consistent. There is no way the listed hex can decode to a NEC signal.
Turn on the "verbose" option, turn off "invoke repeat finder" and "used cleansed captures".
73
USB Infrared Toy / Re: IrScrutinizer: Software for IR capture etc, supporting I
After sleeping on the problem, it seems pretty clear to me: It is simply a matter of what the decoder (here DecodeIR) says. If we had a (custom?) version of DecodeIR that correctly identified the "dual Pioneer", everything would be fine. (Creating such a custom DecodeIR may be possible, the sources are available at JP1-forum.)

Unfortunately, DecodeIR has a lot of problems under the hood, see http://www.hifi-remote.com/forums/viewtopic.php?t=14219.  DecodeIR cannot say that a signal has several decodes (i.e. the same signal can correctly be interpreted as more  than one protocol/parameter), it just gives out one of them, because the programmer liked one better than the other; a logic that is sometimes hard to follow, and likely not documented. Also, the parametrization of some protocols is not really API-friendly, hexadecimal number are sometimes given out without any indication that they are hexadecimal...

Wanna write a new decoder?

PS. I can now write URLs!
74
USB Infrared Toy / Re: IrScrutinizer: Software for IR capture etc, supporting I
@Qwlciguk: thanx for posting the URLs.

Quote
for multi-part signals such as the "Pioneer mix" protocol, if I capture a button via the scrutinize signal tab, I get both parts of the IR, but if I wanted to capture the whole remote via the scrutinize remote tab, it only grabs the first of the two parts.
That's a tough one!! You can always capture in "Raw remote", but is has other disadvantages of course.

Another way to express this is that, using the normal protocol definitions (including the ones hard-soldered into DecodeIR), is that the remote really sends "macros", not just single signals.

Given this, I would claim that IrScrutinizer does the right thing, although I admit that you have a valid use case.

Can you suggest a clean solution?
75
USB Infrared Toy / Re: Pioneer Remote Control cannot be recorded
First of all, the patch is absolutely crucial for IrToy users; it fixes several problems.

The caputure "0000 151553 ...." is completely nonsensical, consisting mostly of zeros. It is not compatible with the decodes as NEC2.  This is a bad capture, do no worry about a parse error...

However, the lirc file previously posted looks completely plausible.

The procedure for recording and exporting a remote goes like this: Since you want to investigate a remote (collection of signals), not just a single singal, you select the "Scrutinize remote" pane. Select "Parametric remote", unless you are sure you want to capture raw. Press "Capture". Now you fire your remote to the sensor, key after key. (The 1.4 second delay is to blame on the IrToy firmware...) Fill in the name column as you see fit. Then go to the export pane, select the desired export format, e.g. LIRC, press "Export param. remote".

You can also, without selecting the "Export" pane, from the top menu, select File -> Export -> Parametrized Signals -> LIRC.

Of course, there are also some more options...

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01662490032session_write_close ( )...(null):0
20.01692621656ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01692622432Database_MySQL->query( ).../DatabaseHandler.php:119
40.06202761192Database_MySQL->error( ).../Db-mysql.class.php:273