Difference between revisions of "WiFi Indoor Location Device (WILD) software"

From fit-PC wiki
Jump to: navigation, search
(See Also)   (change visibility)
(Boot)   (change visibility)
 
(3 intermediate revisions by 2 users not shown)
Line 16: Line 16:
 
* Internal eMMC (not covered by this man page)
 
* Internal eMMC (not covered by this man page)
 
CompuLab installation procedure must be invoked in order to deploy the image onto a removable media.
 
CompuLab installation procedure must be invoked in order to deploy the image onto a removable media.
# Consult [[WILD revision notes]]
+
# Download the latest WILD image - see [[WILD revision notes]] and consult associated readme.
# Download the latest  [https://www.fit-iot.com/files/download/wild/4G-wild.img.xz CompuLab WILD Image].
+
# Consult [https://www.fit-iot.com/files/download/wild/4G-wild.img.xz.readme WILD image readme].
+
 
# To deploy on a desktop PC:
 
# To deploy on a desktop PC:
 
{| border="2" cellpadding="0" width="100%"  align="center"   
 
{| border="2" cellpadding="0" width="100%"  align="center"   
Line 63: Line 61:
 
|-
 
|-
 
| align="" |
 
| align="" |
support
+
compulab
 
| align="" |
 
| align="" |
support
+
compulab
 
| align="" |
 
| align="" |
 
|}
 
|}
Line 71: Line 69:
 
* To acquire '''root''' credentials:
 
* To acquire '''root''' credentials:
 
  sudo -i
 
  sudo -i
 +
== ftm-services ==
 +
* Intro
 +
'''ftm-services''' is a set of the CompuLab scripts for managing FTM devices.
 +
* History
 +
{| border="2" cellpadding="0" width="100%"  align="center" 
 +
|-
 +
! style="font-size: 125%; background-color: #eeeeee;" align="left" width="20%" | WILD Version
 +
! style="font-size: 125%; background-color: #eeeeee;" align="left" width="80%" | Description
 +
|-
 +
| align="" |
 +
< 0.70
 +
| align="" |
 +
Delivered as a set of services installed onto the rootfs, but w/out being registered as a deb package in the Debian package manager.
 +
| align="" |
 +
|-
 +
| align="" |
 +
>= 0.70
 +
| align="" |
 +
Starting from the 0.70 version these services come as a deb package with the same name.
 +
| align="" |
 +
|}
 +
* Install/Update procedure
 +
cd /tmp
 +
wget https://www.fit-iot.com/files/download/wild/0.7.2/ftm-services_0.7.2.deb
 +
sudo dpkg -i /tmp/ftm-services_0.7.2.deb
  
 
= Commands =
 
= Commands =
Line 281: Line 304:
 
= See Also =
 
= See Also =
 
* [[WiFi Indoor Location Device (WILD) | WILD technical documentation root]]
 
* [[WiFi Indoor Location Device (WILD) | WILD technical documentation root]]
 +
* [[WILD revision notes]]
 
