I have had the opportunity to be part of NUS Information Technology as an intern and was tasked to develop a greenfield project prototype together with my colleague, and I hope to share what I’ve learned and experienced throughout my internship journey.

This article is meant to document my journey as an aspiring software developer and to reflect on the things I’ve learned throughout my internship, hence there might be bad practices in how the system is engineered, as such I’d love any feedbacks given to me :D

**The idea of the project was to first build an automated sensor capable of connecting/disconnecting to different ****access points **around NUS and test the signal of the access points by capturing data points such as RSSI and gateway ping response time 24/7 around the clock. The data collected by the sensor would be sent to a remote database server. Thereafter, it would be pulled into a back-end web server and streamed into a user-friendly frontend web dashboard.

The major milestones for the prototype are as follows:

Let us first start with the development of the automated script to collect NUS Wi-Fi data. The aim here is to develop an automated script that would allow the sensor to connect to a nearby access point, perform a series of tests to acquire the ping responses, and disconnect from it. This process would then be performed repeatedly against different access points near the sensor to measure the Wi-Fi strength of the access points around campus.

Now onto the scripting language and the hardware used. I used python2.7 as the scripting language since it has many open-source networking libraries available and the syntax is relatively straightforward to implement and to develop in. The hardware to be used as the sensor is the Raspberry Pi B+ model, as it supports Wi-Fi of radiofrequency of 2.4GHz and 5GHz. Furthermore, it acts as an inexpensive minicomputer with a lovable Linux flavored OS(Raspbian OS), allowing us to SSH in and out and execute our scripts with ease.

I initially thought that the development of the script would be pretty straightforward, but it turned out to be one of the most frustrating yet fulfilling parts of the project. The original idea to automate the connection was to re-write the wpa_supplicant file within the raspberry pi sensor, restart the network service so that the connection is refreshed, and the result would be that the raspberry pi is connected to a specific access point via the BSSID assigned. Subsequently, I just have to write out a series of functions to test the signal of the access point and store the data into a database.

However_, I was met with a slight problem_, NUS Wi-Fi is EAP-PEAP authenticated and the wpa_supplicant file seems to only support deprecated EAP authentication.

I would have to find a way to automate the connection of NUS Wi-Fi via raspberry pi. After some googling, I found the network manager and the packages required to install it on a raspberry pi. Next, I went on a series of google search for a library that would allow me to automate the connection of the network manager in a script.

After digging through several google links, I found python-networkmanager, a python library that, though lacking in documentation, would nonetheless be a perfect fit for what I intended to do. Here is a snippet of the script I used to automate an EAP authenticated network.

#full-stack #technology #raspberry-pi #computer-network #react

Building an automated Wi-Fi sensor around the NUS campus.
1.40 GEEK