Skip to content

Server Module which tests efficiency of a SmartWatch using traffic shaping and MQTT.

Notifications You must be signed in to change notification settings

ayeshx/Watch1CodeServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Exploring Edge Mining for Context-Aware Ubiquitous Learning using Smart Watches

PI: Imran Zualkernan

Award: EFRG18-SCR-CEN-82


Steps to setup the Experiment

  1. Basic Setup Steps

    • Download the zip file and extract it locally.
    • Move the project to your /home directory.
    • Switch to the project folder in command line and enter npm install.
    • That should install the required dependencies of mqtt, cassandra-driver, exceljs and pcap2csv , otherwise manually install them.
    • Open testAutomater.js file and change the server_file and pcaps constants to point to your exact server.js file as shown in the default value and also to your pcaps directory where the throughput.csv file will be saved.
    • Install Cassandra DB on your machine. Steps can be found at this link http://cassandra.apache.org/download/
    • After installation, an instance/node of cassandra should be running automatically, check status by running nodetool status or sudo service cassandra status. Both should give you an active or running status for one node.

      Note: If you get nodetool error or service cassandra status returns that the service has exited, it means that cassandra is crashing, and probably has to do with the amount of space that is required. Try increasing your VM RAM to about 16 GB or so and retry.

    • Additionally, you will need an MQTT broker running locally, try using PONTE npm broker. Installation and setup steps can be found at https://www.npmjs.com/package/ponte
    • Once the environment is setup and the broker is running, start the server.
    • Change the experiment number by modifying the exp_num variable if you run the experiment more than once. This will create a new record/table in the DB for every experiment you run.
    • The server displays all the data it receives from the watch and also saves it in the DB with a unique key called timestamp.
    • You can view the entries in the DB by running cqlsh on command line and entering the Cassandra Query Language(CQL) shell. From there just enter select * from watch_analytics.experiment# with your experiment # and view the results.
    • Change the tcconfigprofiles variable to your downloaded project directory and tcconfigprofiles directory under it
    • Change the network_driver variable to your wireless adapter name, when you run ip addr or ifconfig.
    • Similarly change the pcaps variable to your pcaps directory location in your downloaded project.
  2. Setup for Tizen OS (Samsung Gear S3)

    • If running a Samsung watch, change the targetWatch constant in the testAutomater.js file to the address of your watch too.
    • Make sure the test machine and the watch are on the same network.
    • It may not work on the first try because of SDB related issues, so re run it again.
  3. Setup for Android Wear (Huawei Watch)

    • Download the Nativescript Android App from https://github.com/ayesh6x6x6/Watch3-Android-NativescriptApp.
    • Move the downloaded project to the same location as your Main Server (this project).
    • Go to your watch and enable adb debugging under developer options.
    • Make sure the test machine and the watch are on the same network.
    • Also enable Wi-fi debugging or debugging over Wi-fi which will give you an address to connect to along with the port number, usually 5555 by default.
    • change the adb_huawei_addr variable to the IP address of your watch with the port number as the default value shows.
    • Lastly, install the Nativescript CLI globally by running npm install -g nativescript.
  4. Setup for Fitbit OS Device (Fitbit Versa)

    • Download the Fitbit Device Fitbit App from https://github.com/ayesh6x6x6/Watch2FitbitApp
    • Move the downloaded project to the same location as your Main Server (this project).
    • Download the Fitbit App on your phone which is the primary pair of the Fitbit device.
    • Enable bluetooth and Wifi on your phone and open the app.
    • Select your device and enable developer bridge from the developer options.
    • On your Fitbit device go to settings and enable the Developer Bridge too.
    • Make sure the test machine, the watch and the companion (The phone which is paired with your Fitbit using the Fitbit App) are on the same network.
    • When running the server and having a Fitbit device, a second shell will open as fitbit$, enter the command install here.
  5. Setup for Arduino Device (ESP 32)

    • Change the SSID, password and IP to the one in which you are running your experiment.
    • download and install arduino IDE from https://www.arduino.cc/en/Main/Software
    • Run arduino IDE
    • go to file-> preferences and paste https://dl.espressif.com/dl/package_esp32_index.json in additional boards manager url field
    • go to tools->board->board manager and search for esp32 and install
    • go to tools->manage libraries, and search for mqtt.
    • select and install MQTT by joel gaehwiler
    • copy the code from ESPMQTTArduinoTestAuto.c to arduino ide, verify and upload
  6. Network Shaping Setup & Requirements

    • you will need to install tcconfig.
    • On debian/ubuntu enter wget https://github.com/thombashi/tcconfig/releases/download/v0.19.0/tcconfig_0.19.0_amd64.deb
    • Follow by this command sudo dpkg -i tcconfig_0.19.0_amd64.deb
    • You will also need to install Wireshark to use the tshark command line utility, this is simply done from the Ubuntu Software.
    • If you get the following error, couldn't run /usr/bin/dumpcap in child process: Permission Denied or something similar its a permissions related issue and add your user to the wireshark group by-
      1. sudo dpkg-reconfigure wireshark-common
      2. choose answer as "YES" .Then add user to the group by
      3. sudo adduser $USER wireshark
      4. Restart your machine or wireshark.
      5. The pcaps you capture should not be locked, a useful link- https://askubuntu.com/questions/458762/how-to-enable-wireshark-without-running-as-root-in-trusty-14-04
    • After successfull run, in the pcaps directory, you should get a throughput.csv file which has the network related information. For every re-run of the same experiment, remove the old pcaps and csv file. For new experiments, change exp_num and the Examples.xlsx file.
  7. Steps to Automate the Experiment

    • Examples.xlsx contains information to automate the tests.
    • Change columns B, F, G, H and I to the values you want and save the file.
    • Check if any device has a new IP that is not already configured in the 7 json profiles in tcconfigprofiles directory, then,
      1. Open addnewip.js file and change new_ip variable to the new IP that you want to add.
      2. Run the file using node addnewip.js, and the IP should be added to all 7 profiles.
    • Finally run the testAutomater.js file using node testAutomater.js, and the experiment should start for the duration specified per row in the Examples.xlsx file.

About

Server Module which tests efficiency of a SmartWatch using traffic shaping and MQTT.

Resources

Stars

Watchers

Forks

Packages

No packages published