1. RTLS-TWR Overview
    1. RTLS Components
    2. RTLS TWR Features
    3. RTLS Architecture
  2. RTLS TWR Starting Guide
    1. Installation with Raspberry Pi2
      1. System Requirements
      2. RTLS TWR Default Settings
      3. Connecting RTLS Components
    2. Installation based on VMware
      1. System Requirements
      2. Default Settings Summary
      3. Connecting Master Anchor
      4. Network Configuration
      5. Download Image
      6. Load Image
      7. Set VMware machine settings
      8. BIOS settings
      9. Verify the connection
    3. RTLS Components Deployment
    4. Settings via SensMap Visualization
      1. Check Connection
      2. Building settings
      3. Create a new building
      4. Setting up
      5. Building name
      6. Insert floor plane
      7. Set scale for floor plan
      8. Set zero point
      9. Save settings
      10. Select building
      11. Move the anchors
      12. Tags
      13. Wizard is done
      14. Turn on Tags
    5. Sensmap Visualization Useful Tips
      1. Anchor Placing
      2. Nodes Tracking and Statistics
      3. Tags Actual Data (Tooltip)
      4. Add new Tag/Anchor
    6. RTLS Useful Tips
      1. RTLS Shutdown
      2. Status/Restarting RTLS
      3. Distance and RSSI measurement
      4. Cloning RPI2 image to SD card
  3. Deployment Consideration
    1. 2D location
    2. 3D location
  4. RTLS Server
    1. Start / Stop / Restart RTLS Server
      1. Restart via web interface
      2. Restart via service
      3. Stop/Start manually, with console output
    2. Configuration
      1. Configuration for Sensmap Server Connection
      2. Configuration section for native part
    3. Troubleshooting
  5. RTLS Configuration
    1. Communication modes
    2. Configuration via Terminal
    3. Default Settings
    4. Configurable Options
    5. Serial Terminal Settings
    6. Anchor
      1. Status Codes
      2. Master Anchor Output
      3. Anchor Configuration via Serial Terminal
        1. COM Port Number
        2. Run the Application
        3. Reset
        4. Power Settings Level
        5. Select Channel
        6. Select Mode
        7. Select Address
        8. Confirm or Reject
      4. Master Anchor Configuration via Serial Terminal
        1. COM Port Number
        2. Reset
        3. Run the Application
        4. Further or Extended Configuration
        5. Power Settings Level
        6. Select Channel
        7. Select Mode
        8. Select Number of Tags
        9. Select Number of Anchors
        10. Select Refresh Interval
        11. Destination Address
        12. Confirm or Reject
    7. Tag
      1. Tag Functional Scheme
      2. Power Switch
      3. Charging the Tag
      4. Serial Terminal Settings
      5. Tag Configuration via Serial Terminal
        1. Identify COM port number
        2. Download the PuTTY
        3. Open the COM Port
        4. Firmware Update
        5. Power Settings Level
        6. Select Channel
        7. Select Mode
        8. Select Number of Tags
        9. Select Address
        10. Select Number of Anchors
        11. Motion Control
        12. Refresh Rate Interval
        13. Confirm Settings
  6. Migrating RTLS software
    1. System Requirements
    2. Apache, PHP, MySQL installation
      1. Install Apache
      2. Install MySQL
      3. Install php5
      4. Install CURL
      5. Install phpmyadmin
      6. Edit apache.conf
      7. Rewrite
      8. Create Database
      9. Import Database
      10. Install Glib
      11. Download libwebsocket library
      12. Install libmeschach
      13. Copy RTLS Server
      14. Copy Sensmap Server
      15. Copy Sensmap Visualization
      16. Change Permission
      17. Copy Service Scripts
      18. Edit
      19. Reboot and Check
    3. FAQ
      1. Changing DB password
      2. How to change Websocket port
      3. How to modify IP of RTLS server
  7. Changelog
  8. Terms & Conditions

1.RTLS-TWR Overview

RTLS TWR it is aimed for demonstration and evaluation of precise real-time location technology easy to deploy and integrate via open API. RTLS TWR platform is based on latest Decawave UWB radio chipset using Time of Flight and Two Way Ranging techniques. Mobile device so-called Tag estimate its distances at least to three static nodes so-called Anchors. The distances are processed in RTLS server where final position estimation is calculated. The position data are further available through API and is visualized via Sensmap Visualization application.

This TWR kit aims to demonstrate the Sewio UWB RTLS system with full feature positioning environment including REST and Web Sockets API, data storage and visualization and monitoring web application. Such components are required to build up a scalable location system. In order to simplify installation process, the RTLS TWR Kit is delivered with pre-configured software package either for VMware or Raspberry Pi2.

1.1.RTLS Components

Component Description
Tag Mobile device to be localized
Anchor Static infrastructure device with known position
RTLS Server Software for calculation final positions of Tags
Sensmap Server Software which provides API to RTLS data
Sensmap Api Open Application Protocol Interface defined for Web Sockets and REST HTTP interface
Sensmap Visualization Web based application for real-time RTLS visualization


1.2.RTLS TWR Features

Easy Deployment (No Cables)
Sub-meter accuracy
Open API
All-in-one Software
Source Code
Extensive Documentation
Raspberry PI Supported
Maximum number of Tags 100*
Maximum number of Anchors 10*
Update interval 50 ms – 8 s **

* for higher number of devices please sent query to info@sewio.net
** configurable

1.3.RTLS Architecture

RTLS system has following communication flow:

  1. Tag assign to its dedicated timeslot and in regular interval polls defined number of anchors in its physical range.
  2. Each anchor calculates a distance to particular Tag and sent it wirelessly to Master Anchor.
  3. Master Anchor sent distances to RTLS Server.
  4. RTLS Server calculates a final distance (it may apply some degree of filtration) and send final position via REST API to Sensmap Server.
  5. Sensmap Server provides API to gather all position data within the RTLS System.
  6. User can use Sensmap Visualization to show its Tags in real-time.


RTLS TWR use Time Division Multiple Access (TDMA) channel scheme:

The time is divided to time-slots which are dedicated for tags communication with anchors. Tag after power up listens for the sync message which is sent periodically from the master anchor and then it chooses its dedicated time-slot and performs distance measurement with available anchors. Tag’s time-slot is fixed and determined from its network address. This can be change via configuration. Each distance measurement result is calculated on Anchor and sent wirelessly to master anchor which forward it to RTLS Server where exact position is calculated. For the rest time of refresh rate the Tag goes to sleep to preserve battery. The duration of the refresh rate is determined by number of Tags, number of Anchors to be polled and communication mode.


