FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Running a command on device detection

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
d_mc_a
Newbie


Joined: 24 Jun 2007
Posts: 6

PostPosted: Sun Jun 24, 2007 4:34 pm    Post subject: Running a command on device detection Reply with quote

I just wondering if it is possible with Salling clicker to have a command run when a specific bluetooth device connects. I've been trying to find software that will do this for a while now. For example. I could have multiple bluetooth devices that have a relatively short range. When i walk into Bluetooth_A's range, my phone connects to it, and a command is run. When i leave its range, another command is run. If I move into Bluetooth_B's range, the same happens. I'm hoping to implement a Media Centre with Functions that follow u around the house. Right now, I have 2 TV connected to a media centre, and 2 Sound systems connected through two different Sound adapters. I have batch file created that will switch between the two systems with a simple double click. I can easily just manually switch them using the phone, but wouldn't it be cool if I was watching a film in the sitting room, I want a drink. Walk in to the kitchen (with your phone on your person) and the the media centre pauses the film, runs the batch file thats swaps sound adapters and switched VGA to the other adapter and continues playing :P

Sorry bout long winded message
Back to top
View user's profile Send private message
melquiades
Junior Member


Joined: 24 Nov 2006
Posts: 50
Location: Washington, DC

PostPosted: Wed Jun 27, 2007 3:29 am    Post subject: Reply with quote

sounds like an awesome idea! Have you tried toying around with the "enteringproximity" and "leavingproximity" functions?
Back to top
View user's profile Send private message
melquiades
Junior Member


Joined: 24 Nov 2006
Posts: 50
Location: Washington, DC

PostPosted: Wed Jun 27, 2007 4:21 am    Post subject: Reply with quote

Here's the sample format of a script I use to launch programs when entering the room. Change the file path in the script to whatever it is you're trying to open (this example opens Notepad).

If you want the program to execute when you leave the room, change "enteringproximity" to "leavingproximity."


Give it a shot, let me know if you have Q's.

Mel



notepad.zip
 Description:
Extract to "my clicker scripts" and enable "Open notepad when entering proximity" under "Phone Events".

Download
 Filename:  notepad.zip
 Filesize:  702 Bytes
 Downloaded:  1130 Time(s)

Back to top
View user's profile Send private message
d_mc_a
Newbie


Joined: 24 Jun 2007
Posts: 6

PostPosted: Wed Jun 27, 2007 7:18 pm    Post subject: Reply with quote

Thanks melquiades, I'll give your script a try and see If it helps. I 'frankenstein'd' a script to do that too but it turned out evil :twisted: . I think the range of my bluetooth dongles is too good. It doesn't actually leave the range of the first receiver without a bit of walking.

I'll let you know how it goes...
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Jun 27, 2007 8:19 pm    Post subject: Reply with quote

Tro things to consider:

1. The Bluetooth stack had a built-in timeout that causes us to not detect the out-of-range disconnect until after about 30-60 seconds. (This timeout also prevents unintended connection breaks, so this is a good thing)

2. Make sure your script code runs rather quickly. If you need to perform a time-consuming task, spawn a separate process to do so.

Best.
--
Jonas

[quote="d_mc_a"]Thanks melquiades, I'll give your script a try and see If it helps. I 'frankenstein'd' a script to do that too but it turned out evil :twisted: . I think the range of my bluetooth dongles is too good. It doesn't actually leave the range of the first receiver without a bit of walking.

I'll let you know how it goes...[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
d_mc_a
Newbie


Joined: 24 Jun 2007
Posts: 6

PostPosted: Fri Jun 29, 2007 10:36 pm    Post subject: Reply with quote

Thanks for the advice, Is there any way to reduce the 30 second timeout in the BT Stack? Maybe drop it to 10 seconds. I was also wondering, I'm mostly connected by WIFI to salling clicker. WIFI isn't any good for running processes when out of range as the range is too great :P. Is there a way to connect using WIFI to Salling clicker and just use the bluetooth connect to poll device's in range. I think it would be a lot more useful to do this. The bluetooth could only poll a device and not have to be connected. Polling say every 15 seconds for device's in range. It would be cool to have run different programs when certain devices enter the BT area.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Sat Jun 30, 2007 11:48 am    Post subject: Reply with quote

Polling would be terrible, as the scan blasts the same radio spectrum that WiFi uses, causing interference with your networking if you're on a laptop.

Some stacks may have visible or hidden settings for the "supervisor timeout" value. Can't say I've seen it myself, though.

Best.
--
Jonas

[quote="d_mc_a"]Thanks for the advice, Is there any way to reduce the 30 second timeout in the BT Stack? Maybe drop it to 10 seconds. I was also wondering, I'm mostly connected by WIFI to salling clicker. WIFI isn't any good for running processes when out of range as the range is too great :P. Is there a way to connect using WIFI to Salling clicker and just use the bluetooth connect to poll device's in range. I think it would be a lot more useful to do this. The bluetooth could only poll a device and not have to be connected. Polling say every 15 seconds for device's in range. It would be cool to have run different programs when certain devices enter the BT area.[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bove
Newbie


Joined: 18 Jul 2006
Posts: 12
Location: Nittedal, Norway

PostPosted: Fri Jul 27, 2007 2:09 pm    Post subject: Reply with quote

Idea:

Entering proximity executes a Wake-On-Lan script on pc1 to turn on pc2.

Someone wonna give it a try?
Back to top
View user's profile Send private message Visit poster's website
d_mc_a
Newbie


Joined: 24 Jun 2007
Posts: 6

PostPosted: Fri Oct 05, 2007 11:25 am    Post subject: WOL on proximity Reply with quote

Yea, I have actually done this already and it works perfectly. I have an S60 phone with wifi and I have dev'd an app that just blindly sends a preregistered magic packet when connected to wlan. It's a fairly simple app that just waits for a connection to become active and once it does, it sends the magic packet. The only problem with this is that the wireless range is too good. You can be too well away from the pc and it will turn on. I would like to port this to work over Bluetooth but the only way that I can see that working is to have a dedicated pc near the one you would like to switch on with a bluetooth dongle connected. When you walk in range of the is pc, it could do the same thing.

Does anyone know of a router that can send magic packets? Or even that supports bluetooth? That would be very useful!!
Back to top
View user's profile Send private message
soldstatic
Newbie


Joined: 24 Jan 2008
Posts: 16

PostPosted: Thu Jan 24, 2008 7:26 am    Post subject: Reply with quote

Hey just wanted to say thanks for the script you made, I was having trouble trying to figure out how to run batch scripts etc. Got it now, thanks! :)
Back to top
View user's profile Send private message
Mihail
Newbie


Joined: 02 Feb 2008
Posts: 4
Location: Russia, Moscow.

PostPosted: Sat Feb 02, 2008 4:47 am    Post subject: Re: WOL on proximity Reply with quote

[quote="d_mc_a"]Does anyone know of a router that can send magic packets? Or even that supports bluetooth? That would be very useful!![/quote]
Nothing is impossible! It is not sikret that there are routers with firmware variable - such as Asus WL-500g Premium. Here is a site with a custom firmware for it http://wl500g.info/
The website give detailed instructions what you need to do. Now you have on your routers Linux ready access to telnet (you can also download ssh). The router has 2 usb port, so if you have bluetooth-usb adapter and special drivers for it, it is possible to organize above idea. But I would have otherwise received and responded to power of wifi signal.

p.s. sorry for my english! I am from Russia and, in some cases, need to use a translator.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group