Navigation » MPC Club Community Board > Media Player Section > Media Players anno 2012 > HDI Dune » [HOWTO] emulate button presses using Telnet/SSH

Notices

» Slysoft Recommended!
1 CLick BD and DVD backups
Download AnyDVD HD!
For Blu-Ray and DVD!
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Stats
Members: 85,435
Threads: 29,403
Posts: 248,069
Welcome to our newest member, -Cherry-
» MPC Club Advertisers and Sponsors
Reply
 
Thread Tools
Old 10-05-12, 17:26   #1
Gennoise
.NET Ninja


TIP: Upgrade to Premium
Senior Member
 
Gennoise's Avatar
 
Join Date: Apr 2011
Location: Belgium
Posts: 940
Contribution: 0.38%
Thanks: 16
Thanked 187 Times in 104 Posts
Downloads: 0
Uploads: 0
Default [HOWTO] emulate button presses using Telnet/SSH

Introduction

I was just looking through some of my Dune's system files, just minding my own business when I came across this proc entry: /proc/ir/button.
It looked interesting, but quick inspection using the cat program revealed that it doesn't return any text. I didn't think much of it at first, but then I tried to write to it using Echo commands. Curiously the echo commands did not throw any errors. So I tried to echo IR NEC codes (in reverse*) to the file to see what happens. Eureka! It was just as if I was pressing the buttons on my remote control.

How to

First you need to enable Telnet or SSH access. Having a working knowledge of linux filesystems and shell commands is helpful but not strictly necessary. I'm a total idiot when it comes down to linux myself so don't let it hold you back.

(If you need help setting up access, I've already made a little tutorial in my other thread here.)

The command that you need to use to emulate button presses is:
Code:
echo [ReverseNecCode] > /proc/ir/button
where [ReverseNecCode] is one of the codes listed on this page, in reverse*.

*: Why in reverse? I'm glad you asked!
The CPU uses the little-endian byte order to store bytes into memory. This means that in any given numeric value, the 'smallest' byte (least significant byte) is the first one in the array, and the 'largest' byte (most significant byte) is the last.


Example
To emulate the MUTE button, first we need to get the NEC code from the list. After a quick look through the document, we found the following value: 00 BF 46 B9
Now we need to reverse the bytes. In our example, 'B9' is the least significant byte, so that one comes first in the sequence. 00 BF 46 B9 becomes B9 46 BF 00.

Add it all together, and you have the final command:
Code:
echo B946BF00 > /proc/ir/button
Et voilą. That's all there is to it.

Last edited by Gennoise; 10-06-12 at 06:31.
Gennoise is offline   Reply With Quote
The Following User Says Thank You to Gennoise For This Useful Post:
ScottJ97 (28-06-12)
Advertising
Advertising temporarily disabled
Old 24-05-12, 01:34   #2
ScottJ97

Senior Member
 
ScottJ97's Avatar
 
Join Date: Mar 2010
Location: San Francisco, CA
Posts: 649
Contribution: 0.26%
Thanks: 35
Thanked 114 Times in 94 Posts
Downloads: 0
Uploads: 0
Default Re: [HOWTO] emulate button presses using Telnet/SSH

Originally Posted by Gennoise View Post
For some reason, we can't send it just like that (if you know why, please post it below). For some reason, we need to reverse the bytes.
00 BF 46 B9 becomes B9 46 BF 00. Now it's ready to use.
Probably has to do with the endianness of the CPU, which is little-endian on the Dune.

Thanks for the writeup, although for most uses, the IP control is the more robust way to automate the Dune.
ScottJ97 is offline   Reply With Quote
Old 01-06-12, 08:21   #3
Gennoise
.NET Ninja


TIP: Upgrade to Premium
Senior Member
 
Gennoise's Avatar
 
Join Date: Apr 2011
Location: Belgium
Posts: 940
Contribution: 0.38%
Thanks: 16
Thanked 187 Times in 104 Posts
Downloads: 0
Uploads: 0
Default Re: [HOWTO] emulate button presses using Telnet/SSH

One particular thing I find it useful for is that you can write little shell scripts to automate button presses in a more organised way. I've not tried it (yet), but that would be alot harder to do client-side using batch files or vbscript. And you can access them on other computers without doing something funky like synchronising bookmarks.

But thanks for the tip. Seems like I have a bunch of reading to do on the endianness part. I don't know much about low-level stuff like that but I do want to get a better understanding of how it all comes together.
Gennoise is offline   Reply With Quote
Reply

Tags
emulate, remote control, ssh, telnet


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


» MPC top List...

TOP 5 Regular media players

  • Popcorn Hour C-300 (81%)
  • Mede8er Med500x2 (80%)
  • Dune SMART (D1) (65%)
  • HDI Dune Base 3.0 (52%)
  • DViCo TViX X-Roid (00%)

TOP 5 Hybrid media players

  • HDI Dune BD Prime 3.0 (75%)
  • HDI Dune HD SMART B1 (74%)
  • PoPCorn Hour C-200 (68%)
  • HDI Dune MAX (54%)

We do not recommend currently...

  • Xtreamer products
  • Hantech products
  • MViX products
  • DviCo products
  • HDX products
Powered by vBadvanced CMPS v3.2.1 - twisted by vbTwist and Hi-Jack (MPC Club)