2 Configuration
This chapter configures the Pi for data collection. You will update the system, set up a file server for easy data transfer, connect to cloud storage for remote monitoring, and install the capture scripts.
2.1 System Setup
Start by updating the operating system to ensure all packages are current:
sudo apt-get update -y && sudo apt-get upgrade -yClick the copy icon next to code blocks. If Ctrl+V doesn’t work, try Ctrl+Shift+V or right-click.
Restart the Pi to apply the updates, reconnect via SSH, then enter superuser mode for the remaining configuration tasks:
sudo rebootsudo su2.2 File Server
Samba enables file sharing between the Pi and your computer over the network (Ethernet or your mobile hotspot). Once configured, you can drag and drop files directly through your file explorer.
Install and Configure
Install Samba and its dependencies:
sudo apt-get install -y -q samba samba-common-bin
Open the configuration file to define the shared folder:
sudo nano /etc/samba/smb.confMove to the end of the file with Alt + / and add the following block:
[share]
path = /home/pi
writeable=Yes
create mask=0777
directory mask=0777
public=no
Save with Ctrl + X, then Y, then Enter.
Set a password for the share. Enter raspberry when prompted:
sudo smbpasswd -a piRestart both Samba services to apply the changes:
sudo service smbd restart && sudo service nmbd restartTest the Connection
On your computer, open File Explorer (Win + E) and navigate to \\raspberrypi\share. Enter the Pi’s username and password when prompted.
Create a test file on the Pi:
sudo nano test.txtType any text, save the file, and verify it appears in your File Explorer.
2.3 Cloud Storage
Cloud storage lets you check a deployed sensor’s status from anywhere. The Pi uploads status updates to Dropbox, which you can view from any device without being on the same network.
Create a Dropbox App
Go to the Dropbox developer page, sign in, and create a new application.

Enable all file permissions under the individual scope.

Install the Uploader
Install the required packages and clone the Dropbox Uploader repository:
sudo apt install curl git -y
git clone https://github.com/andreafabrizi/Dropbox-Uploader.gitNavigate to the directory and make the script executable:
cd Dropbox-Uploader && sudo chmod +x dropbox_uploader.shRun the script to begin authentication:
./dropbox_uploader.shEnter your app key and app secret when prompted.

Open the provided URL in a browser and click Allow to authorize the app.

Copy the access code and paste it back into the terminal.

Verify Access
Test the connection by uploading a file to your Dropbox:
./dropbox_uploader.sh upload README.md /The file should appear in your Dropbox app folder.
Return to the home directory before continuing:
cd /home/pi2.4 Capture Scripts
The capture scripts handle WiFi packet collection. Clone the repository from GitHub:
cd /home/pi
git clone <capture-scripts-repository-URL> # link anonymized for reviewInstall Packages
Navigate to the repository and run the package installation script:
cd /home/pi/capture-scripts
bash packages.shSet the Sensor Name
Each sensor needs a unique name for identification in your data. Run the naming script and enter a name when prompted:
bash name.shThe name is stored in sensor_name.conf. If skipped, the default raspberrypi is used.
Configure Network Interfaces
Check the current network interface assignment with ifconfig. The internal WiFi adapter should be wlan0. At this stage only wlan0 appears; external adapters receive names like wlan1 and wlan2 once inserted in the next chapter.
ifconfig
Run the environment script to ensure consistent interface naming at boot:
bash envr.sh