Skip to main content

Show Posts

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

Messages - Shadowsoul

1
USB Infrared Toy / Re: IR Toy and lirc on Linux
[quote author="ian"]
It will require some custom support to get it working. We just finished a python plugin for event ghost this week. We used the existing UIRT(2?) plugin. There were two major changes, one is a little questionable long-term.

1. We changed the setup to the IR Toy commands, simple enough.
2. UIRT2 and others use an 8bit measurement value at 50us resolution, and the remote decoder in eventghost expects 8bit data. The IR Toy gives 16bit data with 21.3333uS resolution. We adjusted down by multiplying by 21.333 then dividing by 50, and just sending an 8bit value. There are probably going to be some shortcomings in this that will have to be worked out, but it's enough to get started and find out what happens next.

Next I'd like to work on getting support in LIRC. I plan to take the same approach - see if it has UIRT2 support, then hacking that to work with the IR Toy. Just taking a quick look, it seems like there's a few uirt2 related files here:
http://lirc.cvs.sourceforge.net/viewvc/ ... c/daemons/
[/quote]


Yeah, I've been poking around a bit in the source for LIRC as well, from what I see the interesting part is the "driver" folder, which to my eye corresponds to the plugin-folder for WinLIRC.

However I can't find the source for the WinLIRC-plugin that Dukey wrote so I can't say for sure if it will straight up work if the code is just compiled for Linux. If it works that would be the preferred way I'm sure, as that would mean we get true sampling and can make use of the rather excellent support for figuring out protocols that LIRC already has.

/Shadowsoul
2
USB Infrared Toy / Re: IR Toy and lirc on Linux
Has anyone gotten LIRC to work with the sampling mode for the USB IR Toy under Linux?

The WinLirc-plugin works excellent on Windows but..well..it seems the Linux LIRC requires drivers from the source code?



Cheers,
Shadowsoul
3
USB Infrared Toy / Re: Transmit mode
[quote author="ian"]
[...]

be sure to trigger the transmit mode with 0x03 first:
http://dangerousprototypes.com/docs/USB ... .280x03.29

[/quote]

When you say "trigger the transmit mode" what do you mean?

As it stands I have tried first sending "S", then 0x03, then a bunch of bytes for the timings, then finish with 2 0xFF to end it, I have also tried skipping the "S" in the beginning, the difference is without the "S" first, I get the "S01" response to 0x03 instead of to the "S".
The LED blinks every time I press send.


Could it be something as simple as the frequency? I saw that the command 0x02 were to set frequency modulation...what will it affect? I have not done anything about it, could it be that the default setting is outside the range accepted by my remote perhaps?

You are correct, I get v207 as response so the firmware is correct.

I noticed i missed the 0x03 part in my previous post, perhaps that was what you noticed missing?

Cheers,
/Shadowsoul
4
USB Infrared Toy / Re: Transmit mode
Hi everyone

Trying to get the transmit mode to work here to train my remote with RC5-codes to see if I can avoid all the hassle with decoding the NEC2/Pioneer protocol..

However nothing seems to be sent, and when I run the self test I receive FAI4 as the answer. If I press T repeatedly I sometimes also get FAI6.
Anyone know what 4 is? The documentation only lists 1, 2 and 3.

What I send to the IR Toy in order:

s, to set sample mode
bytearray with timing info
0xFF
0xFF

Am I sending the correct stuff or have I misunderstood anything?

I'm using the latest firmware posted in the  "DEV: IR Toy firmware v07" thread.

Cheers,
/Shadowsoul
5
USB Infrared Toy / Re: Hercules + WinLIRC AiO
[quote author="liyin"]
Maybe nothing, but got this from AV:

Quote
C:...IRToyLogicAnalyzerIRToyLogicAnalyzerBusinessUtilitiesPioneerDecoder.cs
[DETECTION] Contains recognition pattern of the HTML/Rce.Gen HTML script virus
[/quote]

