maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   The Other Half (https://talk.maemo.org/forumdisplay.php?f=59)
-   -   IR-OH + Software (https://talk.maemo.org/showthread.php?t=92687)

stb 2014-02-13 15:58

IR-OH + Software
 
Summary:
Creating an Infrared Emitter (and Receiver) Other Half + Software to use your Jolla as Universal Remote (like e.g. Logitech Harmony).


-------------------------------------------------------------
The idea seems pretty obvious, at least to me, but I did not found anything about this. Therefore I'm going forward and start collecting ideas on how this can be done.

Hardware (The Other Half):
Since IR is a bit time-critical, especially sending, I think the timing should be done on a µC rather than on the Jolla itself.
The emitter/receiver circuit should be fairly simple, there are lots of examples in the net (see the link below in Interface).


Interface Hardware - Software:
The receiver should only be active when requested to safe power. (I'm not trying to make the Jolla be controllable by an remote)

For interfacing the Hardware with the OS we could use LIRC (http://www.lirc.org):
Pros:
  • Network support for free
  • Existing device database

Cons:
  • Kernel driver needed (I'm not sure how to do this. Also the move of LIRC (or parts of it) into the kernel made this not easier)

I also found a nice project that can send and decode many IR protocols on an avr (it's in german: https://www.mikrocontroller.net/articles/IRMP):
Pros:
  • Think it supports more protocols than LIRC
  • Software just needs to read the decoded message and save it to be later send.

Cons:
  • sending and reading libraries need 8kB on the avr with all protocols activated


Software:
What it should support:
  • Profiles (living room, kitchen, friends living room). Unlike a Universal Remote, I have my mobile with me most of the time, so it's not stationary.
  • Activities (chaining together signals, like e.g. Logitech Harmony does)
  • User defined Layout for activities and devices. I never done QML before, but from a quick look at the reference and tutorials this should be doable.

So, what do you think? Useful, possible? Feedback and help welcome.

nokiabot 2014-02-13 16:06

Re: IR-OH + Software
 
Someone finally ! Long live stb :)

jflatt 2014-02-13 16:38

Re: IR-OH + Software
 
Hardware looks easy, plenty of stuff out there, such as CtrlM which has open schematics and parts < $20

kimmoli 2014-02-13 20:44

Re: IR-OH + Software
 
some IR work in progress here too... http://talk.maemo.org/showthread.php?t=92382
All components ready, pcb still waits finalising layout

stb 2014-02-13 21:08

Re: IR-OH + Software
 
Are there kerneldrivers availabel for the ICs? This would eliminate the need of writing one and LIRC would work out of the box I guess.


From what I learned so far, the timing for sending has to be more precisce than for receiving. I would rather go with a µC (avr) based approach, even though RS232 could be used for other stuff.

Think I have more reading to do, especially how the IR would be send with the SC16IS.... .
But I definitely would not expose it to a connector. Just an Emitter/Receiver at the top of B (when using your mapping of the Jolla), facing 30-45° away from A direction.

kimmoli 2014-02-13 22:15

Re: IR-OH + Software
 
No need to make kernel driver. I2C can be accessed from userspace (but needs to be root), i use this approach with my oled toh. there is daemon started in boot (systemd) and it creates a dbus service which to i can send commands (call methods) from QML application (when needed).

There is then three part sw, QML application which looks nice and sends dbus calls to the daemon, which translates them to I2C bus messages sent to uc firmware, which further translates them to correct IR protocol.

Arduino based stuff can be connected easily into the I2C (done this in eink toh proto), and there are IR libraries available (e.g. https://github.com/shirriff/Arduino-IRremote)

stb 2014-02-13 22:39

Re: IR-OH + Software
 
I edited my last post before I read your new one.

I know the i2c can be accessed from userspace. But from what I have read from the SC16IS... datasheet so far, it only encodes/decodes IrDA SIR. So how would you encode/decode the IR protocols from remotes? It think this can then only be done in the OS.

The part about the kernel driver is needed for interfacing it with LIRC. But maybe its LIRC-driver, as I wrote above the fact that LIRC is moved to kernel confused me.


All times are GMT. The time now is 03:37.

vBulletin® Version 3.8.8