2.RTLS TWR Starting Guide

This is a starting point for a quick setup of RTLS TWR. There are two ways of running RTLS software first with Raspberry Pi and second via VMware on a host computer. Starting with Raspberry Pi is easier and recommended for beginners.

2.1.Installation with Raspberry Pi2

Please read following chapter carefully, then you may skip the next section “Installation based on VMware” and read further.

2.1.1.System Requirements

  • Raspberry Pi 2 (hereinafter RPI) and WiFi USB adapter Ralink RT5370 802.11n
  • Dedicated power supply adapter for RPI
  • SD Card 4GB with preloaded RTLS Software
  • Computer with WiFi connectivity
  • Google Chrome browser
  • Bonjour service (optional)
Raspberry PI should not be powered from computer’s USB since RPI plus WIFI dongle need to have at least 1.5A power source available. Please use appropriate USB power adapter or battery power pack instead.

2.1.2.RTLS TWR Default Settings

RPI Wireless network ssid/pasword RTLS-AP/pisensmap
RPI Wi-Fi IP address
RPI Ubuntu, FTP, SSH login/pass sensmap/sensmap
Tag address 0x1001, 0x1002, 0x1003, 0x1004, 0x1005
Anchor address 0x0001, 0x0002, 0x0003, 0x0004, 0x0005

2.1.3.Connecting RTLS Components

1. Firstly, please hook up WiFi adapter to Raspberry Pi (here an after RPI). Then hook up Master Anchor 0x0001 and RPI to power supply (USB adapter) and connect them together with Ethernet cable. Please do not use USB power supply cables longer than 1.8m.


Only Master Anchor with address 0x0001 is connected to the RPI.

2. Both green LED in the center and Ethernet LEDs should light on Master Anchor. Check also Ethernet LED on RPI. If they are not active please check the power supply.

3. Wait for Raspberry Pi to fully boot 60 s.

4. Connect host computer to “RTLS-AP” WiFi network (password “pisensmap”).

If you do not see the WiFi network RTLS-AP or can’t connect to server, please check the power supply and try power on/off again. Otherwise try to re-flash SD card in Raspberry Pi as described here.

5. Now verify the connection from computer to Raspberry Pi using ping command. In Windows click on Start and write cmd command in Run field. Write ping

You may try to use name rtls.local instead of IP addresss. Local name should work natively on iOS and linux operating systems, if it’s not reachable on Windows, you may need to install Bonjour service from appl.RTLS_raspberry_ping

2.2.Installation based on VMware

This section is dedicated to VMware RTLS image installation, please skip this section if you use Raspberry PI.

2.2.1.System Requirements

  • Windows 7 or higher, Google chrome web browser
  • 64 bit operation system
  • VMware Player or VMware Workstation
  • Processor Intel Core i3 or higher (support virtualization VT-x feature)
  • SSD Disc Recommended
  • At least 4GB RAM memory

VMware host computer should be dedicated solely for RTLS System. Any other applications may decrease performance of VMware machine and may slow down its performance.

Mac OS X and Linux OS users are recommended to go through the Sewio_Mac_Linux_Guide.pdf document

2.2.2.Default Settings Summary

Host Ethernet Interface Static IP
VMware image Static IP
VMware Linux, FTP, SSH login/pass sensmap/sensmap
Tag address 0x1001, 0x1002, 0x1003, 0x1004, 0x1005
Anchor address 0x0001, 0x0002, 0x0003, 0x0004, 0x0005

2.2.3.Connecting Master Anchor

Hook up Master Anchor to power supply (computer USB / USB adapter) and connect it with the computer via Ethernet cable. Both green LED in the center and Ethernet LED should be active.

Only Master Anchor with address 0x0001 is being connected to the VMware host computer.


2.2.4.Network Configuration

Default static network address allocation for VMware RTLS image is illustrated in picture below:


Set permanent IPv4 address and mask on host computer Ethernet interface where you have plugged the cable from Master Anchor. IP address of VMware interface and RTLS software inside of virtual machine is implicitly set to

Please do not touch VMware Network adapters Only IP address of on your host Ethernet interface are to be configured. Please check whether Ethernet interface is active after you hooked up the Master anchor.  Label “Unidentified network” in Network Connections Control Panel should appear. If there is “Network Cable Unplugged” notification please check the Ethernet sockets and power up supply for Master anchor.

vmware_network_connection              vmware_tcp_connection

2.2.5.Download Image

Download, unzip and copy folder “RTLSKit_vmware” image from shared URL link (provided by Sewio) to the host computer.

2.2.6.Load Image

Open the virtual machine from directory RTLSKit_vmware via “Clone of SensmapServer.vmx” file in Vmware Player or Vmware Workstation. Please, do not run it yet.

2.2.7.Set VMware machine settings

Please make following settings in VMware Player.

  • Vmware Menu -> Manage -> Virtual machine settings
  • Set Network Adapter to Bridged mode
  • vmware_machine_settings

  • Click on “Configure Adapters” and select only Ethernet card on your host computer, where the Master Anchor is hooked up. In our example Qualcomm adapter.
  • vmware_bridging_setting

  • Now play the virtual machine.

2.2.8.BIOS settings

If your system does not allow 64 bit operations, which is indicated by error window below, please restart computer, go to the BIOS settings and allow virtualization by enabling VT-x feature. Configuration of VT-x feature differs according the vendor of PC or laptop. Once the VT-x feature is activated, please try to run the virtual image again.


2.2.9.Verify the connection

Now verify the connection from computer to virtual machine using ping command. In Windows click on Start and write cmd command in Run field.

Write ping The connection to the virtual machine should be successful.

Please notice that Master Anchor is not reachable via ping command.


2.3.RTLS Components Deployment

Deploy all the Anchors physically within your room and power them up, check the power LEDs. Tripods for a quick deployment are recommended.

