3

I'm having some difficulty running a leJOS pc program on my Raspberry Pi. It works on my PC.

I get an error stating: "Native Library bluecove_arm not available"

Bluetooth works fine otherwise using: "hcitool scan"

I can't find a compiled version of Bluecove for ARMv6 / Raspberry Pi.

I've installed Maven on my PC and installed the Maven Eclipse plug-in, in an attempt to compile Bluecove from the source files: though I can't see how to choose what platform I want to target (ARM11).

I noticed another user has asked a pretty similar question, but hasn't provided anything useful: My Java bluetooth server on raspberry pi running debian wheezy needs bluecove native library - where can I find it?

Community
  • 1
  • 1
krex
  • 345
  • 3
  • 8
  • 21
  • I haven't no, I don't know how I'd go about that.. I have the library source/project open in Eclipse: I can't imagine the Raspi being able to run eclipse with the necessary plug-ins. – krex Feb 23 '13 at 14:29
  • Is there another way to do it? I'm a student and I prefer to look for answer before bugging other people: but I'm utterly perplexed! – krex Feb 23 '13 at 14:30

2 Answers2

5

You want to:

  • Install Apache Ant onto your Raspi - sudo apt-get install ant
  • Download "bluecove-gpl-src.zip" and extract it to a directory on your Pi using command 'unzip'
  • Navigate to the folder inside "bluecove-gpl-src.zip", it should be something like "bluecove-gpl-2.1.0"
  • Inside this folder there should be a "build.xml" file, run the command ant all
  • Let the magic happen and viola. After it has built the project, you should now have a 'bluecove-gpl.jar' (or similarly named) file generated somewhere, it should tell you from the output of the build script where you can find it.
  • This "bluecove-gpl.jar" is then included in your Java application's classpath, along with a "bluecove-2.1.1.jar" (or similarly named) file.

Extra steps

One extra step I did before all of this was to install "Maven" on my pi: sudo apt-get install maven: then from the directory which contains the 'build.xml' file I run the command mvn eclipse:clean eclipse:eclipse -DdownloadSources=true

  • I also have the packages "bluez" "bluez-util" and "blueman" installed: using "sudo apt-get install".

  • There is a .txt file in the folder "bluecove-gpl-src/bluecove-gpl-2.1.0/" called "developer-read-me.txt" this has some useful information.

  • the 'build.xml' file expects you to have bluecove.jar in a folder position relative to it's own: '../bluecove/target/'

end extra steps

I'm not at my Pi right now, so I can't tell you precisely what I did with that file: I'm sure I included it in the classpath for my project: but I don't think it actually mattered.

If you have any trouble with the steps above: let me know and I'll do my best to help and clarify!

krex
  • 345
  • 3
  • 8
  • 21
  • The 'bluecove-gpl.jar' and 'bluecove.jar' files both still need to be included in your classpath for your project. – krex Feb 24 '13 at 13:55
  • This also assumes you are using Debian based linux - Debian Squeeze, Rasbian.. etc On other Linux distro's you will have to find out how to install packages, the rest should be much the same! – krex Mar 09 '13 at 02:45
  • 1
    great answer. Quick note: The package name is actualy "bluez-utils" not "bluez-util". I would have corrected it in the post, but any edit has to be 6 character or longer. – Lukas Ruge Mar 15 '14 at 13:09
  • Well spotted! I now compile FOSS projects all the time and have a much better understanding. Come summer I think I'll update this page with a link to a tutorial/walk-through which I am still yet to construct. – krex Mar 19 '14 at 17:11
  • And thanks also. I was in the middle of my honours project and full of panic! – krex Mar 19 '14 at 17:14
  • 1
    @JohnDoe, what do you do with libbluecove-arm.so once its built? – br3nt May 25 '14 at 09:35
  • @br3nt that is a good question.. It's been a while since I posted this and I am struggling to remember. I will get back to you once I've done a little digging. (Also, sorry for the late response, I've been on a little break). – krex Jul 08 '14 at 15:26
  • @br3nt I was wrong in stating that a ".so" file was the product of compiling the bluetooth library. In fact, the result is a ".jar" file that is then included in the classpath of your Java project. Apologies for the confusion. This ".jar" file contains the relevant "libbluecove-arm.so" file. – krex Jul 08 '14 at 15:52
  • @JohnDoe, Ah! Awesome :). I did get it working in the end by adding the .so to the classpath. I'll try doing the whole thing again and see if I get a nicer outcome. – br3nt Jul 09 '14 at 00:06
  • @br3nt If my answer was useful/helpful to you, could you please up-vote it! =] – krex Jul 11 '14 at 10:07
1

Solution: Here is a quick guide to compile the library "BlueCove" for Raspberry. https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=89031

If you want something easier, just use the repository

<dependencies>
            <dependency>
                <groupId>br.com.criativasoft.opendevice.ext</groupId>
                <artifactId>bluecove-gpl-arm</artifactId>
                <version>2.1.1-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>br.com.criativasoft.opendevice.ext</groupId>
                <artifactId>bluecove-gpl</artifactId>
                <version>2.1.1-SNAPSHOT</version>
            </dependency>
        </dependencies>

And repository:

<repositories>
        <repository>
            <id>oss.sonatype.org</id>
            <url>http://oss.sonatype.org/content/repositories/releases</url>
        </repository>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>
  • Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bhargav Rao Jan 06 '16 at 15:51