Page 1 of 1

Simple Java Bluetooth Server

Posted: Sun Jun 19, 2016 8:40 pm
by toriacht
I have a simple Java bluetooth server copied from the example here http://digitalhacksblog.blogspot.ie/201 ... e-spp.html (digital hacks blog.).. SimpleSPPServer.java (code)

I have included the following in my executable jar

Code: Select all

 <dependency>
  <groupId>net.sf.bluecove</groupId>
  <artifactId>bluecove</artifactId>
  <version>2.1.0</version>
</dependency>

  <!-- bluecove-gpl required to run bluecove on Linux-->
  <dependency>
      <groupId>net.sf.bluecove</groupId>
      <artifactId>bluecove-gpl</artifactId>
      <version>2.1.0</version>
  </dependency>

  <!-- http://mvnrepository.com/artifact/net.sf.bluecove/bluecove-emu -->
  <dependency>
      <groupId>net.sf.bluecove</groupId>
      <artifactId>bluecove-emu</artifactId>
      <version>2.1.0</version>
  </dependency>
I have installed the following library on my pi, based on advice/several examples, tutorials around the web...

Code: Select all

apt-get install libbluetooth-dev
However when i run the server i get the following library error:

Code: Select all

pi@raspberrypi:~/workspace/bluetooth-server $ java -jar /tmp/btoothserver-1.0-SNAPSHOT-jar-with-    dependencies.jar 
Native Library bluecove_arm not available
Exception in thread "main"     javax.bluetooth.BluetoothStateException: BlueCove Library bluecove not available
at     com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(    ... 
...     javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at com.app.bluetoothserver.App.main(App.java:60)

I am running Raspberry Pi 3 with internal bluetooth...

Code: Select all

pi@raspberrypi:~ $ lscpu
Architecture:          armv7l
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
Model name:            ARMv7 Processor rev 4 (v7l)
CPU max MHz:           1200.0000
CPU min MHz:           600.0000
pi@raspberrypi:~ $ 
Any help with solving this issue or alternative way to setup a simple (java preferrably) server like this much appreciated. The executable jar can be accessed here: https://www.dropbox.com/s/7sso310m6wxw6 ... s.jar?dl=0 (i hope this is allowed ? )

Thanks in advance...