JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Making an IR to RS232 adapter

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Hardware
View previous topic :: View next topic  
Author Message
madmalkav



Joined: 01 Sep 2011
Posts: 63

PostPosted: Fri Jul 24, 2015 3:09 am    Post subject: Making an IR to RS232 adapter Reply with quote

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
View user's profile Send private message
madmalkav



Joined: 01 Sep 2011
Posts: 63

PostPosted: Fri Jul 24, 2015 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 836

PostPosted: Sat Jul 25, 2015 11:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
pH7_jp1



Joined: 14 Sep 2003
Posts: 457
Location: Sterling Heights, MI

PostPosted: Sat Jul 25, 2015 12:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
madmalkav



Joined: 01 Sep 2011
Posts: 63

PostPosted: Sun Jul 26, 2015 8:39 am    Post subject: Reply with quote

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
View user's profile Send private message
madmalkav



Joined: 01 Sep 2011
Posts: 63

PostPosted: Mon Jul 27, 2015 2:07 pm    Post subject: Reply with quote

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.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Hardware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central