Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT Linux SDK Beta Release

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

We are pleased to announce that official Linux ANT support is now available for testing in the ANT Linux SDK beta package now available in the thisisant.com downloads section: https://www.thisisant.com/resources/ant-sdk-linux-beta-beta-release-for-customer-testing-and-feedback/

Please recognize that because this library is new and there are so many varieties of Linux that we haven't tested against we are releasing it as a beta release and request your feedback on anything that isn't working. Also note, the included libraries support using libusb based devices including the USB2 and USBm, but not SI based devices like the module dev boards.

We hope providing our official API on Linux helps you with your ANT projects!

Leave any feedback and questions in this thread. Thanks!      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

Finally!!!

Thank you very much. At least I can use this one on Raspberry Pi device (I can, right?) while waiting for W10 core IoT version. This was a really great news.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

It should work, but hasn't been tested by us yet. Let us know how it goes!      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

ShaneG - 16 May 2016 09:47 AM
It should work, but hasn't been tested by us yet. Let us know how it goes!


I manage to complete make command but I think something wrong.

This is a output when I try the demo.

pi@raspberrypi:~/Downloads/ANT-SDK_Linux_3.8.200/DEMO_LIB $ ./demo
USB Device number
?
1
Segmentation fault 


You can see my make log here. I command it with ¨make >>log.txt" but not everything goes into log.txt. Some output still show on Terminal. (link will expire in 30 days)

http://pastebin.com/CFkatTM1 from log.txt
http://pastebin.com/KVnYFbS0 from Terminal (not complete log. It have more than this but terminal only can show this)      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

@hisoft, I am guessing it is failing because it can't find the USB stick. Try using '0' instead of '1', the USB enumeration starts at 0.

It is also possible something else is using the stick or you don't have the drivers installed properly.

Sorry you just get a hard seg fault instead of a useful error, looks like the demo is set up with asserts to flag when the connection doesn't work, but will just try to dereference the null pointer on production.      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

ShaneG - 18 May 2016 04:18 PM
@hisoft, I am guessing it is failing because it can't find the USB stick. Try using '0' instead of '1', the USB enumeration starts at 0.

It is also possible something else is using the stick or you don't have the drivers installed properly.

Sorry you just get a hard seg fault instead of a useful error, looks like the demo is set up with asserts to flag when the connection doesn't work, but will just try to dereference the null pointer on production.


I try from 0 to 2 yesterday. It didn't work.

What did you mean about "driver installed properly"? I didn't used to Linux and never install any drivers on it.

The warning in "make" is normal?      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

I re-install RPi OS and start everything from scratch. just make and install missing library until it complete. But the result were still the same.      
RankRank

Total Posts: 43

Joined 2013-06-11

PM

Look like I have to install ANT stick driver first. Am I right? So, Where can I get ANT driver for Linux? I make ANT_LIB but have no idea what I have to do.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

You likely need to run with elevated privileges to access the libusb stack in your OS then, try running the demo using sudo.      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

ShaneG - 24 May 2016 10:08 AM
You likely need to run with elevated privileges to access the libusb stack in your OS then, try running the demo using sudo.


Try it but no luck. Still saying the same error.

Today I try install Ubuntu on RPi2 but still can't make ANT_LIB. Will try to make it work this Thursday.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Going back to what I said about drivers, I just noticed the package we released is missing the dependencies list. Please make sure the following are installed on your system, according to your OS:

Debian:
-gcc/g++
-make
-libpthread-stubs0-dev
-pkg-config
-libglib2.0-dev
-libgirepository1.0-dev
-gperf
-libudev-dev

RedHat:
-gcc/g++
-make
-libxcb-devel
-pkgconfig
-gobject-introspection-devel
-gperf
-libudev-devel

Mac OSX:
-xcode tools
-clang
-make      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

ShaneG - 24 May 2016 01:35 PM
Going back to what I said about drivers, I just noticed the package we released is missing the dependencies list. Please make sure the following are installed on your system, according to your OS:

Debian:
-gcc/g++
-make
-libpthread-stubs0-dev
-pkg-config
-libglib2.0-dev
-libgirepository1.0-dev
-gperf
-libudev-dev

RedHat:
-gcc/g++
-make
-libxcb-devel
-pkgconfig
-gobject-introspection-devel
-gperf
-libudev-devel

Mac OSX:
-xcode tools
-clang
-make


I try re-install Raspbian and install those package. (When I try before I have missing libpthread-stubs0-dev )

