Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bluetooth Enabled Phone as Remote Control
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
LJM9000
Tux's lil' helper
Tux's lil' helper


Joined: 31 Aug 2006
Posts: 76
Location: United States

PostPosted: Tue Jan 08, 2008 2:34 pm    Post subject: Bluetooth Enabled Phone as Remote Control Reply with quote

I had been looking around lately about different remote control options for Gentoo. Mainly because I am lazy and when I am lying in bed do not want to have to get up to change/pause songs. I of course know about LIRC and looked into buying and building a receiver, but being the cheap ass that I am decided on looking for some bluetooth options. While researching I saw different options such as bluemote etc... These options were not viable because I have a regular cell phone that is not J2EE capable. So no luck there. Still wanting to get this working so I didn't have to pay came up with this instead. Why not use the ability of all bluetooth capable phones to send contact (AKA Vcard). Now for the interesting stuff..


PC SETUP
=======
1. Set up bluetooth and make sure you can pair with your phone. You can follow this guide here http://www.gentoo.org/doc/en/bluetooth-guide.xml.
NOTE: Make sure that you use the Serial Port Service Channel on your phone. In my case its Channel 16 (LG UX245 aka LG VX5300). I found it by using kbluetoothd on a friends computer since I don't use KDE. Im sure someone else can shed some light on a different way to see it.
Also in /etc/bluetooth/rfcomm.conf make sure you have

Code:
 # Automatically bind the device at startup
        bind yes;


2. Install sobexsrv
Code:
emerge sobexsrv

3. Start the server
Code:
sobexsrv -IS -r /home/user/btremote

NOTE: You can use any directory that you want. I just chose a directory that I made in my home. Then had the server autostart

Here is my script that I use
Code:

#!/bin/bash
# r.sh
# basic bluetooth remote

ANext="AaNext.vcf"
APrev="AaPrev.vcf"
APause="AaPPause.vcf"
criteria=".vcf"

while [ 1 ]
do

for i in $( ls *$criteria* 2>/dev/null );
do
   src=$i
   #Check What the command is
   if [ "$src" = "$ANext" ]; then
        dcop amarok player next
   fi
   if [ "$src" = "$APrev" ]; then
        dcop amarok player prev
   fi
   if [ "$src" = "$APause" ]; then
        dcop amarok player playPause
   fi

   #Delete the File
   rm $src
done
sleep 2
done


4. Copy the above into a file and save it
5.
Code:
chmod +x r.sh

6. Run the script

As you can see the bash script is really simple and easy to edit/use
Hopefully this helps someone else.

PHONE SETUP
=========

1. Pair with the PC
2. Add contacts corresponding to the above names. In my case they are AaNext, AaPause, AaPrev (Used Aa as a prefix so they show up first when I enter the contacts menu. The telephone numbers don't matter.
3. (May Differ per phone but should be similar) Open Contacts Up.
4. When the contact AaNext for example is highlighted click on Options
5. Choose Send via Bluetooth
6. Select the PC (You should have already paired with)
7. Listen to the music change tracks


As you can see this could be used to do any track from away from your computer.

Pretty Cool Huh :lol:
Back to top
View user's profile Send private message
quark
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2003
Posts: 102
Location: Hessen, Germany

PostPosted: Thu Jan 10, 2008 11:25 pm    Post subject: Reply with quote

It is indeed cool. However, I am too lazy to implement this, and will be jumping out of the bed instead when willing to change the song :wink:
_________________
HP Compaq nx9420 || Intel Core2 CPU T7200 @ 2GHz | 2Gb RAM | 120Gb HD
HP Compaq nc2400 || Intel Core Duo CPU U2500 @ 1.2 GHz | 2Gb RAM | 120Gb HD
Back to top
View user's profile Send private message
cwng
n00b
n00b


Joined: 21 Nov 2002
Posts: 68
Location: Singapore

PostPosted: Tue Jan 15, 2008 6:45 am    Post subject: Reply with quote

I am wondering if the command in the "if ... fi" part be something which simulate keyboard events, and use it for controlling slides during presentation (like Impress or even better, Powerpoint w/ wine).
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Wed Jan 16, 2008 6:59 am    Post subject: Reply with quote

Or if you are like me and have a newer Sony Ericsson phone you can just do this:

Menu->Entertaninmen->Remote Control

Then chose a profile and connect to your computer as an HID using a PIN of your choosing.

It helps if you pair them prior.
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
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