Can't find anything not visible in the source code editor in the file.
It probably reacted to one of the many many many long arrays of info for the Pronto HEX. Kind of unnecessary data perhaps but I wanted to be able to find out all the info about the button I press :P
6
USB Infrared Toy / Re: Dev: Firmware v1.6
[quote author="ian"]
Here's the post with the additional decoders. I thought it did RC5 too, but it seems to be only RC6 and NEC. I'll take a look at it now.

http://dangerousprototypes.com/forum/in ... 48#msg4448
[/quote]

Can't open the files unfortunately but based on his description I would say he uses a relay in some way to short the Power-On-pins on the motherboard (it's the only way I know of to start a computer in S4 sleep mode). Especially when he says "external power supply", as that means not being forced to rely on a motherboard that has powered USB ports even when turned off.
Note: The external power supply may very well be the PSU as it always maintains power on the +5V pin 9 of the ATX connector. Or a battery or something, whatever fits best :) 


Quote
Unfortunately the decoder must be configured for a specific protocol. RC6/NEC are set with a command. RC5 could be easily added, but it stills requires the PC to send a command setting the mode, it doesn't determine the mode from the signal itself.


A simple way to remove the configuration is to look at the first two pulses of a received signal, all those protocols have different BOF-markers (NEC is 16 periods ON, 8 periods OFF, RC6 is 6 periods ON, 2 periods  OFF, RC5 I think is 1 ON, 1 OFF but I might remember incorreectly). That way one can quickly choose what algorithm to try, it only gets tougher when taking into consideration stuff like NEC2 (which differs only in how repeats are handled).
7
USB Infrared Toy / Re: Hercules + WinLIRC AiO
Updated the zip with a newer version that doesn't require .NET4 now.

Also fully supports the 3 Pioneer remotes I have, now I just need to figure out how to move the code from C# to either the Firmware (might not be the best idea due to the complexity) or to the LIRC-driver.
8
USB Infrared Toy / Re: Remote control times, timing issues
[quote author="dukey"]
[..] However it looks to me like it isn't sending a toggle bit at all. It looks like its sending (for some buttons), the group name for the button, ie in the example above it's sending A49F for the radio buttons, then the actual value for the button, I assume as a seperate transmission.  [..]
[/quote]


That's exactly what it does :)

Thanks for the tip on configing with only the second hex value, it should work unless there are some overlaps between the different groups (hard to believe there would be).

The problem is to get a nice HEX-value from the IR Toy on the NEC/Pioneer protocol. Or I suppose I can just encode the HEX-values as time-codings, should be fairly straightforward now that I have a working decoder. But that's like cheating :)
9
USB Infrared Toy / Re: Hercules + WinLIRC AiO
This is from the RED-button on my blu-ray using the Hercules program in HEX-mode:
Code: [Select]
{01}{8F}{00}{C7}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{4A}{00}{19}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{18}{00}{19}{00}{17}{00}{1A}{00}{18}{00}{19}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{04}{A6}{01}{8F}{00}{C7}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{18}{00}{19}{00}{18}{00}{19}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{4A}{00}{19}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{18}{00}{19}{00}{49}{00}{1A}{FF}{FF}

And the GREEN- button as well:
Code: [Select]
{01}{90}{00}{C6}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{18}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{18}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{18}{00}{1A}{00}{18}{00}{19}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{18}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{04}{A6}{01}{90}{00}{C6}{00}{1A}{00}{49}{00}{1A}{00}{48}{00}{1B}{00}{48}{00}{1B}{00}{48}{00}{1A}{00}{17}{00}{1A}{00}{48}{00}{1A}{00}{17}{00}{1A}{00}{48}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{18}{00}{1A}{00}{18}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{48}{00}{1A}{00}{17}{00}{1A}{00}{48}{00}{1A}{00}{17}{00}{1B}{00}{16}{00}{1B}{00}{48}{00}{1A}{00}{48}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{49}{00}{1A}{00}{17}{00}{1A}{00}{48}{00}{1A}{00}{48}{00}{1A}{00}{17}{00}{1A}{00}{17}{00}{1A}{00}{48}{00}{1B}{FF}{FF}


The 0xFF 0xFF at the end arrive after the keypress, not sure if it's actually 1.7 seconds or faster but there is a definite delay. I think I get it in my program as well, need to do some debugging on that part to see if I can figure it out.

