Skip to main content
Topic: Problems with IRToy detection/plug in (Read 6739 times) previous topic - next topic

Problems with IRToy detection/plug in

When I plug in my IRToy, the device node "/dev/ttyUSB0" is not created, and if I attempt to run "lsusb" it hangs until the IRToy is removed or the IRToy 'turns off' somehow.

Anyone know what's up?


Also, when it was working, I had to send four null bytes for the reset command to register. And it wouldn't send anything (apparently, I tried to check with my video camera). Any idea what the possible shenanigans could have been?


Here's what I'm using to connect:
Code: [Select]
    ser = serial.Serial("/dev/ttyUSB0")
    ser.write("x00x00x00x00x")
    print repr(ser.read(3))

Re: Problems with IRToy detection/plug in

Reply #1
Hi robot1 - thanks for the report. What version of the firmware are you running?

Quote
Also, when it was working, I had to send four null bytes for the reset command to register. And it wouldn't send anything (apparently, I tried to check with my video camera). Any idea what the possible shenanigans could have been?

What do you mean by the reset command registering? 0x00 just puts the IR Toy into the default RC5 decoder mode, unless it's in SUMP mode it should only take one 0x00 to return to RC5 decoder mode.

What mode were you in when it wouldn't send anything?

Quote
When I plug in my IRToy, the device node "/dev/ttyUSB0" is not created, and if I attempt to run "lsusb" it hangs until the IRToy is removed or the IRToy 'turns off' somehow.

Is it possible you sent the bootloader jump command ($)? Once the bootloader is activated, you must complete an update to return to the normal firmware.  There's more about the update procedure in the manual:
http://dangerousprototypes.com/docs/USB_Infrared_Toy
http://dangerousprototypes.com/docs/USB ... are_update
Got a question? Please ask in the forum for the fastest answers.

Re: Problems with IRToy detection/plug in

Reply #2
What I mean is that if I am in some mode, I need to send four 0x00 bytes before I can get out of it. This seems like a timing problem to me, but I think I was receiving data fine. I believe I am running v1, I just got it in the mail. I was in 8bit send, and also normal raw IO.

Well, the light is lit up when I plug it in almost like I sent the bootloader command... But I'm sure I didn't. I'll try to upgrade the firmware.


EDIT: Randomly it started working again. Still looking to upgrade the firmware. Also, what could I use to talk to it (console program)? Currently I'm using pyserial :p

EDIT2: Aaaand it works, as far as I can tell. How might I update the USBIrToy on Linux? The fw packages would not compile. (Due to missing memcpy or something... what?)

Re: Problems with IRToy detection/plug in

Reply #3
Quote
I need to send four 0x00 bytes before I can get out of it. This seems like a timing problem to me, but I think I was receiving data fine.

There's no actual timing with the USB-CDC-ACM firmware, so I'm not sure what would be the problem with timing. Can you explain what you're thinking?

Quote
what could I use to talk to it (console program)?
We always recommend Hercules:
http://www.hw-group.com/products/hercules/index_en.html

Quote
How might I update the USBIrToy on Linux?

The authors of the bootloader provide some utilities for Linux here:
http://www.diolan.com/pic/bootloader_dwn.html
Got a question? Please ask in the forum for the fastest answers.

Re: Problems with IRToy detection/plug in

Reply #4
Well, now I'm not sure what I'm thinking. It works fine. Been turning stuff on and off all morning :D


However, I did notice the range is absolutely horrible. I'm talking like three feet or less. What happened?

EDIT: Ok, I'm stuck in the bootloader. Been reading up on it, but I don't see a way to get out of it... I'm on Linux, and this apparently is a problem because of how the drivers connect the device. I compiled fw_update, but I can't specify a com/how do I specify a com?

EDIT: Can't even get the bootloader to work on a friend's Win7 PC. I believe it was 64 bit. God damn it, is it a working brick now?

EDIT: The device is on /dev/hidraw0, can I make fw_update use this, somehow?

EDIT: Finally got it by using a really old WinXP laptop I had...

Re: Problems with IRToy detection/plug in

Reply #5
Great, now it is randomly broken again. For some reason it stays orange lighted EVEN THOUGH I HAVE DONE NOTHING to it. It has worked before, I know a "$" is not being sent somehow. Reprogramming does not fix it, in fact, I have to use a jumper to enable programming mode. The status LED seems to mean nothing besides the fact it is stuck.

