Skip to main content
Topic: Direct comms with IR Toy  (Read 5289 times) previous topic - next topic

Direct comms with IR Toy

I'm a Mac user and unfortunately can't take advantage of all the good work you guys have done for mainly windows platform.

What I'd like to know is if anyone has played with the IR Toy directly, meaning connected to the device through serial / USB (like a modem) using a terminal emulator?

I've connected using terminal command 'screen /dev/cu.usbmodemfa141' (where cu.usbmodemfa141 is the name of my IRtoy)
Once connected press x and you'll see X01 displayed on screen, after which I can aim a remote at the toy, press some button and see the led on the IR toy flicker, but what's displayed on the screen is 'garbage'.
X01����������~�>������~�>�?��|�~��>��?�|��>������������~�>������~�>�?��|�~��>��?�|��>��
What should the terminal setup be (Bits per second, Data bits, Parity, Stop bits, Flow Control)

is it possible to send commands directly to the toy for it to send IR signal?  (Assuming I know the hex to send 'TV On' command as example)
 
Thanks in advance

Re: Direct comms with IR Toy

Reply #1
I don't have a complete answer, because I never really spent much time with Terminal.app running the screen program, but the most important thing to consider is that the IR Toy does not send human-readable ASCII.  The command response, e.g., X01, is only very brief, and the rest can literally be any random character, whether invisible or out of range.  In other words, 'garbage' is exactly what is expected.  Software which decodes the data is needed.

I have done some work with the IR Toy from a program that I wrote.  You've probably already tried my Mac front end software.  Unfortunately, I have not added features for recording and playing back specific remote control commands, as you probably noticed.  But if you are able to write Cocoa programs with Unix calls, then you should be able to get the Mac working with the IR Toy.

Hopefully there are some other Mac users here (I know there are) who have done more and can help you out.

I also think that some of the Java programs should work.

Re: Direct comms with IR Toy

Reply #2
Hi Penny - that's the data I would expect, it's raw timing data from the IR signal where each bit of the byte stands for 1/10000 second.To send data back, you'd need to create a timed waveform from the code, in the correct protocol/encoding for the IR signal, and send it back to the IR Toy.

Another mode to try is the sampling mode, which times each IR change instead of sending data constantly.

I'm not sure what's out there for Mac, but you can probably find a terminal program that will let you view/send raw bytes as HEX values. I like Hercules (from hw-group.com) on Windows.
Got a question? Please ask in the forum for the fastest answers.

Re: Direct comms with IR Toy

Reply #3
The modes I would recommend are:

IRMan - its output is simple and already decoded (RC-5 protocol)
Sampling - if you want to work with other protocols and do the decoding yourself (or send IR signals)

The IR Toy sends ASCII messages in response to commands (OK, S01, etc), but actual data is sent as a byte stream (Hex: 2A | 45 | 29 | 30). You have to switch back and forth between ASCII and Hex in terminal software, but you can make this switching automatic if coding your own terminal software.

Use the default serial port settings (DataBits: 8, Parity: None, StopBits: 1, FlowControl: None). The port speed is not meaningful because you are using a USB virtual serial port, so the key setting is the port name (COM1, COM2, etc).

You can send IR signals in Sampling mode (Transmit (0x03)), copy the byte stream (hex code) from your remote (Play, ChannelUp, etc) and send it after entering the send command (0x03).

Re: Direct comms with IR Toy

Reply #4
Thanks for your responses

I think the clue may also be in the mode I'm using.  But I'm not sure that I can even do that

snippet from the wiki below:
0×00 – Reset, return to RC decoder mode (all modes)
0×01 – SUMP run (captures and sends data to SUMP logic analyzer client)
0×02 – SUMP ID (responds: 1ALS )
0×52 (‘r’ or ‘R’) – IRman handshake (responds ‘OK’).
0×58 (‘x’ or ‘X’) – Enter raw IR/IO mode (responds ‘X01′)
('s' or 'S') - Enter IR sampling mode (responds 'S01')
('t' or 'T') - Run self test (see self-test)
('v' or 'V') - Show hardware/firmware version (responds 'V1##')
('u' or 'U') - Enter USB to serial converter mode (responds U01)
0×24 (‘$’) – Trigger the bootloader (no jumper required)

So I was expecting a response 'OK' as example when sending r/R and or going into sample mode by pressing S and get a response 'S01', but i don't?
I'm obviously doing something stupid and being stupid i can't figure it out, lol

Re: Direct comms with IR Toy

Reply #5
Post a screenshot as an attachment.

Maybe you need to set display for ASCII text in your terminal (independent from sending hex commands).

Re: Direct comms with IR Toy

Reply #6
RTFM, RTMF, get a push into the right direction and RTFM a little more...
As of a few minutes ago I managed to toggle on/off on my ONKIO receiver with the IRToy!

THANK YOU!!

Next to figure out out is how to 'capture' the IR signals received without using any additional software, and match it to a function to control some apps on my mac ;-)



Thanks again for your suggestions and help.

Re: Direct comms with IR Toy

Reply #7
Glad you got it going, thanks for the update.

If you don't get the S01 reply, I would try updating the firmware. Sampling mode is new to v7 (I believe), and the IR Toy is probably still shipping with v2.

I hope to release a new IR Toy firmware today too.
Got a question? Please ask in the forum for the fastest answers.

Re: Direct comms with IR Toy

Reply #8
[quote author="ian"]If you don't get the S01 reply, I would try updating the firmware. Sampling mode is new to v7 (I believe), and the IR Toy is probably still shipping with v2.[/quote]This begs the question of whether USB firmware updates are easily accomplished on the Mac.


Re: Direct comms with IR Toy

Reply #10
Thanks for the reminder.  I still have the .exe files under ~/src/PIC/ but I really should compile the Diolan bootloader for Mac OS X.

Re: Direct comms with IR Toy

Reply #11
@rsdio Please let me know if you intend to and or once done.  Would appreciate if I could get it from you as I have turned many toys into paperweights in the past ;-)