-1

I am looking for a solution in java for recording inputs for LIRC codes of any remote.

i have tried

 Process p = Runtime.getRuntime().exec("mode2 [driver_details] -m");

it executes but hangs the UI and i cant stop it implicitly...

every time i had to stop it forcefully...

please help me i have been looking for the answer for 2 months and i got nothing..

or suggest me some library for java for LIRC..

i have tried jlirc but i cant found to record the raw inputs... similarly i can send the ir signals using same method and didn't faced any problem.

I have even tried waitfor() method of process but didn't got anything

gre_gor
  • 6,669
  • 9
  • 47
  • 52

1 Answers1

0

First of all there is already at least one Java application which can record LIRC codes for any remote: IrScrutinizer at http://www.harctoolbox.org/IrScrutinizer.html

That said, you did not mention the lirc version used. IIRC, older versions including the really old 0.9.0 was not able to redirect the mode2 output. So, if you still want to follow this path, updating lirc to current 0.9.4b is a starter. Depending on your platform this might or might not require you to build it from upstream sources from https://sourceforge.net/projects/lirc/files/LIRC/0.9.4b/

Note that the update from 0.9.0 to 0.9.4 is non-trivial, the configuration is very different.

leamas
  • 151
  • 1
  • 6
  • Sorry for the half comment.... I have seen and tried it... but i couldnt figure out how to use it with raspberry pi... and for the LIRC i am on 0.9.4... and mode2 is redirecting the output... i want to make program which can learn codes on my command and save it to the config file and call it on my command with irsend... but when i call mode2 it makes GUI hang and in background it continuously runs... so when i am done recording i always had to forcefully close the program which ultimately leads to nothing... I hope you could help me in setting up IrScrutinizer. – lokesh dewani Oct 17 '16 at 17:09
  • You should try the lirc mailing list at http://sf.net/p/lirc. Bengt, the creator of IrScrutinizer hangs around there and is usually willing to help – leamas Oct 19 '16 at 12:26
  • BTW, mode2 is really just designed to be used from the command line. The only way to stop it from "outside" is sending it a signal such as SIGQUIT. Some other lirc tools makes a clean exit on SIGUSR1 but not mode2; feel free to file an upstream bug about this. – leamas Oct 19 '16 at 12:33
  • BTW, #2. To actually record arbitray remotes to be able to send using irsend is more complicated than recording the mode2 output. E. g., mode2 outputs space/pulse durations, a type of input irsend does not accept. You need to look at irrecord or irScrutinizer depending on your needs. From 0.9.4 irrecord is splitted into an UI and a library, so it should be technically possible to create a new UI. However, using java is probably not your best bet here since the C library is inmature. – leamas Oct 19 '16 at 12:49