* [https://fit-iot.com/web/products/wild WILD homepage]
 
* [https://fit-iot.com/web/products/wild WILD homepage]
  
 
[[Category:WILD]]
 
[[Category:WILD]]

Latest revision as of 04:43, 29 April 2019

Overview

The Wi-Fi location technology is based on a protocol specified in 802.11mc-FTM (IEEE 802.11mc-2016 technical Specification) which defines the Fine-Timing-Measurement (FTM) procedure between a mobile device (FTM initiator) and a network infrastructure device (FTM responder / FTMR)
The protocol allows:

  • Initiator to exchange FTM packets without the need to be associated with a Wi-Fi Access Point.
  • Co-existance of SoftAP functionality and FTM ranging in both initiator and responder.

Hardware platform

WILD is based on Compulab fitlet2 with Intel AC8260 WiFi module

Getting started

Deployment

CopmpuLab provides a raw image that can be deployed onto the following bootable media.

  • SD-Card
  • USB flash disk
  • Internal SATA SSD / HDD (not covered by this man page)
  • Internal eMMC (not covered by this man page)

CompuLab installation procedure must be invoked in order to deploy the image onto a removable media.

  1. Download the latest WILD image - see WILD revision notes and consult associated readme.
  2. To deploy on a desktop PC:
OS How To

Linux

  • Make sure that the removable device was recognized by the host. Issue:
udevadm monitor --subsystem-match=block --kernel
  • Insert the device, wait for the udevadm report:
udevadm monitor --subsystem-match=block
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[37893.873104] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/host3/target3:0:0/3:0:0:0/block/sdc (block)
KERNEL[37893.873136] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/host3/target3:0:0/3:0:0:0/block/sdc/sdc1 (block)
KERNEL[37893.873161] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/host3/target3:0:0/3:0:0:0/block/sdc/sdc2 (block)
  • The device was recognized as /dev/sdc.
  • Terminate the udevadm session; press Ctrl-C; continue to the next step.
  • Issue this command:

Important:
The dd command will destroy all data stored on the /dev/sdc.

xz -dc /path/to/4G-wild.img.xz | sudo dd of=/dev/sdc bs=1M status=progress

Important:
The device name in the command above is just an example. Take a real device name from the udevadm report on your desktop.

Windows

Make use of Rufus. Refer to the vendor site for details: https://rufus.akeo.ie/

Boot

  • Allow the device to boot from the bootable FTM media.
  • Login with one of the default users:
User Name Password

compulab

compulab

  • To acquire root credentials:
sudo -i

ftm-services

  • Intro

ftm-services is a set of the CompuLab scripts for managing FTM devices.

  • History
WILD Version Description

< 0.70

Delivered as a set of services installed onto the rootfs, but w/out being registered as a deb package in the Debian package manager.

>= 0.70

Starting from the 0.70 version these services come as a deb package with the same name.

  • Install/Update procedure
cd /tmp
wget https://www.fit-iot.com/files/download/wild/0.7.2/ftm-services_0.7.2.deb
sudo dpkg -i /tmp/ftm-services_0.7.2.deb

Commands

wild

This is an FTM management command. Refer to the command man page for details. wild command is available in WILD version 0.7 and later.

man wild

Get WILD version

wild -v

Set WILD to initiator mode

wild -mi

Set WILD to responder mode

wild -mr

Set WILD to off mode

wild -mo

Neither initiator or responder commands are available in this mode.

ftm-role (depreciated)

See WILD depreciated commands

ftm-options

When in client mode, scan responders and enable / disable specific responders for ranging requests

ftm-options

ftm-show

  • Client: show the results of ranging request.
  • Responder: show the FTM requests statistics.
ftm-show

FTMR (FTM Responder)

Configuration files

hostapd configuration file

  • /etc/hostapd.conf

Used for setting FTMR properties e.g.

  1. SSID - to brodcast when in responder mode
  2. Channel and bandwidth

Change channel bandwidth

80MHz 40MHz 20MHz

ieee80211ac=1
vht_oper_chwidth=1

ieee80211ac=0
vht_oper_chwidth=0

ieee80211ac=0
vht_oper_chwidth=0
ht_capab=[SORT-GI-20]
require_ht=0

Change band

2.4GHz 5.0GHz

hw_mode=g
ieee80211n=1

hw_mode=a
ieee80211n=1
ieee80211ac=1

For more information about the hostapd.conf parameters refer to: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf

Configuration Manual

For more information refer to: FTMr configuration

FTMR Network Configuration

  • Interfaces

The device network configuration described by /etc/network/interfaces
Below is an configuration example that configures the br0 at the boot time.

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

# closest to the edge
# a spare network interface (can be disconnected)
# Roles:
# 1: a generic network interface
auto enp2s0
allow-hotplug enp2s0
iface enp2s0 inet manual

# closest to the power plug
# Roles:
# 1: a part of bridge
# 2: a generic network interface
auto enp3s0
allow-hotplug enp3s0
iface enp3s0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual

# Bridge Setup
# This is a bridge interface
# gets turned on when device is a responder
# auto br0
iface br0 inet dhcp
bridge_ports wlan0 enp3s0
  • Bridge configuration

Make use of the brctl for details.

brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.0001c01fd60c       no              enp3s0
                                                        wlan0

FTMR Backhaul

All FTM device has two wired interfaces.
Important:
The wired interfaces configured as auto & dhcp must be connected to the LAN at the boot time.
Otherwise the device will experience a boot delay.

FTMR Transmit Location Data

  • Configuration file: /opt/compulab/service/ftm-common

Contains the SERVERS list to send the scan results file :/opt/compulab/www/results.all

SERVERS=(http://localhost/cpl/curl.php http://wild-server/hard/curl.php)
  • FTM ranged service: /opt/compulab/service/ftm-range.main

The service walks through the SERVERSs' list and send the scan results to each one:

for SERVER in ${SERVERS[@]};do
curl -d @${iw_scan}/results.all ${SERVER} &>/dev/null
done

FTMR SoftAP

Intel 8260 can work as an FTMR & a SoftAP simultaneously.

SoftAP services

There are two services that must be configured & run in order to provide the SoftAP functionality:

  • bridge

FTM bridge service is in charge of configuring a bridge between wlp1s0 (i8260) and enp3s0 interfaces.
It allows all wireless interface requests to get forwarded to the enp3s0.
The enp3s0 interface must be connected to the LAN.
FTM bridge service starts automatically while in responder mode. In order to control it manually: start/stop/status/disable, issue:

systemctl start/stop/status/disable ftm-br
  • hostapd

The hostapd daemon turns the device into a SoftAP while in a responder mode.

How to get connected to the SoftAP wireless network:

  1. Scan wireless networks;
  2. Try to get connected to a network with name COMPULAB_WILD password indoorlocation.
  3. In case that the bridge service is up and running the wireless clients will get connected to the LAN.

SoftAP know issues:

  1. The backhaul interface enp3s0 is down. Wireless clients can't get connected to the SoftAP. The client software reports on Connecting state.
  2. ftm-br service is stopped. Wireless clients can't get connected to the SoftAP. The client software reports on Connecting state.

FTMI (FTM Initiator)

FTM services configuration file (initiator/client mode)

  • /opt/compulab/service/ftm-common
Field Description

FTM_SSID

List of the AP SSIDs to scan & send range requests when in client mode.

Match condition 'FTM_SSID[x] ~ discovered_ssid'.
For instance the hostapd.conf file SSID="COMPULAB-"+serial_number, then the FTM_SSID must be FTM_SSID="COMPULAB-".
The match condition turns 'true' and client takes this responder into account.

BW=80; TOF="bw=${BW} cf=5240 cf1=5210 spb=2 asap"

Template of a TOF string. The ftm-range service makes use of this when in client mode.

BW=80 works for both 40 MHz & 80 MHz bandwidth modes.
BW=40 does not work at all. The client receives empty replies from the responders if BW=40.

See Also