View previous topic :: View next topic |
Author |
Message |
madmalkav
Joined: 01 Sep 2011 Posts: 63
|
Posted: Fri Jul 24, 2015 3:09 am Post subject: Making an IR to RS232 adapter |
|
|
As LG discrete codes are lacking a lot of functions I'm making this adapter to have full control of my device. I will post here my advances and question, and when finished the code and other needed info.
My first question is: there a way to see NEC device/subdevice combinations not in use by any remote to use it on my device?
EDIT: seems like I'm having a bad time understanding the relationship between what I have configured in Remote Master and what the Arduino decodes, i.e.
4B6040BF
Vol+ 61381 183 6 none 2 NEC1 BF 00
Seems easier with Sony protocols:
9EB92
Menu Up 63134 190 Sony20 26 73 121 9E 5B
(I know that 92 is the subdevice 73 from the setup protocol window on RM and 9E is part of the hex, I just don't understand what is that B in the middle) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
madmalkav
Joined: 01 Sep 2011 Posts: 63
|
Posted: Fri Jul 24, 2015 10:25 am Post subject: |
|
|
Ok, got it, Sony 20 is a 20 bits string formed with 7 bits for the OBC, 5 bits for the Device and 8 bits for the subdevice. Bits are inverted, so i.e. 121 decimal is 01111001 binary and 10011110 in this format, right? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Barf Expert
Joined: 24 Oct 2008 Posts: 1415 Location: Munich, Germany |
Posted: Sat Jul 25, 2015 11:57 am Post subject: |
|
|
Quote: |
My first question is: there a way to see NEC device/subdevice combinations not in use by any remote to use it on my device?
|
Hard to get a really reliable answer, but you can use the "Lookup tool" of this forum. Tried it for a minute, and it seems like no-one is using device 75.
You appears to be using the Arduino and the Shirriff IR library. This does not use a parametrization compatible with the usage e.g. in this forum. Speaking of NEC1, if I recall it correctly, the bytes of the four bytes are D, S, F. and F inverted, but in the wrong bit-order, i.e., Shirriff uses MSB-first order, while NEC1 officially interprets the bytes in the LSB-first order.
Using an Arduino Mega, a max232-based converter, an old Oppo DVD, and a random old remote, and my previous work in https://github.com/bengtmartensson/AGirs I was able to cook up a prototype (Opponator), contained in the Git-stuff mentioned. Can this serve as inspiration? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
pH7_jp1
Joined: 14 Sep 2003 Posts: 480 Location: Sterling Heights, MI |
Posted: Sat Jul 25, 2015 12:13 pm Post subject: |
|
|
Edit - OOPS. Barf just posted why you probably don't want this, but just in case, You might be interested in this: http://www.righto.com/2009/09/arduino-universal-remote-record-and.html I was able to use this code to receive and store IR codes, recognize which command was received, and send out a stored command. It can decode and encode NEC commands pretty well. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
madmalkav
Joined: 01 Sep 2011 Posts: 63
|
Posted: Sun Jul 26, 2015 8:39 am Post subject: |
|
|
Thanks a lot guys. I already got good part of the work done, currently I'm doing a PC program to convert a spreadsheet to the code for the Arduino.
The spreadsheet holds Function Name, Sony20 device, Sony20 subdevice, OBC and RS232 command. Most of the code is already written and this program will take that spreadsheet and generate the cases for a switch instruction. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
madmalkav
Joined: 01 Sep 2011 Posts: 63
|
Posted: Mon Jul 27, 2015 2:07 pm Post subject: |
|
|
First version of the project uploaded to:
https://github.com/madmalkav/IR2RS232
Everyone be aware that barf's code is orders of magnitude better than mine, I'm doing this as a learning experience but sooner or later will try to modify the code to use his aproach.
I have tested this with my PC, tomorrow I will try with my TV. I'm pretty sure repeats aren't going to work. I'm also pretty sure repeats in Sony20 are just 0xFFFFFFFF so I will have to modify my code to detect that and issue previous command if detected. Perhaps also a timer to so the repeats aren't too fast.
![](http://i.imgur.com/cvlyeSCl.jpg) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|