Table of Contents
WiFiMon Hardware Probes (WHP's) are used to gather performance measurements in a WiFi network from dedicated small form factor devices which are installed in fixed points. WiFiMon tested its operation and recommends the use of Raspberry Pi’s v3 Model B+ or v4. WiFiMon Hardware Probe will work in the following configuration:
- A Raspberry Pi 3 Model B+ or a newer model
- A micro SD card with at least 16GB
- WiFiMon Raspberry Pi operating system image (Installation option 1) or Raspberry Pi with installed Raspberry Pi OS (Installation option 2)
Setting up the WHP
There are two options for the WHP installation:
- Installation and configuration from the prepared WiFiMon WHP image (Installation option 1)
- Installation and configuration on the Raspberry Pi with already installed Raspberry Pi OS (Stretch or later) (Installation option 2)
Installation and configuration
The following steps apply for both installation options. WiFiMon administrators who will use the prepared WHP image (installation option 1) should simply edit the crontab and wireless.py and twping_parser.py files as discussed in the following. WiFiMon administrators who will not use the prepared WIFiMon WHP image (installation option 2) should follow the steps 2 up to 5.
Step 1: Write the image to the micro SD card
Follow the instructions at the official Raspberry Pi site. Skip the "Download the image" step and use the WiFiMon Raspberry Pi operating system image instead (download size is approx. 3 GB).
WiFiMon Raspberry Pi image given above is a custom version of Raspberry Pi OS (Buster) with desktop, with the default Raspberry Pi credentials (user: pi, password: raspberry).
We advise the WiFiMon administrator to always secure Raspberry Pi by changing the default password.
Step 2: Start the Raspberry Pi
Follow the simple steps below:
- Insert the microSD in the Raspberry Pi
- Plug the USB keyboard into one of the USB ports (or USB wireless adapter for keyboard and mouse)
- Plug the USB mouse into one of the USB ports
- Connect the monitor cable to the Pi's HDMI port
- Plug the power supply into a socket and connect it to the micro USB power port
You should see a red light on the Raspberry Pi and raspberries on the monitor. The WiFiMon Hardware Probe will boot up into a graphical desktop.
Step 3: Configure the Raspberry Pi
Secure the Raspberry Pi by changing the default password. Optionally, you may enable SSH to access the command line of a Raspberry Pi remotely or setup remote desktop. Next, you have to connect to the wireless network you want to measure.
First, the following programs should be downloaded:
|
The WiFiMon Hardware Probe (WHP) performs performance tests towards the WiFiMon Test Server (WTS) in an automated manner. It uses crontab to schedule the tests. To do that, open the terminal (as user "pi") and enter the command: crontab -e. You will have to pick the text editor that you prefer. Then scroll to the bottom of the file and add the following code block (which you will modify as explained below):
|
You have to modify the following parts of the crontab in lines 2-4:
- URL_TO_nettest
- URL_TO_speedworker
- URL_TO_boomerang
You should put the URL or IP address of the WTS in which the NetTest, LibreSpeed Speedtest and Akamai Boomerang JS scripts are injected. Details about the configuration of the WiFiMon testtools are included in the WiFiMon Test Server (WTS) installation documentation. Following the assumptions/notations of the WTS guide, examples of the URLs for NetTest, speedtest and boomerang respectively are (i) https://WTS_FQDN/wifimon/measurements/nettest.html, (ii) https://WTS_FQDN/wifimon/measurements/speedworker.html and (iii) https://WTS_FQDN/wifimon/measurements/boomerang.html.
Furthermore, open the terminal (as user "root") and enter the command: crontab -e. Add the following lines:
|
Line 1 of the crontab is related to the streaming of wireless network interface metrics and system metrics to the WiFiMon Analysis Server (WAS). Optionally, the intervals of the WHP measurements could be altered by appropriately configuring the crontab so that measurement are more or less frequent. The configuration of the crontab given above sets up 10-minute intervals between the measurements of each test tool in a way in which there are no overlapping measurements.
Line 2 of the crontab is related to the streaming of TWAMP measurement results to the WiFiMon Analysis Server (WAS).
Step 4: Streaming Wireless Network Interface Metrics to the WiFiMon Analysis Server (WAS)
In /home/pi, you will find the Python script wireless.py. The contents of the script are the following:
wireless.py
1 |
|
The following values should be set:
- "probe_no" (line 145) should match the number assigned to the testtools of the particular WiFiMon Hardware Probe (WHP), e.g. for the WHP assigned the number 1, the value should be "1". Assigning numbers to WHPs is possible by appropriately setting the testtool attribute included in the websites monitored by them. More information related to assigning number to WHPs is available in the WiFiMon Test Server installation guide.
- "WAS_FQDN" (line 128) should match the FQDN of the WiFiMon Analysis Server (WAS) responsible for processing the wireless performance metrics of the WHP. The above code block assumes that the WAS uses https and port 443.
- LInes 133 to 135 can be filled with more information regarding the location of the WHP.
For the disk and memory statistics, you need to install iostat and vmstat packages with the following command:
|
Step 5: Streaming TWAMP Measurement Results to the WiFiMon Analysis Server (WAS)
In /home/pi, you will find the Python script twping_parser.py. The contents of the script are the following:
twping_parser.py
1 |
|
The following values should be set:
- "PROBE_NO" (line 171) should match the number assigned to the testtools of the particular WiFiMon Hardware Probe (WHP), e.g. for the WHP assigned the number 1, the value should be "1". Assigning numbers to WHPs is possible by appropriately setting the testtool attribute included in the websites monitored by them. More information related to assigning number to WHPs is available in the WiFiMon Test Server installation guide.
- "WAS_FQDN" (line 164) should match the FQDN of the WiFiMon Analysis Server (WAS) responsible for processing the TWAMP measurement results of the WHP. The above code block assumes that the WAS uses HTTPS and port 443.
- "TWAMP_SERVER_FQDN" (line 173): Should be filled with the FQDN of the TWAMP Server.
For the above script to work, you need to install perfsonar-tools from the perfSONAR repository. The installation process is detail in the following link. In the sequel we summarize the necessary installation steps:
|
Security Issues
We suggest that you take additional efforts to safeguard the security of your probes:
- Set the password for the "pi" user and the "root" user of the WiFiMon Hardware Probe.
- Disable auto-login to the WiFiMon Hardware Probe. Open the terminal and type "sudo raspi-config". Then, from the third line "Boot Options", select "B1. Desktop / CLI" and then "B3. Desktop".
- When connecting to your Wi-Fi network, your password will be stored as plaintext to the file "/etc/wpa_supplicant/wpa_supplicant.conf". Use the following commands to hash your ESSID and password:
|
A "psk=....." line will be generated. Add this line in /etc/wpa_supplicant/wpa_supplicant.conf under your ESSID and delete the plaintext password.
- Default user "pi" comes with sudo privileges. You can remove them with the following commands from the "root" user:
|
- Convert the privileges of the "/etc/wpa_supplicant/wpa_supplicant.conf" to "600".
- You may configure a firewall to further protect your device.