Also looking at this data I see why I have issues with my reading, I disregard the {00}  bytes and only could he bytes greater, which of course royally screws up the header which is greater than 255. Silly me, should've spotted the fact that 8000ish us ON requires 2 bytes to encode in number of 21us-pulses (800 / 21 = ~400).

Stupid stupid stupid of me :)
10
USB Infrared Toy / Re: Hercules + WinLIRC AiO
[quote author="liyin"]
@Shadowsoul
Thanks, I'll take a look at the code, but you must admit my first run of the "IR signal graphing module" shows some promise.    :)  )

EDIT:
Shadowsoul, you are using .NET 4.0, is there something in your code that requires the new version?

VS 2010 loading time is offensive in my PC, and 4.0 is too big considering I can do the same with 3.5.
[/quote]

Hehe, yeah, I just posted it to show how I did it, multiple chefs sometimes come up with a smoother solution. You probably have a way nicer way of drawing the waveform than me, setting widths of graphical elements to imitate drawing is...somewhat ugly :)

Forgot VS2010 sets it to .NET4.0 by default, changed it now.
Apparently the only thing I used from 4.0 was StringBuilder.Clear and Debug.WriteLine(formatstring, params), so it was somewhat quick to fix :)


[quote author="ian"]
That concerns me (possible bug?). The final 0xff 0xff represents about 1.7seconds of no IR pulse, is it possible the serial port routine times out before the 0xff 0xff terminator command is sent?
[/quote]

I have modified the code so it also records how many milliseconds have elapsed when the event for datareceived is raised, it does not look like I get anything at the 1.7 second mark no matter what I do.

When I tidy my app up a bit I can "release" it to the SVN, at the moment it's a bit specific for my needs with the Pioneer stuff so :P
11
USB Infrared Toy / Re: Remote control times, timing issues
That's what I tried.

The problem is that Pioneer has decided that alot of buttons need two separate IR signals.

So e.g. the RED-button is sent as A181 followed by AF64.
The GREEN-button is sent as A181 followed by AF65.

