fiwi_monitor/BUILD_PI5.md

104 lines
1.8 KiB
Markdown

# Building on Raspberry Pi 5
This guide covers building the wireless monitor tool on Raspberry Pi 5 running Raspberry Pi OS (Debian-based).
## Prerequisites
### Install Build Tools and Dependencies
```bash
# Update package list
sudo apt-get update
# Install build essentials and autotools
sudo apt-get install -y \
build-essential \
autoconf \
automake \
libtool \
pkg-config
# Install WiFi monitoring libraries
sudo apt-get install -y \
libpcap-dev \
libnl-genl-3-dev \
libnl-3-dev
```
## Building
```bash
cd wireless-monitor-template
# Generate configure script
./autogen.sh
# Configure build
./configure
# Build
make
# Test (as root - required for monitor mode)
sudo ./src/wireless_monitor wlan0 11
```
## Installation (Optional)
```bash
# Install system-wide
sudo make install
# Then run from anywhere
sudo wireless_monitor wlan0 11
```
## Troubleshooting
### Missing autotools
If `autogen.sh` fails:
```bash
sudo apt-get install autoconf automake libtool
```
### Missing pkg-config
If configure fails to find libraries:
```bash
sudo apt-get install pkg-config
```
### Library Not Found
If you get linker errors:
```bash
# Verify libraries are installed
pkg-config --exists libpcap && echo "libpcap OK" || echo "libpcap missing"
pkg-config --exists libnl-genl-3.0 && echo "libnl-genl OK" || echo "libnl-genl missing"
pkg-config --exists libnl-3.0 && echo "libnl-3 OK" || echo "libnl-3 missing"
```
### Monitor Mode Permission Denied
Must run as root:
```bash
sudo ./src/wireless_monitor wlan0 11
```
## Cross-Compilation (from Linux PC)
If you want to cross-compile from a Linux PC:
```bash
# Install cross-compiler
sudo apt-get install gcc-aarch64-linux-gnu
# Configure for cross-compilation
./autogen.sh
./configure --host=aarch64-linux-gnu \
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
make
```