Here are some tips for fast deployment and evaluation:

  • Anchors should be placed in the same height at least 2 meters above floor to reduce signal attenuation from human bodies
  • There should not be any object in diameter of 20 cm around the anchor. For example direct placement on the wall may decrease antenna performance significantly, use CCTV holder for wall separation instead.
  • Master Anchor (0x0001) must have radio connection with all other Anchors
  • The best position for the Anchors is a square composition with the Master Anchor in the center of the room.
  • The Anchors should be mounted in horizontal orientation and with the antenna point to the location area.
  • RTLS_anchor_orientation

  • If any Anchor has a Status 1 LED (right red) blinking every 6 second it means that it does not have radio link to Master Anchor. Therefore, the Anchor’s position needs to be adjusted (place closer to Master). Continue with moving of the Anchor until the RED LED stops blinking.
  • RTLS_anchor_status

RTLS_anchors_1    RTLS_anchors_2    RTLS_anchors_3

Please read further deployment details in chap. 3.

2.4.Settings via SensMap Visualization

Run the SensMap web monitoring application via web browser, Google Chrome is recommended.

For Raspberry PI: or via Bonjour sevice http://rtls.local/sensmap/

For VMware image:

Then follow the tutorial step by step.

The SensMap tutorial will remain active until you pass all the steps. You may drop it at any time by clicking on Cancel button or by pressing ESC key and run it again after  you refresh the page.

If you change the resolution or move Sensmap browser tab to another monitor, please refresh the page F5 for correct operation.

2.4.1.Check Connection

Firstly, you need to check connection to Sensmap Server. It is indicated via green border around Sensmap logo in the right top corner.


If you see green – OK indication please continue with the tutorial, otherwise try to check previous steps and restart services described here


2.4.2.Building settings

Go to building settings.


2.4.3.Create a new building

Create a new building by click on Building icon.


2.4.4.Setting up

Setting up your building, press Next.


2.4.5.Building name

Fill in your building name.


2.4.6.Insert floor plane

Insert your floor plane (name and image file). Prepare the map layout of your building in JPG or PNG format . If you want to draw your test room you may use  HomeStyler online tool. The plan must have precise proportion and should not be larger than 5 MB.


2.4.7.Set scale for floor plan

Relative distances and positions from RTLS need to be mapped to real coordinates of building’s floor plan. Set scale for your floor plan by setting distance between two points.


Set the points using left clicks on mouse. You should choose spots on plan  which can be easily measured with the tape or laser measurement tool for verification.


2.4.8.Set zero point

Now you may either set zero point for Cartesian axis system or skip it.


2.4.9.Save settings

Click on the save button in order to save your floor plan settings. Please be patient at this step, saving might take some time.


2.4.10.Select building

Select your building from dropdown list.


2.4.11.Move the anchors

Anchors are representing with green markers, move them to their intended positions with drag&drop feature.




Blue markers represent Tags. They are deployed in line on your floor plan automatically in this step.


2.4.13.Wizard is done

Now the wizard is done.


2.4.14.Turn on Tags

Now you can turn on Tags (switch in position close to USB) and check their movement, Tags are represented by blue markers. Their addresses started with prefix 0x1XXX. Boot time for Tag is around 3 seconds


Tag from firmware v1.126 have turned on smart movement detection. It starts the location only during movement in order to prolong battery lifetime. Otherwise, it goes to the sleep mode after few seconds of inactivity. This movement detection feature can be disabled within the Tag configuration.

Here is end of the tutorial

2.5.Sensmap Visualization Useful Tips

This section presents some helpfil features of the RTLS visualization tool.

2.5.1.Anchor Placing

In order to get precise positions from RTLS system, user should set position of Anchors with few centimeters accuracy.

  • Fast approach – assigning the coordinates to the anchor via drag & drop
  • Precise approach – assigning the exact coordinates may be done via RTLS – Nodes – Choose the Anchor and click Edit. Set coordinates by filling the Position fields and click on Confirm button.

There are two tools which might help with precise deployment of anchors:

  • Current Cursor Position – Shows actual coordinates of mouse cursor over the floor plan (top right corner).
  • Distance Marker – Measures an actual distance between user defined point and mouse cursor over the floor plan.

2.5.2.Nodes Tracking and Statistics

User can display trajectory and distance passed by any Tag by clicking on RTLS Tab -> menu Nodes Tracking Statistics and click on particular check box. Here you can also see the statistics of distances passed, average and maximal speed of Tags, see example below.


2.5.3.Tags Actual Data (Tooltip)

Actual data from Tag can be observed in tooltip. Tooltip appears when you click on Tag, you should see coordinates, battery level or data from inertial sensors.


2.5.4.Add new Tag/Anchor

Adding new Anchor or Tag to the system must be firstly properly configured on all nodes in order to extend prefixed TDMA radio scheme, see chap. 6 for more details.

Then new device must be added via Sensmap Visualization.
Go Tab RTLS -> Nodes -> New Node -> set Address, Building, Plan, Type and confirm button.

  • Tag address scope 0x1001 – 0x1064
  • Anchor address scope 0x0001 – 0x000A

Once you have added one or more nodes through visualization and adjusted RTLS kit TDMA scheme you need to restart rtlsserver, see chap. 4.

2.6.RTLS Useful Tips

2.6.1.RTLS Shutdown

For Raspberry Pi:

For VMware image:

You should not disconnect RPI from power supply before it goes to shut down.


2.6.2.Status/Restarting RTLS

Via Web interface:

For Raspberry Pi:

For VMware image:

The page show actual status of rtlsserver, sensmapsocketserver and mysql. Each service can be restarted by click on related button. There is also info about actual CPU/Memory performance and file system availability.


Via console (user/password:sensmap):

  • sudo service rtlsserver stop
  • sudo service sensmapsocketserver stop
  • sudo service sensmapsocketserver start

Note: Rtlsserver is started automatically as second service after the sensmapsocketserver.


2.6.3.Distance and RSSI measurement

In order to show distance and signal strength (RSSI) between the Anchors and Tags you need to run rtlsserver manually with output to console.
1. Stop RTLS server in terminal: sudo service rtlsserver stop.
2. Run RTLS server manually, not via service command.

  • cd /home/rtlsserver
  • sudo ./rtlsserver

3. Turn on a Tag by shifting the power button.

You should see distances from the Tag to Anchors in few seconds, signal strength data is composed by three samples with range , the higher value (less negative) the better.


4. RTLS Server can be stopped with CTRL+C at any time.

2.6.4.Cloning RPI2 image to SD card

