Author Topic: Preview Release of eiri: A Command Line and Network Interface to the IR Port  (Read 7529 times)

June 03, 2009, 03:11:22 PM
Read 7529 times

elmarweber

  • Hero Member

  • Offline
  • *****

  • 500
    • WDTV Tools
I had some time to finish the IR adapter Iíve been working on. A preview release of eiri (extended infrared interface) is available at http://sourceforge.net/project/downloading.php?group_id=261153&filename=eiri-r128-wdtv.zip.

eiri is an improved alternative to irset. It allows you to send IR commands to the WDTV GUI from the command line, thus enabling third party applications like web pages or SSH to control the WDTV GUI. Compared to irset it fixes some bugs, namely the 100% CPU utilization and it supported repeated keys (so you can hold down UP/DOWN and it is executed again without the need to press it again). Furthermore it adds a network mode that can be used to control the WDTV from a remote device over the network.

For more details and usage info you can read the detailed article at http://wdtv.elmarweber.org/index.php/2009/preview-release-of-eiri-a-command-line-and-network-interface-to-the-infrared-port.

Future versions will incorporate the ability to map commands from other remotes and this way the possibility to replace the WDTV remote. Another goal is to rebind keys, so that when you press the search key the search dialog no longer opens but instead the language changes.

As with all preview releases the target audience are advanced end users and developers that want to test things. The goal is to test if the application works on a broader base of devices. The application image does nothing permanently to your WDTV, so if you experience any problems simply delete the application from your USB stick.

June 03, 2009, 03:17:29 PM
Reply #1

savant

  • Full Member

  • Offline
  • ***

  • 105
Outstanding, can't wait to give this a go when I get home. Is the source code available?

June 04, 2009, 12:47:40 AM
Reply #2

beanian

  • Jr. Member

  • Offline
  • **

  • 82
is it possible to create new IR codes that when executed will goto a specific folder? IE. i have a logitech harmony remote that works great with the WDTV however when i press watch Movie on the remote it would be great if it could send a code to the wdtv that would open up my movies folder and likewise with Pictures/Music.
IS this possible with this tool? Or even possible at all?

June 04, 2009, 01:28:50 AM
Reply #3

realtebo

  • Full Member

  • Offline
  • ***

  • 132

Future versions will incorporate the ability to map commands from other remotes and this way the possibility to replace the WDTV remote. Another goal is to rebind keys, so that when you press the search key the search dialog no longer opens but instead the language changes.

weecommand.app.bin
Browse and add IRC download via OSD
Prototype 3
Actually stopped

June 04, 2009, 01:39:59 AM
Reply #4

j450n

  • Newbie

  • Offline
  • *

  • 17
Cool, I can use this to turn my mate's WDTV off [standby] after rebooting it, it's 350KM away. a bit far to walk. 8)

Thanks!
« Last Edit: June 04, 2009, 01:56:20 AM by j450n »

June 04, 2009, 05:58:01 AM
Reply #5

elmarweber

  • Hero Member

  • Offline
  • *****

  • 500
    • WDTV Tools

June 04, 2009, 06:01:30 AM
Reply #6

elmarweber

  • Hero Member

  • Offline
  • *****

  • 500
    • WDTV Tools
is it possible to create new IR codes that when executed will goto a specific folder? IE. i have a logitech harmony remote that works great with the WDTV however when i press watch Movie on the remote it would be great if it could send a code to the wdtv that would open up my movies folder and likewise with Pictures/Music.
IS this possible with this tool? Or even possible at all?

as quoted by realtebo the first part is possible in general, just not currently supported but it is in the planning.

To navigate to a specific folder would be possible with some considerations:
You must be able to conceive a sequence of IR commands that will always steer to that folder from any location in the (home) menu. Should be possible, I'm not sure if the HOME button always puts the device in movie mode, but when the device comes back from standby it is IMHO always on the same menu point.

ciao,
elm


June 04, 2009, 06:09:28 AM
Reply #7

elmarweber

  • Hero Member

  • Offline
  • *****

  • 500
    • WDTV Tools
Cool, I can use this to turn my mate's WDTV off [standby] after rebooting it, it's 350KM away. a bit far to walk. 8)

Do I dare ask what this setup is used for? =)


June 04, 2009, 03:56:12 PM
Reply #8

j450n

  • Newbie

  • Offline
  • *

  • 17
Quote
Do I dare ask what this setup is used for? =)

lol, I am his "network administrator".. honest! what else?  ;D

June 05, 2009, 12:39:55 AM
Reply #9

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
This really opens up a lot of possibilities. Web control and starting in Video folder for instance. Great work!

June 11, 2009, 03:58:14 AM
Reply #10

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
I'm working on a web interface to play files through the web interface. This way I could start a new cd from my laptop.

It will create all necessary remote control infra red commands using eiri.

Some intervals do not work. It seems 1000, 2000 and 5000 work but 3000 or 4000 seems to give an error and result in no pause.

