Long time ago I bought a Nike Sportwatch (sportband) and as I use Debian GNU/Linux at home I wanted to manage my device with Linux. I searched for a Linux driver and I found comsport driver so I decided to give it a chance. You could download the driver from here.
$ tar xvzf allcomsport-0.1.tar.gz
Information needed by the driver
Reading the installation file, INSTALL_DRIVER_AND_GUI, I realized that I had to check the Device ID to verify if all data match with the instructions so I plugged my Sportwatch and execute the following command:
$ lsusb ... Bus 001 Device 010: ID 11ac:5455 Nike ...
- Bus 001: This is bus number where Nike SportWatch USB is attached.
- Device 010: This is the tenth device attached to bus 001, there are other devices attached to the same bus.
- 11ac:5455 is the ID given to this Nike SportWatch. The sequence before “:” indicates the manufacture ID and number after “:” indicates device ID.
The first thing that I noticed was that the Manufacturer ID obviously matched with the instructions (11ac == Nike) but the Device ID it wasn’t the same as my own device.
So I check my user groups and change the udev rule according my data:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="11ac", ATTRS{idProduct}=="5455", SYMLINK+="sport", GROUP="aitor", MODE="0666"
- SUBSYSTEMS==”usb” -> the kernel subsystem which generated the request
- ATTRS{idProduct}==”5455″ -> My Device ID
- GROUP=”aitor” -> your user group
- SYMLINK+=”sport” -> a symlink /dev/sport will be created pointing to the device
# cp 90-sportband.rules /etc/udev/rules.d/
Reload udev rules:
# udevadm control --reload-rules
Building the driver
Let’s install all dependencies, please take into account that section depends on your current system so you could need to install additional packages:
# aptitude install intltool libusb-dev # dpkg -l |grep intltool ii intltool 0.50.2-3 all Utility scripts for internationalizing XML ii intltool-debian
It’s time to compile the driver and I found some errors:
$ tar xvzf comsport-0.1.tar.gz $ mkdir /opt/nike $ cd comsport/comsport-0.1 $ configure --prefix=/opt/nike ... checking for libusb... configure: error: Package requirements (libusb-1.0) were not met: No package 'libusb-1.0' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables libusb_CFLAGS and libusb_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. # dpkg -l|grep libusb ii libgusb2:amd64 0.2.8-1 amd64 GLib wrapper around libusb1 ii libusb-0.1-4:amd64 2:0.1.12-28 amd64 userspace USB programming library ii libusb-1.0-0:amd64 2:1.0.20-1 amd64 userspace USB programming library ii libusb-1.0-0:i386 2:1.0.20-1 i386 userspace USB programming library ...
So let’s find the libusb library:
$ find /lib -iname "*libusb*" /lib/x86_64-linux-gnu/libusb-0.1.so.4 /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4 /lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0 /lib/x86_64-linux-gnu/libusb-1.0.so.0 /lib/i386-linux-gnu/libusb-1.0.so.0.1.0 /lib/i386-linux-gnu/libusb-1.0.so.0
After some tries I found the right settings:
$ libusb_LIBS="-L/lib/x86_64-linux-gnu -lusb" libusb_CFLAGS="-I/lib/x86_64-linux-gnu" ./configure --prefix=/opt/nike $ make make all-recursive make[1]: Entering directory '/home/aitor/soft/comsport/comsport-0.1' Making all in src make[2]: Entering directory '/home/aitor/soft/comsport/comsport-0.1/src' /bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -o comsport main.o DeviceCom.o BufferControl.o Controller.o Profile.o ConvertControl.o -lusb -L/lib/x86_64-linux-gnui -lusb libtool: link: g++ -g -O2 -o comsport main.o DeviceCom.o BufferControl.o Controller.o Profile.o ConvertControl.o -L/lib/x86_64-linux-gnui -lusb make[2]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1/src' Making all in po make[2]: Entering directory '/home/aitor/soft/comsport/comsport-0.1/po' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1/po' make[2]: Entering directory '/home/aitor/soft/comsport/comsport-0.1' make[2]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1' make[1]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1' $ make install Making install in src make[1]: Entering directory '/home/aitor/soft/comsport/comsport-0.1/src' make[2]: Entering directory '/home/aitor/soft/comsport/comsport-0.1/src' test -z "/opt/nike/bin" || /bin/mkdir -p "/opt/nike/bin" /bin/bash ../libtool --mode=install /usr/bin/install -c comsport '/opt/nike/bin' libtool: install: /usr/bin/install -c comsport /opt/nike/bin/comsport make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1/src' make[1]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1/src' Making install in po make[1]: Entering directory '/home/aitor/soft/comsport/comsport-0.1/po' linguas=""; \ for lang in $linguas; do \ dir=/opt/nike/share/locale/$lang/LC_MESSAGES; \ /bin/bash /home/aitor/soft/comsport/comsport-0.1/install-sh -d $dir; \ if test -r $lang.gmo; then \ /usr/bin/install -c -m 644 $lang.gmo $dir/comsport.mo; \ echo "installing $lang.gmo as $dir/comsport.mo"; \ else \ /usr/bin/install -c -m 644 ./$lang.gmo $dir/comsport.mo; \ echo "installing ./$lang.gmo as" \ "$dir/comsport.mo"; \ fi; \ if test -r $lang.gmo.m; then \ /usr/bin/install -c -m 644 $lang.gmo.m $dir/comsport.mo.m; \ echo "installing $lang.gmo.m as $dir/comsport.mo.m"; \ else \ if test -r ./$lang.gmo.m ; then \ /usr/bin/install -c -m 644 ./$lang.gmo.m \ $dir/comsport.mo.m; \ echo "installing ./$lang.gmo.m as" \ "$dir/comsport.mo.m"; \ else \ true; \ fi; \ fi; \ done make[1]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1/po' make[1]: Entering directory '/home/aitor/soft/comsport/comsport-0.1' make[2]: Entering directory '/home/aitor/soft/comsport/comsport-0.1' make[2]: Nothing to be done for 'install-exec-am'. test -z "/opt/nike/doc/comsport" || /bin/mkdir -p "/opt/nike/doc/comsport" /usr/bin/install -c -m 644 README COPYING AUTHORS ChangeLog INSTALL NEWS '/opt/nike/doc/comsport' make[2]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1' make[1]: Leaving directory '/home/aitor/soft/comsport/comsport-0.1'
Testing our new installed driver
Now the driver is built and installed it’s time to test:
/opt/nike/bin/comsport -h Comsport v0.1, driver for sportband+ no sportband found.
In the first try the device wasn’t found, reviewing driver source code I found that ID Device is hardcoded in DeviceCom.cxx file, so I change the following line to match with my Device ID and recompile the source code:
$ vim DeviceCom.cxx if (dev->descriptor.idVendor == 0x11ac && dev->descriptor.idProduct == 0x5455) {
After that I recompiled source files and executed again the driver binary but unfortunatelly a Segmentation fault is generated. Taking a look to syslog some command failed:
... [19429.453915] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd comsport rqt 161 rq 1 len 8 ret -110 [19430.453924] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd comsport rqt 161 rq 1 len 64 ret -110 [19431.453925] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd comsport rqt 161 rq 1 len 64 ret -110 [19432.453938] usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd comsport rqt 161 rq 1 len 16 ret -110 [19432.454022] traps: comsport[24765] general protection ip:406b57 sp:7ffc1a9f8c68 error:0 in comsport[400000+c000] ...
What I learned
At the end driver needs to be modified to work properly with my Sportwatch, so I need to dig deeper if I want to manage this device natively on Debian. A simpler option would be run a virtualized Microsoft Windows and install the Nike drivers.
—
“If things go wrong, don’t go with them”
–Roger Babson
Hey man! How you doing?
I got the same problem! Do you have news abou it? Did you solve the code problem?
Hi Vinicius I’m working on it in my spare time, I let you know if I get a fix for this code.
Hi neklaf,
I just discovered Nike killed the support for the Nike+ SportWatch GPS and I found your repository on Github.
Is there any chance I can use your code to extract the GPS data from the watch?
Thanks!
Hi Gianni,
In the Github repository there is a PDF https://github.com/neklaf/nikePlus-SportWatchGPS/blob/master/doc/smartwatches-hristo-leendert.pdf in which you can find Python source code related to GPS data, perhaps can help you with this task, you can find in this directory https://github.com/neklaf/nikePlus-SportWatchGPS/tree/master/src/python some of scripts mentioned in PDF.
I hope this can help you.
Let me know if you achieve extract GPS information.
Regards
Hi Gianni,
same idea, found this blog post searching on github 🙂
Is your goal to sync the runs with a third party service like RunKeeper/RunTastic?