In order to prepare valid SD card for RPI with RTLS software, please follow steps:

  1. Download rtls-ap-rpi.img image, provided by Sewio.
  2. Download Win32 Disk Imager from http://sourceforge.net/projects/win32diskimager/.
  3. Unzip and install Win32 Disk Imager.
  4. Connect SD card to PC and find out which letter it has been assigned.
  5. Open Win32 Disk Imager and choose rtls-ap-rpi.img as an image file.
  6. Choose SD card’s letter as a device and hit write.
  7. Wait until the process is done, then remove SD card from PC.
  8. Put SD card into Raspberry Pi and add power, system should boot now.


3.Deployment Consideration

Position of Master Anchor is crucial because of fact that Tags channel access is driven via synchronization through Master Anchor. In optimal scenario the best position for Master Anchor is center of area to be covered by RTLS system. All other anchors should be in the same physical range in order to get best performance. In the worst case master anchor must be in range of at least two other anchors. All anchors should have line of sight to master anchor.

Wireless communication range between devices is from 25 meters to 45 meters in line of sight condition and standard transmit power. RTLS TWR may cover with 1 Master Anchor and 4 Anchors up to 400 square meters .

Here are general rules for deployment of Anchors:

  • Wireless connection from Master Anchor to other anchors is crucial. Anchors should be deployed as much as possible in line of sight with Master Anchor. While other anchors does not need to have line of sight connection among each other.
  • Anchors deployment should ideally make a virtual square which lay out location area for Tags.
  • Anchors and Tags have the same radio range. For the best position accuracy Tag should be in radio range of as many anchors as possible. Limit condition is that for 2D positioning Tag must see at least three anchors, for 3D at least four anchors.
  • Accuracy and stability of position estimation is better for 2D calculation comparing to 3D. Therefore, use 2D calculation if possible.
  • Area between anchors and tags should contain as little metal parts as possible.
  • Range and accuracy might be affected by humans, metal parts or other obstacles.



rule3 rule4rule6rule5

3.1.2D location

  • Anchors should be deployed in the same height, otherwise accuracy can be decreased. Anchors should be placed above people in order to reduce signal attenuation. There should not be any object in radius 20 cm in front of anchor.
  • Deploying anchors in corners of rectangular space is acceptable. However, ratio between length and width of room should not be bigger than 4:1, otherwise use square placement instead. The bigger ratio between lengths the bigger estimation error for the longer one.
  • Anchors and Tags should not have very different height levels (more than 3 m), otherwise accuracy and stability of position estimation might be decreased. If anchors height level needs to be quite distant from Tags height level you need to use 3D location.

2D Anchors deployment examples:


3.2.3D location

  • Anchors must be deployed in different heights the more difference the better. For example top-bottom placement in diagonal. Do not place anchors below 30 cm over the floor. Placing anchors very close to ground may attenuate signal.
  • For 3D location, cubic anchors deployment should be chosen.


4.RTLS Server

The main task of RTLS Server software is to calculate positions of Tags and provide this data to Sensmap server where it is further disseminate via REST or WebSocket interface.

  1. Initially, RTLS Server load all available tags and anchors from Sensmap Server.
  2. Then RTLS Server starts receiving actual distances between Tags and Anchors from Master Anchor.
  3. RTLS Server calculates positions based on the data from Master Anchor.
  4. It may further apply some level of filtration if this feature is turned on.
  5. Finally, it exchanges data with Sensmap Server which provides it further to user via REST and Websocket interface.


4.1.Start / Stop / Restart RTLS Server

RTLS Server is linux based application. Default location in VMware image for RTLS kit is /home/rtlsserver directory.

4.1.1.Restart via web interface

VMware deployment:


Raspberry PI deployment:

  • rtls.local/status or

4.1.2.Restart via service

  1. sudo service rtlserver stop
  2. sudo service sensmapsocketserver stop
  3. sudo service sensmapsocketserver start

4.1.3.Stop/Start manually, with console output

  1. sudo service rtlserver stop
  2. cd /home/rtlsserver
  3. sudo ./rtlsserver      (password:sensmap)
  4. It can be stopped via CTCL+C at any time.



Configuration is loaded from config.ini file. Before you do any change RTLS server must be stopped.

4.2.1.Configuration for Sensmap Server Connection

Parameter Default Value Description
ACTIVE 1 Set whether data area are sent to Sensmap Server
IP IP address of Sensmap
PORT 80 Port of Sensmap REST interface
WEB_SOCKET_ACTIVE 1 1 – Positions to Sensmap Server are sent via Websocket (lightweight)
0 – Positions to Sensmap Server are sent via REST
WEB_SOCKET_PORT 8080 Websocket port which is used on Sensmap Server
API_KEY 17254faec6a60f58458308763 Implicit key for Sensmap Server
URL /sensmapserver/api/feeds/ URL path where Sensmap API is located
USER_NAME rtlsuser Username of Sensmap user
LOG_TO_FILE 0 Switch on/off logging to file rtlsserver.log

1 – Time stamped positions from RTLS are stored in database. This option is available only for REST connection type (WEBSOCKET_ACTIVE 0).

Please do not use database operations if you run server on the embedded system from SD card such as Raspberry PI. Frequent position saving might damage FLASH memory quite soon.

0 – Data from RTLS are not stored in DB.

4.2.2.Configuration section for native part

Parameter Default Value Values Description
UDP_PORT 5000 {0-65535} RTLS Server UDP port for communication with Master Anchor
FILTER 1 {0,1} 0 – no filter applied over the positions
1 – moving median filter with window size 3 is applied over the positions
0 – Kalman filter is OFF
1 – Kalman filter is ON
COORD_3D 0 {0,1} 0 – Set RTLS to 2D calculation [x,y]
1 – Set RTLS to 3D calculation [x,y,z]
TYPE_OF_Z_COMPENSATION 0 {0,1,2} This feature is for improving accuracy by compensation of Tag’s height (Z axis) only for specific deployments. Should be employed only for 2D calculation for scenarios where anchors are deployed at the same height but tags are in very distant height level.
Optimization algorithm will try to find best 2D coordinates [x,y] with lowest error.

