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

DecodeIR ported to Arduino

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Software
View previous topic :: View next topic  
Author Message
Barf
Expert


Joined: 24 Oct 2008
Posts: 790

PostPosted: Sat Apr 22, 2017 4:15 am    Post subject: DecodeIR ported to Arduino Reply with quote

I have succeeded in getting DecodeIR to run on the Arduino. The ported code can be found on Github. I plan to submit it to the Arduino library manager.

It turned out that DecodeIR is quite non-portably written. Most importantly, the assumption that int is of (at least) 32 bits of length is prevalent. The main changes necessary were to use the C99 portable types (like uint32_t etc.) instead of the, per definition, non-portable types like int and char. Somewhat simplified, most ints have been replaced by int32_t, unsigned ints by uint32_t, and chars (used as numbers) by uint8_t.

Also the dependence of std::set was taken out: replaced by an own implementation of std::set<float>. That way, the standard C++ library (which is not available on the Arduino) is not needed.

This is not really a "port to Arduino", it is a portability fix, in the sense above. There are no changes that are conflicts to the old functionality. If desired, I will be happy to upload my changes to the Sourceforge repository.

Due to the size of the library, it does not run on the "small" Arduinos (Uno, nano, etc).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18279
Location: Chicago, IL

PostPosted: Mon Apr 24, 2017 9:43 am    Post subject: Reply with quote

DecodeIR was written by John Fine, who no longer visits the forum. Would you have any interest in creating a more portable version of it? Better yet would be a version driven by a control .ini type file, rather than using hard code to decode each signal.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
Barf
Expert


Joined: 24 Oct 2008
Posts: 790

PostPosted: Mon Apr 24, 2017 10:16 am    Post subject: Reply with quote

The more portable version is the one on Github. But it has the Visual studio stuff, the Makefiles and the JNI stuff removed or disabled. I wrote

Quote:
If desired, I will be happy to upload my changes to the Sourceforge repository.


meaning merging in the removed stuff again to Sourceforge again. Problem is, that I am not sure if Graham or Dave would be very happy... (ok, am not sure that they would be unhappy either...). Therefore "if desired".

Quote:
Better yet would be a version driven by a control .ini type file


See this. Has been "will be finished next month" for the last 6 months...

BTW, the library has been submitted to the Arduino library maganger. This normally takes a few days.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Barf
Expert


Joined: 24 Oct 2008
Posts: 790

PostPosted: Mon Apr 24, 2017 11:24 am    Post subject: Reply with quote

Update: It has just been accepted by the Arduino library manager. This means that Arduino users can install it directly from their library manager.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 2894
Location: Cambridge, UK

PostPosted: Mon Apr 24, 2017 5:38 pm    Post subject: Reply with quote

DecodeIR works with RMIR, IR.exe and IRScope (and possibly other programs I am not aware of). IR.exe is now a legacy program, and others may consider IRScope to be so as well, as I understand IRScrutinizer also works with Widgets though I have never used it. So I suppose it is not of great significance if the current version of DecodeIR is "frozen" but remains available for use with these legacy programs.

This leaves RMIR as, to my knowledge, the only program still under active development that uses DecodeIR. I don't want to stand in the way of progress but would hope that whoever creates a replacement for DecodeIR will also do the necessary editing of RMIR to interface it to this replacement. Both Barf and 3FG are capable of this and I have no objection to them doing it. As for Barf updating the DecodeIR source in SourceForge, I think that is a matter for 3FG alone. I gave up responsibility for DecodeIR a long time ago and am most unlikely to want to work on it again in future.
_________________
Graham
Back to top
View user's profile Send private message
3FG
Expert


Joined: 19 May 2009
Posts: 3239

PostPosted: Mon Apr 24, 2017 10:39 pm    Post subject: Reply with quote

As I have written before, I don't plan to do any more work with DecodeIR, and I have no special interest in the source code. Furthermore, I'm simply not capable of dealing with C++ code if it is a non-trivial program. Since barf has made some improvements, why not upload them to SF, assuming that the JNI stuff still works after the portability changes.
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 790

PostPosted: Tue Apr 25, 2017 8:43 am    Post subject: Reply with quote

I have uploaded my merged changes. So all the sources are there, consistent, should anyone feel summoned to create version 2.46 Wink

I also have added a small main routine, that makes it possible to invoke from the command line, at least on Linux and the like

Code:

$ decodeir 0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 06A4 015B 0057 0016 0E6C
protocol=NEC1 device=12 subdevice=34 obc=56 hex0=227 hex1=-1 hex2=-1 hex3=-1 misc= error=


I have also reformatted the code (except for the JNI functions), not because I like it better my way, but because it was very inconsistent.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Software 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