Skip to content

flemic/ETD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETD - Enriched Training Database

The Enriched Training Database (ETD) a web-based service that enables storage and management of different types of training fingerprints for enabling WiFi RSSI-based indoor fingerprinting, with an additional "enriching" functionality. The user can leverage the enriching functionality to generate virtual training fingerprints based on propagation modeling in virtual training points.

Table of Contents

Requirements

Installation and Setup

  • Start a MongoDB service on a defined port number (default port number is 27017) and provide the path to a folder where data is to be stored:
sudo mongod --dbpath <path_to_data> --port <port_num> 
  • Download the ETD service and navigate to the etd_core folder. Set the MongoDB port number and hostname ('localhost' if MongoDB and ETD services are running on the same machine) - lines 19 and 20 in the etd_core.py. Set the ETD service host and port - last line in the etd_core.py. Start the ETD service with:
python etd_core.py 

Envisioned Usage Concept

alt tag

Basic Usage

A set of Python scripts that allows basic data management in the ETD service is provided in the folder examples. At the moment all necessary parameters have to be defined by editing the scripts.

  • Create new database: createNewDatabase.py
  • Create new collection: createNewCollection.py
  • Collect WiFi RSSI measurements: rawWiFiRssiScanner.py
  • Get message: getMessage.py
  • Get a list of messages in a collection: getMessageList.py
  • Get a list of collections in a database: getCollections.py
  • Get a list of databases: getDatabases.py
  • Change message parameters: changeMessage.py
  • Replace message: replaceMessage.py
  • Change the name of a collection: changeCollectionName.py
  • Delete message: deleteMessage.py
  • Delete collection: deleteCollection.py
  • Delete database: deleteDatabase.py

Raw Data Format

The format of the message for storing WiFi RSSI measurements is given below. The message is provided in the folder message_types and it is named raw_data.proto.

message RawRFReading {
  optional string sender_id = 1;                 // ID of the sender
  required string sender_bssid = 2;              // BSSID of the sender
  required string channel = 3;                   // Channel
  required int32 rssi = 4;                       // RSSI (Received Signal Strength Indicator)
  optional int64 timestamp_utc = 5;              // Milliseconds from 1.1.1970.
  required int32 run_nr = 6;                     // Run number
  required Location receiver_location = 7;       // Location of the receiver
	
  message Location {
    required double coordinate_x = 1;            // x-coordinate
    required double coordinate_y = 2;            // y-coordinate
    optional double coordinate_z = 3;            // z-coordinate
    optional string room_label = 4;              // Room label
  }
} 

message RawRFReadingCollection {
  repeated RawRFReading raw_measurement = 1;     // Collections of raw RSSI data
  required int32 meas_number = 2;                // Number of measurements
  required string data_id = 3;                   // ID of the data
  required bytes _id = 4;                        // Internal ID given by the MongoDB 
  optional int64 timestamp_utc_start = 5;        // Milliseconds from 1.1.1970. start time
  optional int64 timestamp_utc_stop = 6;         // Milliseconds from 1.1.1970. stop time
}

This message can be changed according to the specific needs of a particular user. However, the required parameters have to be in included in the message format and values have to be given to them during the training survey measurement campaign. In case the message format is changed, a new translation of a Protocol Buffer structure to Python has to be performed:

protoc -I=$SRC_DIR --python_out=$DST_DIR $SRC_DIR/raw_data.proto

This command will generate (if the new message is properly defined) a raw_data_pb2.py file, and this file has to be used for replacing the obsolete version in directories examples, help_functions and etd_core.

Generating and Storing Training Fingerprints

After collecting WiFi RSSI measurements at predefined locations and storing them in the ETD service, the user has to modify and then use the script generateAndStoreFingerprints.py in the directory help_functions. The modification of the script has to reflect the intended training fingerprints. The script contains two examples: (1) training fingerprint is a set of averaged RSSI values from each visible WiFi AP at a certain measurement location; (2) training fingerprint is the 4 quantile values from each WiFi AP visible at a certain measurement location.

Enriching Functionality

Generation of virtual training fingerprints can be done using the script virtualizeTrainingFingerprints.py in folder help_functions. In the script, one has to set the desired parameters:

  • Database/collection that contains original training fingerprints;
  • Enriched database/collection in which original and generated virtual fingerprints are to be stored;
  • Virtual training points definition method (at the moment: User or modified Voronoi based);
  • Propagation model (at the moment: IDWI and Multi-wall);
  • BSSIDs of WiFI APs whose RSSIs are to be modeled in the defined virtual training points;

Implementation of New Virtual Points Definition Methods

The design of the ETD allows implementation of new methods for the definition of virtual training points. In order to implement a new method for virtual training points definition, the user firstly has to add this option in the etd_core.py script (line 692). This code segment:

  if parameters['define_virtual_points'] == 'User':
      points = EF.virtual_point_user()
  elif parameters['define_virtual_points'] == 'Voronoi':
      points = EF.virtual_point_modified_voronoi(coordinates)
  else:
      return json.dumps('Unknown method for the definition of virtual training points')

has to be replaced with the following:

  if parameters['define_virtual_points'] == 'User':
      points = EF.virtual_point_user()
  elif parameters['define_virtual_points'] == 'Voronoi':
      points = EF.virtual_point_modified_voronoi(coordinates)
  elif parameters['define_virtual_points'] == 'new_method_name':
      points = EF.virtual_point_'new_method'()
  else:
      return json.dumps('Unknown method for the definition of virtual training points')

For the generation of virtual training points the user may require the locations of original training points. These locations are provided in the variable coordinates in the following format:

list[tuple_point_0(coordinate_x,coordinate_y),...,tuple_point_N(coordinate_x,coordinate_y)]

The user should then be able to implement a new method virtual_point_'new_method'() for defining virtual training points. The required output is the same as for the original set of points shown above - list of tuples.

Implementation of New Propagation Models

New propagation model can be easily implemented. Slight modifications of the etd_core.py script are needed for defining a new model name and the function name (if-else statement starting from line 699 has to be extended). Additionally, a new model has to be implemented in the enriching_funtionality.py script.

Multi-Wall model in New Environments

For accommodating the multi-wall model for new environments, one has to modify the following in the multiwall_model folder. Firstly, one need a footprint of the new environment. Secondly, one has to define the physical dimensions of the new environment in the floor_size.txt file, following the provided format. Finally, at the moment one has to define the transmitters locations and their TX power, as well as the parameters of the multi-wall model. Estimation of the transmitters locations and multi-wall parameters is the next feature -will be added soon.

About

ETD - Enriched Training Database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published