0 – without compensation of different heights of anchors and tags
1 – Recalculate distances from tag to anchors based on height of anchors (their z-coordinate) and height of tags (value is set via parameter below Z_AXIS_COMPENSATION). Minimum number of anchors for applying this feature is 3.
2 – Do not recalculate distances, but z-axis of tags is set to fixed value of Z_AXIS_COMPENSATION.
Minimum number of anchors for applying this feature is 4.
Z_AXIS_COMPENSATION -1 <-1, MAX_INT> This parameter is related only to TYPE_OF_Z_COMPENSATION for 2D anchors deployment.
It is height level or z-coordinate value for all tags. Their z-coord afterwards won’t change during calculation. Value is in meters.
Value -1 disables compensation.
OUTLIER_ANCHOR_REJECTION_THRESHOLD 95 <0,100> This feature tries to remove one anchor from position calculation if its relative error is 95% bigger than calculation from previous anchor’s error.

Example of Z_AXIS_COMPENSATION scenario. This compensation feature should be activated only for specific 2D deployments where anchors are placed at the same height but tags are located in very distant height level.

Anchors are deployed at ceiling with coordinates [0,0,10] ; [0,10,10] ; [10,0,10] ; [10,10,10]. But tags are moving in height around 1 meter:

  • set coordinates of anchors via Sensmap to these values ([0,0,10] ; [0,10,10] ; [10,0,10] ; [10,10,10]). Do not forget to set also the z-coordinate (10).
  • set TYPE_OF_COMPENSATION to either 1 or 2
  • set Z_AXIS_COMPENSATION to 1 since tags are in height 1m


  • Console: Sensmap server connect fail

Solution: Bridge mode in VMware requires to have powered Ethernet card. Check whether the Ethernet cable is plugged to the Master Anchor and check its power supply.

  • Console: UDP Server Cannot be started

Solution: Probably another instance of rtlsserver is running. sudo service rtlserver stop.

6.RTLS Configuration

The Sewio RTLS System is based on Time of Flight distance estimation by technique known as two way ranging.  Whenever mobile device Tag tries to estimate its position it must determine at least three distances to static nodes so-called Anchors. Things become more complicated whenever more than one tag is trying to estimate its position in one time. Therefore, Sewio has developed robust and deterministic TDMA channel access for Tags.

6.1.Communication modes

RTLS system can operate in two radio communication modes. The modes differ with wireless link quality and achievable refresh rate. Within mode 1 communication over the radio is faster than for Mode 0. Therefore, total refresh rate is faster, but on the other hand communication range for Tags and Anchors is shorter and link is less robust than in Mode 0.

Mode RTLS Kit Refresh rate for 5 Tags and 5 Anchors
Mode 0 391 ms
Mode 1 117 ms

6.2.Configuration via Terminal

All devices Tags and Anchors might be configured via terminal, where channel, mode, refresh rate and number of devices within system might be configured.

Parameters channel, mode, refresh rate, transmit power must be set equally on all tags and anchors within the RTLS system. Parameters tag count and anchor count must be set equally on all tags and master anchor. Address of anchor and tag must be unique within the entire system, otherwise it will not work.

6.3.Default Settings

  • Channel: 1
  • Mode: 110k
  • NWK Address: 0x0001
  • Tag count: 5
  • Anchor count: 5
  • Refresh Rate: 392 ms

6.4.Configurable Options

Channel Center Frequency (MHz) Band (MHz) Bandwidth (MHz)
1 3494.4 3244.8 – 3744  499.2
2 3993.6 3774 – 4243.2  499.2
3 4492.8 4243.2 – 4742.4 499.2
4 3993.6 3328 – 4659.2 1331.2 (real approx. 900)
5 6489.6 6240 – 6739.2 499.2
7 6489.6 5980.3 – 6998.9 1081.6 (real approx. 900)
  • Mode: 0 / 1
  • Tag Count: 1 – 100 (address scope 0x1001 – 0x1064)
  • Anchor Count: 1 – 10 (address scope 0x0001 – 0x000A)
  • Refresh rate: 50 ms – 8 s

6.5.Serial Terminal Settings

Parameter Value
Baud Rate 115200
Data bits 8
Stop bits 1
Parity None
Flow Control None


  • Compliant with IEEE 802.15.4 UWB
  • Driven by MCU ARM Cortex M4
  • Configurable via USB terminal
  • Power Over Ethernet (Optional)
  • Ethernet output
  • Firmware for RTLS Master Anchor or Anchor
  • Dimensions 76x76x25mm
  • For Indoor use

UWB Anchor is preloaded with RTLS TWR firmware either for Master Anchor or Anchor.

  • Anchor – calculates distances to tags in range and wirelessly send it Master Anchor
  • Master Anchor – calculates distances to tags in range, receives distances from other anchors wirelessly and sends data out via UDP

Sewio provides customization service for this component.



6.6.1.Status Codes


Type Description
LED “Active” Device power supply
LED Status 1 – 1 s period blink Device in configuration mode
LED Status 1 – 300 ms continuous blink Instable power supply was applied. User need to unconnected power supply and wait for 15 s while internal capacitors are discharged.
LED Status 1 – 6 s period blink The anchor is not in range of master anchor. User should move anchor closer to master anchor or change anchor orientation until LED blinks every 6th second.

6.6.2.Master Anchor Output

Output from master anchor is sent via UDP protocol to destination IP implicitly broadcast to port 5000. UDP datagram is sent after each timeslot.

UDP body has following format (ASCII):

[Protocol version];

Example of output for Tag 0x1001 with measurement to 5 Anchors:

RSSI have 3 values per each measurement, range is from <-80,-105>, the higher the better.
Battery level is for Li-ion type from 4.2V-3.2V values 214-163.

6.6.3.Anchor Configuration via Serial Terminal

Hook up USB cable to PC and wait for Virtual COM port CP2104 driver installation, or install it manually. Port Number

Find COM port number in device manager.rtls_anchor_configuration the Application

Run the terminal application with appropriate settings (see above).rtls_anchor_configuration1

Push the reset button for 3 s until you see message below.rtls_anchor_resetrtls_anchor_message

On terminal should appear 25 s counter, press Enter for further configuration, press “Shift+P” for extended configuration with adjusting transmit power. Settings Level

It should be set equally on all tags and anchors within the system.

rtls_anchor_power_settings Channel

rtls_anchor_channel Mode

Select mode 0, 1. Mode 0 has better range but occupies more time on channel, thus minimal refresh rate is slower. Mode 2 is only experimental not recommended for use. 

