Skip to content

xsens/xsens_dot_server

Repository files navigation

NOTE

The new Xsens DOT PC SDK to develop PC-based applications is now ready! It is possible to download it from our Xsens DOT developer page (https://www.xsens.com/developer). The Xsens DOT Server, an example code for the BLE service specification, is then archived.

Overview

Xsens DOT Server is a simple web server that can scan, connect and start measurement with Xsens DOT on Windows, macOS and Raspberry Pi. The system is built using Node.js in combination with Noble.

Functions

  • Scan sensor
  • Connect sensor
  • Synchronization
  • Real-time streaming - While you can get all measurement modes (exclude high fidelity modes), 6 modes are currently supported in Xsens DOT Server:
    • Complete (Euler)
    • Extended (Quaternion)
    • Rate quantities (with mag)
    • Custom mode 1
    • Custom mode 2
    • Custom mode 3
  • Data logging
  • Heading reset

Get more information about Xsens DOT in Develepor Page and Base.

Important Notices

  • Disconnect all Bluetooth peripherals (mouse, keyboard) before start Xsens DOT Server to ensure stable Bluetooth connections.
  • Firmware support:
    • v1.6.0

Documentation

  • System Architecture: system architecture of Xsens DOT Server.
  • Sensor Server: application and workflow control.
  • BLE Handler: creates an abstraction from the BLE protocol.
  • Web GUI Handler: the web server
  • Noble: Node package that implements an interface with the BLE radio (i.e. driver).
  • Web Client: a web browser that can run on any computer on the local network and that renders an HTML page that implements the GUI.

Set up the environment

Set up on Windows

Prerequisites

  • Windows 10, Windows 7
  • Bluetooth 4.2 USB adapter or above (backward compatible with BT4.0 with performance loss)
  • Recommend to use Chrome or Firefox

Install the following tools

  • Install Python 3.8.3 from the Micfrosoft Store package

  • Install Node.js-v12.16.2-x64

    • Keep clicking Next to complete the installation.
    • Enter npm -v in command prompt to check if the installation is successful.
       
  • Install node-gyp

    npm install -g node-gyp
  • Install all the required tools and configurations using Microsoft's windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator)

    npm install --global --production windows-build-tools
  • Install Zadig to setup WinUSB driver:

    • Find Bluetooth adapter inforamtion in Device Manager
       

    • Open Zadig, goto Options, enable "List All Devices"

    • Find your Bluetooth adapter, change the driver to WinUSB. Then click Replace Driver
       

    • Note: please retry several times if the intallation fails. Or restart the computer and try again.

Set up on macOS

Install following tools

  • Install Xcode
  • Install node.js 8.9.4
    • You can install n package to easily manage Node.js versions.

Note: For some operating systems (e.g. macOS), the address is not available unless a connection has been established first. If this is the case, the address of the peripheral is set to a counter. This address will be used until the server is restarted and the sensor is discovered again.

Set up on Raspberry Pi

Prerequisites

  • Raspberry Pi 4 Model B 4GB RAM / Raspberry Pi 3 Model B+, 1 GB RAM
  • Install Raspberry Pi OS

Installation steps

  • Install dependcies

    sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
    sudo apt-get install build-essential checkinstall libssl-dev
  • Download Node.js 8.x:

    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
  • Install npm:

    sudo apt-get install npm
  • Install Node.js 8.x:

    sudo npm install -g n
    sudo n 8.11.1
    node -v

Run Xsens DOT Server

  1. Clone repository
    git clone https://github.com/xsens/xsens_dot_server.git
  2. Enter Xsens DOT Server project cd ./xsens_dot_server and install the dependency package npm install
  3. Run Xsens DOT Server
    • Windows and macOS: node xsensDotServer
    • Raspberry Pi: sudo node xsensDotServer
  4. Open Xsens DOT server in browser

Known issues

  1. [Connection] Unable to connect sensors in Mac with Bluetooth 5.0.
  2. [Connection] Connection with firmware 1.3.0 sensors may fail in Windows. You can:
    • use firmware 1.0.0
    • or use a Bluetooth dongle which support 4.0 or above. Refer to Add Bluetooth adapter to configure your Bluetooth dongle.

Troubleshooting

Add Bluetooth adapter

If you encounter Error: No compatible USB Bluetooth 4.0 device found! when try to run Xsens DOT Sever on Windows, it means you need to add your Bluetooth adapter to the USB device list:

  1. Open Device Manager, find the VID and PID of your Bluetooth adapter.
     
  2. Open source code: xsens_dot_server\node_modules\bluetooth-hci-socket\lib\usb.js
  3. Add Bluetooth VID & PID in usb.js (line 66), save and close.
     
  4. Run Xsens DOT Server again.

Reinstall Bluetooth adapter

After replacing the Bluetooth adapter with WinUSB driver, you cannot connect to Bluetooth devices with your PC. Here is the way to reinstall the Bluetooth adapter:

  1. Go to Device Manager -> Universal Serial Bus devices
  2. Find your converted WinUSB driver and uninstall
  3. In Device Manager, go to Action (top menu), then Scan for hardware changes and let it reinstall
  4. You should able to find your Bluetooth adapter back in Bluetooth.

Bug reports and feedback

All feedback is welcome and helps us to improve!

Please report all bugs by rasing an issue.

You can also raise app development questions and feature requests of Xsens DOT in our Community Forum.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •