Bluetooth Binding

411 views
Skip to first unread message

travelfox42

unread,
Aug 23, 2011, 6:32:49 AM8/23/11
to openhab
Hi, on windows the bluetooth binding doesn't work:

10:40:30.619 ERROR o.o.b.b.i.BTDeviceDiscoveryService[:238] - Error
while initializing local bluetoo
th device.
javax.bluetooth.BluetoothStateException: BlueCove libraries not
available
at
com.intel.bluetooth.BlueCoveImpl.createDetectorOnWindows(BlueCoveImpl.java:
922)
at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:460)
at com.intel.bluetooth.BlueCoveImpl.access
$500(BlueCoveImpl.java:69)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:
1044)
at java.security.AccessController.doPrivileged(Native Method)
at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:
1042)
at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:
1035)
at
javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:
75)
at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:
95)
at
org.openhab.binding.bluetooth.internal.BTDeviceDiscoveryService.run(BTDeviceDiscoveryServ
ice.java:134)

Do I need to manuylly install some bluetooth libraries?

travelfox42

unread,
Aug 23, 2011, 7:12:16 AM8/23/11
to openhab
I place bluecove-2.1.0.jar in the lib directory. Now I get a different
complaint:
Native Library intelbth_x64 not available
Native Library bluecove_x64 not available
Bluecove only include 32 bit versions.

Kai

unread,
Aug 23, 2011, 2:26:10 PM8/23/11
to openhab
Usually the bluetooth binding already includes a bluecove library, so
there is no need to install an additional one:
http://code.google.com/p/openhab/source/browse/#hg%2Fbundles%2Fbinding%2Forg.openhab.binding.bluetooth%2Flib

Your error messages sound as if you are running a 64bit Windows? I
have so far only tested it on 32bit Windows, where it works without
problems.

The problem seems to be discussed here: http://code.google.com/p/bluecove/issues/detail?id=109
Scanning over it, I didn't really understand, whether this is still
open, solved or if there is a stable workaround. Maybe you can have a
try yourself with things like "-D32" option.

Cheers,
Kai

creekdiver

unread,
Aug 24, 2011, 8:13:47 PM8/24/11
to ope...@googlegroups.com
The bluecove docs talk about different scenarios used by bluecove to look for the location of the native dlls.
A possible remedy for the error is to add  -Dbluecove.native.path=/path/dirwithdlls to the startup command parameters of openhab.  The /path/dirwithdlls should be a directory with the dlls that you can extract from the bluecove-2.1.1 jar archive. 

travelfox42

unread,
Sep 2, 2011, 3:56:53 AM9/2/11
to openhab
-D32 switch is already in start.bat and does not help. There is a 64
bit version of intelbth.dll available on the bluecove site, but the
bluecove_x64.dll is still missing. Anyway, the bluecove project has
not released any new snapshot fopr quite a year now, do you think,
it's still alive? Maybe, openHAB should look for an Bluetooth
alternative?

André Füchsel

unread,
Sep 19, 2011, 8:46:39 AM9/19/11
to openhab
Any working alternative for bluetooth on Windows 7 64 bit? The
bluecove project seems to be dead.

André Füchsel

unread,
Sep 29, 2011, 3:30:48 AM9/29/11
to openhab
Any ideas?

Kai

unread,
Sep 29, 2011, 3:52:03 AM9/29/11
to ope...@googlegroups.com
No, BlueCove looked like the best choice when I was searching for a suitable BT Java lib a year ago... It's always a problem if such a project is not maintained any further, so somewhen we might have to change the library (but is there anything else available as open source?)

Kai

P.S.: Most of your problems seem to derive from the fact that you are using 64bit Windows. Ever considered a Mac? ;-)

André Füchsel

unread,
Sep 29, 2011, 7:03:13 AM9/29/11
to openhab
> P.S.: Most of your problems seem to derive from the fact that you are using
> 64bit Windows. Ever considered a Mac? ;-)

:-)

Yes and no. I love my iPhone but I am working with Windows since
Version 3.0 so too late for me to switch to a Mac. Though they look
great... However, since Windows 7 and 64 bit Windows is rapidly
replacing all the XP installations out there we need to solve the 64
bit problems sooner or later. I have similar problems with the serial
binding (see my other thread).

André Füchsel

unread,
Sep 29, 2011, 7:05:50 AM9/29/11
to openhab
> No, BlueCove looked like the best choice when I was searching for a suitable
> BT Java lib a year ago... It's always a problem if such a project is not
> maintained any further, so somewhen we might have to change the library (but
> is there anything else available as open source?)

No, I haven't found anything useful. The only thing I found was
javabluetooth.org but this seems to be far from being mature. It is
based on the assumption, that the bluetooth device can be accessed
using a serial port, therefore it is based on javax.comm, which is,
surprise, surprise, not developed anymore for Windows. So the open
source alternative is RXTX, and this comes down to the serial problem
I discussed in the other thread. :-(

Kai

unread,
Sep 29, 2011, 3:09:33 PM9/29/11
to ope...@googlegroups.com
I am working with Windows since  
Version 3.0 so too late for me to switch to a Mac.

It's never too late :-)
 
However,  since Windows 7 and 64 bit Windows is rapidly
replacing all the XP installations out there we need to solve the 64
bit problems sooner or later.

Totally agree, especially as openHAB should be as platform independent as possible - being based on Java/OSGi I had the hope that that is not too difficult to achieve; but I had to learn that accessing hardware from Java is not as easy as one would hope...

dong...@umc-project.de

unread,
Jun 11, 2013, 7:14:35 AM6/11/13
to ope...@googlegroups.com
Had the same problem today while trying to run the runtime on a Win 64bit platform.
Solved it by just starting openhab with a 32bit JRE

Wajid Malik

unread,
Jul 16, 2014, 1:57:14 AM7/16/14
to ope...@googlegroups.com, afue...@googlemail.com
Hello i need some help if anyone can help me please.

I have installed OPenhab core, openhab designer on my windows machine.
now i have copied bluetooth binding to my Add ons directory.

i want that when my mobile bluetooth is on and is in range then the core should display as MyMobile  state updated to ON and when its not in range or OFF it should display as updated to OFF and also when its ON n detected then a message should be sent to hangout or gtalk etc.

Can anyone help me how to do this, i m not a programmer so getting confused with coding etc

My Items file is like this:

Switch MyMobile                                           { bluetooth="MAC of My mobile's bluetooth!" }
String UnknownDevices    "Unknown devices in range: [%s]" { bluetooth="?" }
Number NoOfPairedDevices "Paired devices in range: [%s]"  { bluetooth="!" }


this is my rules file:

rule "bluetooth ON"
when
Item MyMobile received command ON
then
{
MyMobile.sendCommand(ON)
}
end

rule "bluetooth OFF"
when
Item MyMobile received command OFF
then
{
MyMobile.sendCommand(OFF)
}
end

I FEEL THAT THERE WOULD BE ISSUE IN RULE FILE , BUT WANT TO HAVE YOUR EXPERT SUGGESTIONS THAT WHAT WOULD BE THE ISSUE AND WHAT SHOULD I DO ADDITIONALLY TO ACHIEVE MY GOAL OF MOBILE BLUETOOTH STATUS AND SENDING MESSAGE TO HANGOUT ETC
Reply all
Reply to author
Forward
0 new messages