rtls_anchor_mode Address

Select anchor’s address. Anchors should have consecutive address allocation in order to have effective allocated TDMA slots system. Number 1 is permanently assigned and dedicated for Master Anchor.


rtls_anchor_address or Reject

Confirm or reject the new settings.


6.6.4.Master Anchor Configuration via Serial Terminal

Hook up USB cable to PC and wait for Virtual COM port CP2104 driver installation, or install it manually. Port Number

Find COM port number in device manager.


Push the reset button and re-connect USB cable.

rtls_anchor_reset the Application

Run the terminal application with appropriate settings (see above).

rtls_anchor_configuration1 or Extended Configuration

On terminal should appear 25 s counter, press Enter for further configuration, press “Shift+P” for extended configuration with adjusting transmit power.

rtls_anchor_message Settings Level

It should be set equally on all tags and anchors within the system.

rtls_anchor_power_settings Channel

geolocation_anchor_channel Mode

Mode 0 has better range but occupies more time on channel, thus minimal refresh rate it slower. Mode 2 is only experimental not recommended to use.

geolocation_anchor_mode Number od Tags

Select number of Tags within system.

geolocation_anchor_tags Number of Anchors

Select number of Anchors within system.

geolocation_anchor_number Refresh Interval

Select refresh interval for positioning.

geolocation_anchor_interval Address

RTLS Server destination address, implicit

geolocation_anchor_destination_address or Reject

Finally, confirm or reject the new settings.



UWB Tag Li-ion

  • Compliant with UWB PHY IEEE 802.15.4
  • MCU Ultra Low Power EFM32G M3
  • Li-ion 600mA (USB charge)
  • Configurable via USB / Serial Terminal
  • MMA8453 – acceleration sensor

Optional components:

  • MPL3115A2 – altitude/pressure sensor
  • MAG3110 – orientation/magnetic field sensor
  • User LED
  • User Button
  • JTAG header available

A general purpose UWB Tag device for RTLS system powered from integrated Li-ion battery and configurable via USB. The Tag is equipped with accelerometer MMA8453 for movement detection and save battery lifetime. Tag might be further extending with magnetometer for orientation detection and atmospheric pressure meter. User input might be captured via optional user button. Tag supports six 802.15.4 UWB PHY channels and three communication speeds 110/850/6800 kbit/s. In default Tag is preloaded with Sewio TDMA RTLS firmware.

Sewio provides customization service for this component.

Dimensions & Weight
70x50x21 mm
25 g

6.7.1.Tag Functional Scheme

The full operation diagram is depicted in picture below.


6.7.2.Power Switch


At the moment, when the power switch is turned on, the Tag detects whether USB cable is connected.

If the cable is present, the Tag will wait for 25 seconds to allow users to enter to user menu of configuration mode.

Otherwise, the user input waiting procedure is omitted, and the Tag starts listening to the Master Anchor to get synchronized, and get ready to join to RTLS.

If the USB cable is connected during the active RTLS, the Tag will interrupt the localization and it will be waiting for the user input via the console for 25 seconds.


If the power switch is turned off, the localization service of the Tag is inactive. Tag can be charged.

6.7.3.Charging the Tag

Without RTLS localization service