EDIT: I'm using v1.07 now, but v.07 didn't work either.

Re: Problems with IRToy detection/plug in

Reply #6
What the fuck, a capacitor fell off... Lets hope I can get another one.

Could someone tell me what C2 and C3 actually do?


EDIT: I'm a magnet for fail. My USB port was worn out. Should I replace C2? The circuit seems to work fine without it, and as far as I can tell, it wasn't on there in the first place. The lumps of solder don't seem to contain any impression of the capacitor...

Re: Problems with IRToy detection/plug in

Reply #7
I'm working on a better reply to the other issues, but just really quick -

http://dangerousprototypes.com/docs/USB ... w_of_parts:
Quote
C2 and C3 are capacitors for the internal PIC voltage regulator. Only one will be populated on the manufactured version.

If you have C2 or C3 you're in good shape.
Got a question? Please ask in the forum for the fastest answers.

Re: Problems with IRToy detection/plug in

Reply #8
Quote
However, I did notice the range is absolutely horrible. I'm talking like three feet or less. What happened?

Is this for transmitting from the IR Toy or receiving from a remote?

Quote
EDIT: Can't even get the bootloader to work on a friend's Win7 PC. I believe it was 64 bit.
As far as I know, the Diolan upgrade utility should work on all windows flavors. It might be a good idea to grab the latest update utility from the Diolan website though, they may have updated it recently.

Quote
EDIT: The device is on /dev/hidraw0, can I make fw_update use this, somehow?
This should be prefect, the IR Toy is connected as an HID device and should be ready to update. I'm not sure of the update procedure on Linux, but it should look something like this from the command line:
http://dangerousprototypes.com/docs/USB ... OSX.2C_BSD

Quote
For some reason it stays orange lighted EVEN THOUGH I HAVE DONE NOTHING to it. It has worked before, I know a "$" is not being sent somehow. Reprogramming does not fix it, in fact, I have to use a jumper to enable programming mode. The status LED seems to mean nothing besides the fact it is stuck. I'm using v1.07 now, but v.07 didn't work either.

You are able to use the jumper to get into bootloader mode? And you are able to connect and upload a new firmware successfully?

The LED could stay on because of a USB connection error (does it blink when you plug it in?), because the bootloader is active (seems unlikely), or maybe the firmware you're uploading is broken. v1.07 and v07 should be the same thing, but please be sure to use the official v07 release from Google Code.
Got a question? Please ask in the forum for the fastest answers.

Re: Problems with IRToy detection/plug in

Reply #9
Ok, thanks for your answers :) This thread was mostly me venting. And yeah, the range while transmitting. I replaced my 390Ω resistor with a 39Ω one. Still have yet to try it, but someone else had success...

Re: Problems with IRToy detection/plug in

Reply #10
I think the resistor swap will help a lot, please let us know how it goes. If anyone else wants a resistor swap just PM me, I'll be happy to replace it for you.
Got a question? Please ask in the forum for the fastest answers.

Re: Problems with IRToy detection/plug in

Reply #11
Yeah, resistor swap was golden. Might want to start suggesting it, not sure how many of whatever batch I had are left.


EDIT: If someone looks (I'll make a new post later if no one answers, just don't want to start a new thread :) must I use a 940nm LED? Not that is matters, much, but it seems I can get 850nm transmitters with about 2x more output for the same cost... So if possible, I'd like to use those.

Re: Problems with IRToy detection/plug in

Reply #12
I think 850 is fine too, any 'IR emitter' should work.
Got a question? Please ask in the forum for the fastest answers.

Re: Problems with IRToy detection/plug in

Reply #13
[quote author="R0b0t1"]must I use a 940nm LED? Not that is matters, much, but it seems I can get 850nm transmitters with about 2x more output for the same cost... So if possible, I'd like to use those.[/quote]The IR LED on the IRToy should have plenty of transmission power - you shouldn't need to replace it with a higher powered one.  The real issue is that the provided resistor only uses a tiny fraction of the available power, and thus changing the resistor is your best bet.  The transistor can handle a lot of current, and so you should try setting the current close to the maximum and see how well that works.

Instead of replacing the IR LED for more power, you might consider finding one with a wider beam.  IIRC, the provided IR LED is somewhat narrow.  So, while you don't really need a higher powered IR LED, you could use a wider beam, especially if combined with the proper resistor to enable significantly more current.