bglib icon indicating copy to clipboard operation
bglib copied to clipboard

bglib on linux - not finding com ports

Open helen-fornazier opened this issue 10 years ago • 2 comments

Hello,

I opened the project on eclipse on linux and I am trying to run the CheckBGAPIVersion sample and it seems that it doesn't find any com port, the function getAvailableSerialPorts() is returning an empty list.

Could you help me please?

This is the output of the java execution:

Connecting BLED112 Dongle... Load RxTx for os.name=Linux os.arch=amd64 sun.arch.data.model=64 Current path = /home/helen/workspace/bglib/bglib-samples/. Copiying nativelib/Linux/x86_64-unknown-linux-gnu/librxtxSerial.so WARNING: RXTX Version mismatch Jar version = RXTX-2.2 native lib Version = RXTX-2.2pre2 java.lang.ArrayIndexOutOfBoundsException: 0 at org.thingml.bglib.samples.BLED112.selectSerialPort(BLED112.java:106) at org.thingml.bglib.samples.BLED112.connectSerial(BLED112.java:123) at org.thingml.bglib.samples.BLED112.connectBLED112(BLED112.java:111) at org.thingml.bglib.samples.CheckBGAPIVersion.main(CheckBGAPIVersion.java:32) Exception in thread "main" java.lang.NullPointerException at org.thingml.bglib.samples.BLED112.connectBLED112(BLED112.java:113) at org.thingml.bglib.samples.CheckBGAPIVersion.main(CheckBGAPIVersion.java:32)

helen-fornazier avatar Oct 02 '15 20:10 helen-fornazier

You have to ensure, that the correct native library is used when running from eclipse. There seem to be in general some issues to keep native lib in sync with the corresponding jar: https://www.google.de/search?q=WARNING:+RXTX+Version+mismatch&ie=utf-8&oe=utf-8&gws_rd=cr&ei=4Z8gVsftF4SMav_rgsgF#q=rxtx+version+mismatch+linux. I used this branch of RXTX on Windows 7/64Bit: http://fizzed.com/oss/rxtx-for-java, they provide also a binary build for LINUX x86_64.

zimpel78 avatar Oct 16 '15 07:10 zimpel78

Maybr swithcing to jSSC could help. It should manage that kind of issue transparently and is fairly easily to integrate as a replacement of RxTx (almost same API).

brice-morin avatar Oct 16 '15 09:10 brice-morin