What this does is that IRRecord thinks that A181 is the signal for both buttons =(

Or, sometimes it based the Toggle bitmask on the separate codes, which is wrong as the Pioneer/NEC2 protocol sends full repeats when holding down the button.

Luckily Pioneer are open with their remote codes due to custom installers so I know the exact combos for all buttons ( http://www.pioneerelectronics.com/PUSA/Home+Entertainment+Custom+Install/IR+Codes if anyone wants a looksies) which should mean I can combine the double signals.

As a side note, I noticed that the IRRecorder got the correct lead-in (8000ish us followed by 4000ish us) when sampling so that issue is not with the USB IR Toy.
12
USB Infrared Toy / Re: Hercules + WinLIRC AiO
You can also take a look at: http://www.swordspider.com/IRToyLogicAnalyzer.zip (source and binary in same zip)

It's what I've been working on today to test decoding of the Pioneer protocol. It's semidecently prepared to add more protocols.
Written in C# and XAML for what it's worth, ugly coding yes but well, it's not a work thing :P

It should decode NEC2 and Pioneer out of the box if you happen to have a remote of that kind.

Requires .NET Framework 3.5 (might be SP1) so no luck for you MAC/*nix guys I'm afraid, but it's what I work with so it's what I know.

The bar below the pulses changes color depending on which event trigger the bytes were read, helps isolate issues with incomplete frames (for some reason I don't seem to get the ending 0xFF 0xFF with my remote which is why I resorted to sampling for a certain amount of time).
Obligatory screenshot:
13
USB Infrared Toy / Re: Remote control times, timing issues
After more work than I like to do I now have a fully functional, albeit very ugly, decoding of the Pioneer protocol working in C# :)


The meanies are sending 2 commands for some buttons though which will be "fun" to solve..


Regarding the timings, they seem to be pretty spot on except for the strange drop I see in the header-pulse. The Blu-Ray-remote sends Off-pulses with 490us duration, but the receiver seems to follow the protocol very well (within 20us of the specified 564us) on all the buttons I tested.

Just need to polish it up a bit now and then I can look at the fun of implementing it in C for the firmware (where I might add that my knowledge of C stretches to a basic C++ course some five years ago).

How much space is there in the firmware for this kind of stuff anyways? Is there room for multiple decoding algorithms or is multiple versions of firmware required? Performance might also be an issue if you have to try alot of different algorithms..
Or can it be done inside a Lirc plugin?

As is evident I have no experience coding for LIRC, I tried learning it in sampling mode but it really really doesn't like the Pioneer protocol with multiple signals for some buttons, as it seems to flag it as toggle signals.
14
USB Infrared Toy / Re: WinLIRC driver update
[quote author="rsdio"]
Ah, it makes sense when you describe everything at once.

I don't use the PC, so Hibernation is just something I've thought about but never used (in fact, I described hibernation to Microsoft in an interview way back in 1991/1992 before I quit).  Seems like you just need to momentarily close the "power" button to "wake" the PC from Hibernation, so a connector and relay would be a good choice, as you suggested.

As for Wake-on-USB, I agree that it can suck, but I think that the official USB specification is supposed to allow some control over this (more than BIOS).  A given USB device has the option of describing itself as capable of initiating resume, or not.  That's not programmable by the user, though, but a device designer should be able to turn it off.  A proper USB host should not wake on USB data from a device that is not officially supposed to be doing that.  Don't know if this actually helps anything, though, since you can't really rewrite the descriptors on your mouse.
[/quote]


I took a quick look at how Microsoft has implemented the Wake-On-USB functionality. To be able to use it a real USB device driver is needed. You must manually enable Wake-On-USB for each device that you want to be able to wake the computer...sadly COMM-ports lacks that alternative, so it's a no-go to use the virtual COMM for it.
No idea how it's handled on MAC. I assume it's not handled out of the box on Linux or BSD, but as always it can be hacked into the kernel if need be :P

Also I need to amend my claims a bit, I think I must have had something that prevented true S3 sleep mode on the computers I tried it on. Apparently for most people S3 drops power usage to below 20W.
 Haven't used either S3 or hibernation in years myself though, always something that stops working after resuming.
15
USB Infrared Toy / Re: WinLIRC driver update
[quote author="rsdio"]
I don't understand. How can a relay turn on a computer that is already on and in standby mode?  What you describe could turn off the computer, but would not be able to turn it on.  Also, don't forget that the USB IR Toy is powered by the computer, so it cannot turn on a relay for a computer that is turned off, unless you have two computers (one that is always on to power the USB IR Toy, and the other computer which can be turned on by remote).

Maybe someone should describe exactly what the goal is here, since I thought it was to wake a computer that is already powered on.
[/quote]


It depends on the motherboard of course, but the OS's I've used wake the computer from sleep when you hit the power button (I use the term Stand By as "powered off", different from "Sleep" which means the computer still maintains power to e.g. RAM and the input ports. Hibernation is pretty much equivalent to stand by except it persists all memory on disk before shutting down).
Also alot of motherboards keep the USB ports powered on even when in stand by mode which means the USB IR Toy will be powered, if the motherboard doesn't those of us in need of said functionality can easily steal some power from the +3.3V rail on the ATX connector, it is always powered as per the specification to be able to "power on" the computer.


If the goal is simply to be able to wake a computer in sleep mode my guess is nothing should be needed at all. Most OS's should support resume on USB activity.
Alot of motherboards also support Wake-On-USB if enabled in the BIOS which means the computer starts from stand by on USB activity (which to be honest frigging sucks if you touch the mouse or keyboard for example).

The reason I suggested a connector is to be able to choose a fitting way for the motherboard in question. That is if the goal is to have some form of "external" start function of course. As a side note, stand by (powered off) means drawing something like 1W-10W of power depending on the PSU, most computers in sleep mode that I've seen draw somewhere along the lines of 50W, which is why I'd prefer a true "power on"-solution.

( ! ) 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.01882463024session_write_close ( )...(null):0
20.01912594592ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01912595368Database_MySQL->query( ).../DatabaseHandler.php:119
40.06352734080Database_MySQL->error( ).../Db-mysql.class.php:273