But it still not work. I got the same as before. Here was the output.

pi@raspberrypi:~/Downloads/ANT-SDK_Linux_3.8.200/DEMO_LIB $ ./demo 
USB Device number
?
0
Segmentation fault
pi
@raspberrypi:~/Downloads/ANT-SDK_Linux_3.8.200/DEMO_LIB sudo ./demo 
USB Device number
?
0
pi
@raspberrypi:~/Downloads/ANT-SDK_Linux_3.8.200/DEMO_LIB 
     
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

I am not sure I understand what happened on the second one, is it a copy paste error or was there no error printed?      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

There was no error printed when run it with sudo. Not only when enter USB Device number 0 but there also no error printed when enter 1, 2, 3 or the other.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Here are some instructions for how we got it working on a Raspberry Pi 2 running Raspbian, we will include them in the next release:

Step 1: Packages and commands to install for ANT_LIB

sudo apt-get install libglib2.0-dev
sudo apt
-get install libgirepository1.0-dev
sudo apt
-get install libudev-dev
sudo apt
-get install libusb-dev
sudo apt
-get install libusb-1.0.0
sudo apt
-get install libusb-1.0-0-dev
export LIBUSB_LIBDIR
=/usr/lib/arm-linux-gnueabihf
export LIBUSB_INCDIR
=/usr/include/libusb-1.0 



NOTE: After installing the packages, if we run 'pkg-config --libs libusb


', it should print '-lusb' to provide the linker argument to link to the libusb library for the compiler. You should try to use this first for the LINKER_ARGUMENTS (step 2) provided below, if this fails with the compiler complaining about undefined reference to the libusb functions then use '-lusb-1.0' as provided in the example below.


Step 2: Modify DEMO_LIB\makefile


From:
ifeq ($(BUILD_OS), linux)
LINKER_ARGUMENTS = -pthread -L$(ANTLIB_PATH)/gccDebug -Wl,--start-group -lANT_LIB -Wl,--end-group -Wl,-rpath,./ -lrt
To:
ifeq ($(BUILD_OS), linux)
LINKER_ARGUMENTS = -pthread -L$(ANTLIB_PATH)/gccDebug -Wl,--start-group -lANT_LIB -Wl,--end-group -Wl,-rpath,./ -lrt -lusb-1.0

Step 3: Removing unused library from makefile
Since we are installing the libusb libraries in the OS, there is no need to extract and recompile the libudev and libusb tar balls that came with the package again.
In ANT_LIB/makefile, navigate to the lines below and comment them out of the make process:

# Linux libusb
ifeq ($(BUILD_OS), linux)
echo "Unpacking and building libudev & libusb-1.0..."
tar xvjf libraries/libudev/udev_*.* && cd udev* && ./configure && make && cp libudev/.libs/libudev*.o ../gccDebug/libraries && cp libudev/.libs/libudev*.o ../gccRelease/libraries && cd .. && rm -R udev*
tar xvjf libraries/libusb-1.0/libusb-1.0.* && cd libusb-1.0.* && ./configure && make && cp libusb/libusb*.o ../gccDebug/libraries && cp libusb/os/libusb*.o ../gccDebug/libraries && cp libusb/os/libusb*.o ../gccRelease/libraries && mv libusb/libusb*.o ../gccRelease/libraries && cd .. && rm -R libusb-1.0.*

# OSX libusb
else ifeq ($(BUILD_OS), osx)
ifeq ($(FRAMEWORK_TYPE), libusb)
echo "Unpacking and building libusb-1.0..."
tar -zxvf libraries/libusb-1.0/libusb-1.0.* && cd libusb-1.0.* && ./configure && make && cp libusb/libusb*.o ../gccDebug/libraries && cp libusb/os/libusb*.o ../gccDebug/libraries && cp libusb/os/libusb*.o ../gccRelease/libraries && mv libusb/libusb*.o ../gccRelease/libraries && cd .. && rm -R libusb-1.0.*
endif
endif

Step 4: Build the Demo
In DEMO_LIB, type 'make' to start the build process.      

Signature

Dynastream Developer

RankRank

Total Posts: 43

Joined 2013-06-11

PM

still not work.

I not sure did this normal? It showing up every time I build. I re-install Raspbian a lot. Today I re-install Raspbian too. But this still show up. They are very long as you see the scroll bar. (1st image was the start of make. 2nd image was at the end of make)

The run error was show at the end of 2nd image.

http://imgur.com/a/r3glN