Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jmac0621

macrumors newbie
Original poster
Jul 7, 2014
2
0
Hi.

I am basically looking for a good starting point in creating a web page that would allow a user to control a Bluetooth device from the page.

I have the Bluetooth 4 LE hardware already that works with an iOS app only, but I am wanting to expand the accessibility to other platforms.

My hope is to go on a smart phone or computer's browser, type in the url and be presented with controls for the Bluetooth device. So, whether you are on your phone or desktop, the controls would sent commands via the computer's or phone's Bluetooth to the board.

Thanks!
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
Hi.

I am basically looking for a good starting point in creating a web page that would allow a user to control a Bluetooth device from the page.

I have the Bluetooth 4 LE hardware already that works with an iOS app only, but I am wanting to expand the accessibility to other platforms.

My hope is to go on a smart phone or computer's browser, type in the url and be presented with controls for the Bluetooth device. So, whether you are on your phone or desktop, the controls would sent commands via the computer's or phone's Bluetooth to the board.

Thanks!

Can you clarify exactly what you want to do. As far as I can tell from what you have written you want to access a URL which will allow remote control of a bluetooth device. Is that correct?

Or do you want to access a URL and have control of a local bluetooth device on the same computer as the browser is accessing the page?

Depending on which you want the answer will be different. If you want both then it might be somewhat more complex than you are currently thinking.
 

jmac0621

macrumors newbie
Original poster
Jul 7, 2014
2
0
In the long run, I would like to be able to get it to work with other credentials. One could access a URL, use Facebook or Google credentials, and can control Bluetooth devices of other users or your own Bluetooth device. But that's above and beyond what I am wanting to do now.

Basically, I'd be happy with a web UI that can control a local Bluetooth device on the same computer as the browser.

Some added information: I don't know the profile used, but the Bluetooth device does not need to be paired with the iPhone from Settings>Bluetooth. You open the iOS app, and if Bluetooth is on, you can connect and control. I would like the web UI to work similarly. Load the URL from a computer or smart phone, and start controlling the device without pairing.
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
Basically, I'd be happy with a web UI that can control a local Bluetooth device on the same computer as the browser.

This is going to be a problem. The browser doesn't allow access to local hardware to client side code (or for that matter server side code for obvious reasons). The only way you are going to be able to access local hardware is if you write an app that will run on the local machine. You can use whatever programming language for this (although if you are targeting Macs then Objective-C would probably be the best bet - if you are targeting Windows as well and possibly even Linux on top then Java is likely to be the best option).

But bear in mind that the user will actually have to download a program and run it on their machine. You'll then need to communicate with your server. The easiest method is to have an HTTP RESTful API and then send and receive JSON or XML.

The important thing to note is that you won't be able to do what you want to do entirely in the browser. It just isn't allowed due to security reasons. There is a reason browsers run JavaScript in a sandbox environment and that is limit what potentially malicious code can do to your machine. Stopping direct access to local hardware is one part of that protection.
 

jtara

macrumors 68020
Mar 23, 2009
2,008
536
I don't get it.

Is the Bluetooth device in the server room?

If you want to control a Bluetooth connection between a phone or desktop and a Bluetooth device, I don't see how anything you might do on a server could help.

This might be a good candidate for an HTML5 feature, but as far as I know, this hasn't even been proposed.

This is probably as close as you're gonna get:

http://brulee-sdk.com

You can use this in PhoneGap apps, and you can use it on desktop, but the user has to install a browser plugin.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.