Code: [Select]
# /apps/eiri/bin/eiric 4000
Error during mssleep: Invalid argument, 4, -294967296


June 12, 2009, 09:53:23 AM
Reply #11

elmarweber

  • Hero Member

  • Offline
  • *****

  • 500
    • WDTV Tools
I'm working on a web interface to play files through the web interface. This way I could start a new cd from my laptop.

Neat.


Some intervals do not work. It seems 1000, 2000 and 5000 work but 3000 or 4000 seems to give an error and result in no pause.

Code: [Select]
# /apps/eiri/bin/eiric 4000
Error during mssleep: Invalid argument, 4, -294967296

Thanks, it will be fixed in the next version. Just working on basic command remapping so that other remote controls are supported and then I'll release it.

I'm also thinking about integrating a basic webserver that just delivers files and provides the ability to execute shell and eiri commands as kind of a CGI interface. This would remove the dependency to the webserver app which I currently only have there for the remote control app.

ciao,
elm


ciao,
elm

June 13, 2009, 01:25:49 AM
Reply #12

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
Thanks for fixing it. The following values are working: 1000, 2000, 5000, 6000 and 9000. Which can be combined to create any other values. For instance 10 seconds would be 2x a pause of 5 seconds.

The remote control app is working, but I have to do the following to get it to work.

- Power off, Power on, wait 12 seconds (this is the only way to make sure the menu is in the position 'Video')
- Wait 2 seconds after any 'confirm' command (because the OSD is pretty slow in some cases)
- Wait 1 second after each button during navigation within a directory. First 0,5 was working, but sometimes it is too fast.

Then also:

- Sorting non A-Z is different than PHP sort function.
- Only RIGHT is used to navigate. So "Zero 7" is like 100x RIGHT. If works, but page down would be better.

I'll get a release out when I solve these previous two problems.

Then maybe I'll add event-osd support to see what the last directory was to prevent the restart and maybe also be able to navigate relatively to the last directory.

June 13, 2009, 05:00:09 AM
Reply #13

elmarweber

  • Hero Member

  • Offline
  • *****

  • 500
    • WDTV Tools
The remote control app is working, but I have to do the following to get it to work.

- Power off, Power on, wait 12 seconds (this is the only way to make sure the menu is in the position 'Video')

There is one exception, in case there is still a wdtv.ver file on the stick from a newer firmware it navigates to the "Upgrade Firmware" menu item. I noticed this because I did not delete the wdtv.ver file from my USB stick after an upgrade.

For a future release, it may be another option to navigate to the home screen with the HOME button and check what the current position is and then navigate accordingly. This is possible because the OSD loads/checks images based on the current selected menu item. You can check this in the event-osd log file:

Code: [Select]
DEBUG:       7880         eosd_getattr /apps/event-osd//osd-backup/image/home_settings_sm_icon_n.png
DEBUG:       7881         eosd_getattr /apps/event-osd//osd-backup/image/home_firmware_sub_icon_n.png
DEBUG:       7882            eosd_open /apps/event-osd//osd-backup/image/home_firmware_sub_icon_n.png

Maybe there is a pattern to this so you can determine which menu item is selected.


- Wait 2 seconds after any 'confirm' command (because the OSD is pretty slow in some cases)
- Wait 1 second after each button during navigation within a directory. First 0,5 was working, but sometimes it is too fast.

Then also:
- Sorting non A-Z is different than PHP sort function.
- Only RIGHT is used to navigate. So "Zero 7" is like 100x RIGHT. If works, but page down would be better.

If you don't require to keep the OSD directory in sync with your remote, an easier way to facilitate the playback may be:
- create a bind of the played back file in /tmp/media/usb/ and/or /tmp/media/usb/USB1

Code: [Select]
touch /tmp/media/usb/USB1/tmp.extension
mount -o bind /some/file /tmp/media/usb/USB1/test.extension

Since there are normally no files in the root directory, you can assume that it is the last one in the OSD display and thus simply navigate to it (when you are in the video menu):
- media lib disabled: ENTER UP ENTER
- media lib enabled: LEFT ENTER UP ENTER
- some other stuff in case thumbnails are enabled (maybe left instead of UP)

To speed up the directory change on the OSD it will go faster if you change the basic_browse.xml / basic_browse_video_thumb.xml to a file with no images and just the text/icons displayed and all XML content already included. This way the OSD just loads one file.

ciao,
elm

June 14, 2009, 02:04:34 AM
Reply #14

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
Thanks for all the info!

Maybe you could add the home menu position to the next event-osd release. Where the path would be for instance /home/video/ or /home/music/ since all the other paths always start with /tmp/media/usb/. This way we are aware of the home position also.

I'll see if I can hack the log using tail this way to find out where the home menu is positioned, or just add my own .event that writes the last path in /tmp/last-path.tmp or something.

Also I really like your idea to just mount the file temporarily somewhere closer so you don't have to navigate all the menus. This will speed up the process enormously. The real wait now is browsing through the NAS shares to find a certain cd.

Thanks again for the input. Going to try this later today maybe.