Difficulty sending Sony 20 bit hex, detected by AnalysIR, sending via Arduino IRRemote library

Everything related to protocols and IR codes
Post Reply
van0014
Posts: 2
Joined: Sun Dec 10, 2017 3:39 am

Difficulty sending Sony 20 bit hex, detected by AnalysIR, sending via Arduino IRRemote library

Post by van0014 »

AnalysIR is really useful. It recognizes signals that no Arduino library I know of is able to

I've detected some Sony (20 bit) and NEC (32 bit) codes, but have trouble sending them using the same 20 or 32 bit code.
I'm hoping to send codes without using raw data, since it's wasteful. The library i'm trying to use at the moment is z3t0's IRRemote lib.

I'm thinking in this case, it would make sense for me to make a protocol, maybe that'll let me send them using 32 bits?

In the library, Sony (*only 12 bit) is already defined. It just can't detect it. And it also doesn't detect (generic?) 32 bit NEC codes

I'm hoping not to trouble anyone, and that this might be a basic question

Here's some of the Sony codes I've detected and cleaned up
Sony_DVP-NS76H_DVD_Player,__RMT-D175pRemote.txt
I've included an Arduino sketch, though at that point I may need to post over there instead.
It uses IRRemote library, first detects an NEC code then attempts to translate that to Sony or NEC. The sketch freezes some time after the send function, both irsend.sendSony(0xA8B92, 20); and irsend.sendNEC(0x1DE2B946, 32); will freeze the program
IRsendDemo.txt
You do not have the required permissions to view the files attached to this post.

User avatar
AnalysIR
Site Admin
Posts: 634
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Difficulty sending Sony 20 bit hex, detected by AnalysIR, sending via Arduino IRRemote library

Post by AnalysIR »

I had a quick look at the Sony code on IRremote & it looks like it will send & receive SONY signals up to 32 bits long.

So perhaps you issue could be related to your IR receiver or IR emitter circuit or code(see below).

The 12 bits defined for SONY in the library is to ensure that every SONY signals has 12 bits or more (i.e. not less than 12 bits).

I looked at your signals and they look fine.

I then looked at your code & found a potential issue.

Issue?
When you receive a signal, you are immediately sending another signal - without any gap. Any device trying to receive that signal will treat it as part of the initial signal that you decoded.

So I suggest you insert a delay of 150ms or more, BEFORE you send the signal (from your case statement) to avoid confusing the receiving device.

van0014
Posts: 2
Joined: Sun Dec 10, 2017 3:39 am

Re: Difficulty sending Sony 20 bit hex, detected by AnalysIR, sending via Arduino IRRemote library

Post by van0014 »

Thats awesome. Thanks for helping me and looking at all that I posted. I posted it here since AnalysIR had some commits to the IRRemote library. That library has a website, but it's not documented.

I'm thinking my lazy switch-case statement might be making it freeze. Comparing with hex against a variable of unknown type might do it. Gonna fix it tomorrow. It's awesome to have AnalysIR find proper codes. Nothing else Arduino based detects them properly

Post Reply