Turn off the power switch and connect the USB cable to the Tag. USB is located on the left side of the device. The charging state is signalized via red LED light placed next to the USB connector. If the red LED light goes off, the charging is complete. It is recommended to use USB charger with high load capacity (especially if it`s required to charge from one source multiple TAGs), because the charging current of the Tag is rated up to 500 mA. 

Charging Tag and using RTLS

Turn on the power switch on the side of the device whenever the RTLS localization feature has to be used while the charging procedure is in progress. The charging state is signalized with a red LED next to the USB connector.

Note: If the USB cable was connected to the Tag (before the power switch was turned on) the RTLS localization service will be started for after 25 sec, to wait for user configuration timeout through the console.

6.7.4.Serial Terminal Settings

Parameter Value
Baud Rate 9600
Data bits 8
Stop bits 1
Parity None
Flow Control None

6.7.5.Tag Configuration via Serial Terminal

Hook up the USB cable to the Tag. 

Install CP210x USB to UART Bridge VCP Driver. Download drivers from Silicon Labs site here. COM port number

My computer -> Device Manager (or press  Windows key + R, type devmgmt.msc and press enter)

rtls_tag_port_number the PuTTY

Download and run the PuTTY Terminal program , and edit the following options:

rtls_tag_putty_edit the COM Port

The user needs to open the COM port with some terminal program within 25 seconds after the Tag was connected to the PC. If the user presses the Enter while waiting for user input, the Tag will enter into the user configuration menu. Press “Shift+P” for extended configuration with adjusting transmits power.

If the waiting time was expired, turn off the tag, wait 5 seconds and turn it on again. In case of trouble, turn off the Tag, disconnect USB cable, turn it on again, reconnect the USB cable and open the COM port within 25 seconds. Update

Initially, boot-loader is started. It provides capability to update firmware. After the 5 second timeout the Tag settings appear.

rtls_twr_tag_bootloader Settings Level

It should be set equally on all tags and anchors within the system.

rtls_tag_power_settings Channel

rtls_tag_select_channel Mode

Select mode 0 or 1. Mode 0 has better range but occupies more time on channel, thus minimal refresh rate is slower. Mode 2 is only experimental not recommended to use.  

rtls_tag_select_mode Number of Tags

Select number of Tags within system.

rtls_tag_number_tags Address

Select tag’s address. Timeslot and address are directly related, timeslot 1 is assigned to address 0x1001, timeslot 2 is assigned to address 0x1002 etc. Tags should have consecutive addresses allocation in order to have effective allocated TDMA slots system.

rtls_tag_address Number of Anchors

Select number of Anchors within system.

rtls_number_anchors Control

The tag’s internal accelerometer provides six settings for movement detection. The value 0 disables this feature and the Tag will continue ranging function also in case when it is not in a motion. Other values put the Tag to sleep mode when tag is static. Values 1 – 3 defines a behavior, where Tag will go to sleep after 5s inactive motion, and values between 4 – 6 put Tag immediately to sleep mode. Difference among these settings is also in sensitivity level of the accelerometer. The higher sensitivity the higher power consumption of the Tag, typically from 10-50uA of continuous current.

rtls_twr_tag_motion_control Rate Interval

Select refresh rate interval for. For the absolute fastest refresh rate zero can be entered.

rtls_refresh_rate_interval Settings

Finally, confirm or reject the new settings.


7.Migrating RTLS software

7.1.System Requirements

  • Ubuntu 14.04 64bit operation system
  • Processor Intel Core i3 or higher
  • At least 4GB RAM memory

7.2.Apache, PHP, MySQL installation

In Ubuntu console type following lines:

7.2.1.Install Apache

  • sudo apt-get update
  • sudo apt-get install apache

7.2.2.Install MySQL

Install mysql  and use password “sensmap”

  • sudo apt-get install mysql-server-5.6 php5-mysql
  • sudo mysql_install_db


7.2.3.Install php5

  • sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

7.2.4.Install CURL

Install CURL for PHP

  • sudo apt-get install php5-curl

Check if file /etc/php5/cli/conf.d/XX-curl.ini, where XX is number, contains “extension=curl.so”. If not, add it.

7.2.5.Install phpmyadmin

Install phpmyadmin, use password “sensmap”

  • sudo apt-get install phpmyadmin

7.2.6.Edit apache.conf

Edit apache.conf

  • sudo vim /etc/apache2/apache2.conf

Then add the following line:

Include /etc/phpmyadmin/apache.conf

Modify the Apache configuration file and change AllowOverride None to AllowOverride All for the document root:

Locate the section that looks like the following:

<Directory /var/www/>

        Options Indexes FollowSymLinks

        AllowOverride None

        Require all granted


Change it to the following and save the file:

<Directory /var/www/>

        Options Indexes FollowSymLinks

        AllowOverride All

        Require all granted


To use mod_rewrite from within .htaccess files, edit the default VirtualHost with

  • sudo vim /etc/apache2/sites-available/000-default.conf

Search for “DocumentRoot /var/www/html” and add the following lines directly below:

<Directory “/var/www/html”>

            AllowOverride All



Setting mode rewrite for Apache

  • sudo a2enmod rewrite
  • sudo service apache2 restart

7.2.8.Create Database

Go to http://YOUR_IP/phpmyadmin/index.php

Create database with name “sensmapserver”


7.2.9.Import Database

Import database schema sensmapserver_default.sql from RTLSKit_vmware.zip.


7.2.10.Install Glib

Install Glib

  • apt-get install libglib2.0-dev
  • apt-get install libgtk2.0-dev


7.2.11.Download libwebsocket library

Download and unpack libwebsocket library.

  • apt-get-install cmake
  • apt-get-install zlibc
  • apt-get-install zlib1g-dev
  • sudo cmake -DLWS_WITH_SSL=0
  • sudo make
  • sudo make install
  • sudo ln -s /usr/local/lib/libwebsockets.so.5 /usr/lib/libwebsockets.so.5

7.2.12.Install libmeschach

Install libmeschach package

  • sudo apt-get install libmeschach-dev

Download and unpack meschach library


make basic


7.2.13.Copy RTLS Server

Copy Rtls Server to your host

Source Location /home/rtlsserver

Change IP in config.ini to your host


7.2.14.Copy Sensmap Server

Copy Sensmap Server to your host www directory

Source Location: /var/www/html/sensmapserver

7.2.15.Copy Sensmap Visualization

Copy Sensmap Visualization to your host www directory

Source Location: /var/www/html/sensmap

Change sensmap/config/config.js file_upload_ip and rest_ip to your IP host address.


7.2.16.Change Permission

Change permission for www files as follows

(change <your_account_name> to your actual account name):

  • sudo adduser <your_account_name> www-data
  • sudo chown -R www-data:www-data /var/www
  • sudo chmod -R g+rwX /var/www


7.2.17.Copy Service Scripts

Copy service scripts for Sensmap Server and RTLS server to your host Ubuntu

  • Source Location: /etc/init/rtlsserver.conf
  • Source Location: /etc/init/sensmapsocketserver.conf

Services should be started in the following order:

Apache -> SensmapSocketServer -> Rtls Server



Edit /etc/init.d/apache2

Add to line 175 initctl emit apache2-started



7.2.19.Reboot and Check

Reboot machine sudo reboot

Check whether RTLS Server and SensmapSocketServer are running



7.3.1.Changing DB password

If you change password to database you need to also adjust getConnection() in Sensmap Server script located at the end of /sensmapserver/api/index.php


Do not forget re-apply appropriate privileges, subsection 5.12.14.

7.3.2.How to change Websocket port

Please edit following lines:

Sensmap Visualization:

/var/www/html/sensmap/xively.js, line 28


Sensmap Server:

/var/www/html/sensmapserver/api/index.php, line 3024


/var/www/html/sensmapserver/socket/bin/websocket-server.php, line 20


RTLS Server:

/home/rtlsserver/config.ini, line 6


7.3.3.How to modify IP of RTLS server

Sensmap Visualization

/var/www/html/sensmap/config/config.js, lines 10 and 13


RTLS Server:

/home/rtlsserver/config.ini, line 3



Equivalent releases of software bundles:
RTLSKIT-AP-RPI-v0.06 (Raspberry Pi2) and RTLSKIT_gen2_rev3 (VMware image)
RTLSKIT-AP-RPI-v0.05 (Raspberry Pi2) and RTLSKIT_gen2_rev2 (VMware image)

RTLS Kit Sofware Bundle for RPI2

RTLSKIT-AP-RPI-v0.06 release contains:
RTLS Server v1.10
Sensmap Server v2.06
Sensmap Visualization 6.0011

[b] Linux IRQ balancer process switched OFF – might lead to freeze RPI after several days
[+] Status page improved (start/stop control added, display network interfaces and Apache error log)

RTLSKIT-AP-RPI-v0.05 release contains:
RTLS Server v1.09
Sensmap Server v2.02
Sensmap Visualization v6.0006
Ubuntu 14.04.2 LTS (GNU/Linux 3.18.0-20-rpi2 armv7l)

RTLS Kit Sofware Bundle for VMware

RTLSKIT_gen2_rev3 release contains:
RTLS Server v1.10
Sensmap Server v2.06
Sensmap Visualization 6.0011

[+] Status page improved (start/stop control added, display network interfaces and Apache error log)

RTLSKIT_gen2_rev2 release contains:
RTLS Server v1.09
Sensmap Server v2.02
Sensmap Visualization v6.0006

RTLSKIT_gen2_rev1 release contains:
RTLSServer v1.06
Sensmap Server v2.00
Sensmap Visualization v6.0002

[b] bugfix switch-off continuous console logging, could fillup storage area and slow down machine very soon
[+] added status and shutdown webpage

RTLS Server
[-] removed option WEBSOCKET_ACTIVE (now rtlsserver defaultly subcribes to anchor updates)
[+] added option UPLOAD_VIA_REST (1 = upload data via REST which enables zoning, 0 = upload data via websocket but with no zoning)
[+] z_compensation is defaultly disabled and set to 0
[+] added all config settings to initial program output
[+] added height compensation feature for very different level of Tags and Anchors for 2D calculation
[+] added kalman filter
[b] bugfix with character “A” or “a” in tag name
[b] bugfix with coord option in config.ini
[+] added 3D calculation
[+] added outlier anchor detection feature
[i] improved initial guess and dynamic adding tags
[+] added support for 100 tags & 15 anchors for RTLS kit
[-] removed some debug messages

Sensmap Server
[+] REST setup now returns also information about number of plans for given user (not just setup info, tags and anchors)
[+] plans URL are now dynamically changed according to the current server IP (not the IP when plan was uploaded)
[+] zones have two new properties : name (varchar 255) and type (varchar 255)
[+] added api for updating ONE zone: sensmapserver/api/zones/ID
[+] user can update scale/origin/name/type
2.03 Major changes
[+] getting info about feed(s) gets all columns instead of predefined (i.e. also alias)
[+] stability change: user can now also send PUT request with empty datastream, e.g. datastreams:[{},{}], which is valid json. Previously resulted in syntax error
[+] Only for RTLS TDOA:/tags/user and /anchors/user now also outputs hw_version, fw_version, battery level and platform for tags. If there are no information, REST outputs zeroes
[+] user can set alias for both tag and anchor
[b] bugfix: data stored to DB via socket was only stored when there was at least one subscriber (e.g. connected browser with sensmap). Now the data are always stored when saveToDB equals “true”
[+] added possibility to upload data to REST API and not forward this data to SocketServer for further dissemination.
[+] added possibility to store data to DB via SocketServer (RTLSserver no longer has to send data to the REST to store positions in DB)
[b] bugfix issue with CPU overloading, updated Ratchet library
initial version

Sensmap Visualization
[b] bugfix loading screen disappears when no plan should be loaded automatically
[b] bugfix loading screen disappears when there are no found building or plan
[b] bugfix loading screen disappears when REST is offline
[+] automatically load last added plan (not first)
[+] tutorial is also initiated when there are no plans (or buildings)
[b] zones are not automatically drawn
[b] corrected small typo in warning message (exits > exists)
[b] removed invalid message that user has no right to upload zone even though he has
[+] every time plan is loaded, the zones are hidden
[+] if user deletes plan which is currently shown – init screen is showed and dropdown is updated
[b] tutorial – removed cancel button from popups with no other button
[+] major refactoring (zone’s part)
[+] completely new zoning feature (new zones grid, new zone design, new zone creation, new zone update)
[+] added notifications when entering zone
[+] added sounds when entering zone
[+] added new field for entering alias when creating/updating RTLS feed
[+] added tooltip for alias field
[b] corrected typo (not adress but address)
[+] RTLS marker label is set to alias IF there is alias. Otherwise address is shown
[+] size of rectangle around marker label now dynamically changes according to the length of text
[+] alias is also shown in nodes grid
[+] added new function which can combine datastreams and make their union
[+] address of anchor or tag can now be arbitrary hex string
[b] bugfix: drag&drop anchor caused offset upon saving due to origin marker being in different position than [0,0]
[+] added detailed alerts when Sensmap Socket Server connection is lost
known limitation: Anchor won’t move visually in Sensmap Visualization if its position is updated via REST at the background. Refresh Sensmap page will display it correctly
[i] improved drag&drop markers
[i] improved marker drawing
[i] improved tracking markers
[b] upgraded to latest version of Raphael library, resolved 100% processor speed lock issue (php)
[-] removed some console.log debug prints
[+] added validation if websocket in user’s browser is supported, page loader is interrupted if REST is not accessible
[-] removed unnecessary console.logs
[+] added maximum number of tracked points per marker ({1,..,100}, unlimited),
[+] added grid via hotkey (g)
[+] added loading screen which automatically hides after page load
[i] improved tag animation: tags are animated absolutely rather than by relative offsets
[b] bugfix graphical bug when switching between browser tabs
[i] improved REST IP to which Sensmap Visualization connects dynamically to location.host

9.Terms & Conditions

Sewio provides the enclosed product under the following conditions:

This device is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR

EVALUATION PURPOSES INDOORS ONLY and is not considered by Sewio to be a finished end-product fit for general consumer use. Persons handling the product(s) must have electronics training and observe good engineering practice standards. As such, the goods being provided are not intended to be complete in terms of required design-,marketing-, and/or manufacturing-related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards. This device does not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), recycling (WEEE), FCC, CE or UL, and therefore may not meet the technical requirements of these directives or other related directives.

The user assumes all responsibility and liability for proper and safe handling of the goods. Further, the user indemnifies Sewio from all claims arising from the handling or use of the goods.


Sewio assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein.

No license is granted under any patent right or other intellectual property right of Sewio covering or relating to any machine, process, or combination in which such Sewio products or services might be or are used.

FCC Warning. This device is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY and is not considered by Sewio to be a finished end-product fit for general consumer use. It generates, uses, and can radiate radio frequency energy and has not been tested for compliance with the limits of computing devices pursuant to part 15 of FCC rules, which are designed to provide reasonable protection against radio frequency interference. Operation of this equipment in other environments may cause interference with radio communications, in which case the user at his own expense will be required to take whatever measures may be required to correct this interference.

Sewio does not guarantee, or assume any responsibility or liability for, the accuracy, of RTLS products since the accuracy and precision is parameter affected by the customer’s environment and optimization of installation. Furthermore, injuries and interferences caused by radio signal emission are in full responsibility of the customer, who agrees to operate with the RTLS product in such manner not to cause any above mentioned issues. Customer use of any information presented by Sewio as voluntary information and his reliance on this information is at customer’s own risk.

Suggest Edit