Pocket network diagnostic tool that displays LLDP/CDP switch data using a Raspberry Pi Zero 2 W, a PoE HAT, and an E-Paper display.
Inspired by the functionality of commercial network port identification tools used by field technicians.
This project is a pocket-sized network diagnostic tool designed to quickly identify switch port information such as hostname, IP address, port number, VLAN, and voice VLAN using LLDP/CDP.
The device runs on a Raspberry Pi Zero 2 W and displays results on an e-Paper display, making it useful for technicians deploying or troubleshooting network equipment in the field.
Commercial network diagnostic tools that provide quick switch port identification can be expensive. This project explores how a small Linux-based device can extract useful switch information using LLDP/CDP and display it on a low-power screen.
The goal was to build a simple, practical tool using inexpensive and widely available hardware.
- Runs on Raspberry Pi Zero 2 W
- Detects switch hostname
- Detects switch IP address
- Identifies switch port
- Displays access VLAN
- Displays voice VLAN
- Low power E-Paper display
- Fast boot and automatic detection
- Powered by PoE via a PoE HAT or a USB power bank
SW: SWITCH-01
IP: 10.10.1.2
PORT: Gi1/0/24
VLAN: 120
VOICE: 130
- Raspberry Pi Zero 2 W
- 40-pin male GPIO Header
- Waveshare 2.13" E-Paper HAT+ display (SKU 27467)
- Waveshare PoE Ethernet / USB HUB BOX (SKU 20895)
- Raspberry Pi OS
- Python
- LLDP/CDP parsing
- Waveshare EPD drivers
- systemd service for automatic startup
Connect the device to an Ethernet cable connected to an active switch.
If PoE is enabled on the port, the device powers on automatically. If PoE is not available, the device can be powered using an external power source such as a USB power bank.
Once powered on, the Raspberry Pi boots into Raspberry Pi OS. A systemd service automatically launches the Python script which listens for LLDP/CDP packets transmitted by the switch.
The script extracts relevant switch information such as hostname, IP address, port number, VLAN, and voice VLAN. The data is then formatted and displayed on the e-Paper screen.
-
Flash Raspberry Pi OS to the SD card using Raspberry Pi Imager.
-
Boot the Raspberry Pi and update the system:
sudo apt update
sudo apt upgrade -y- Install required packages:
sudo apt -y install git lldpd python3 python3-pip python3-pil python3-lgpio python3-rpi.gpio- Enable SPI (required for the E-Paper display):
sudo raspi-configNavigate to: Interface Options -> SPI -> Enable
- Reboot the device
sudo reboot- Configure lldpd for CDP and receive-only mode:
sudo nano /etc/default/lldpdSet:
DAEMON_ARGS="-r -c"
LLDPD_OPTIONS=""- Restart lldpd:
sudo systemctl restart lldpd- Clone the RaspberryFluke repository into /opt:
sudo rm -rf /opt/raspberryfluke
sudo git clone https://github.com/MKWB/RaspberryFluke.git /opt/raspberryfluke
sudo chown -R root:root /opt/raspberryfluke- Clone the Waveshare repository:
cd ~
git clone https://github.com/waveshare/e-Paper.git- Copy the waveshare_epd library into /opt/raspberryfluke:
sudo cp -r ~/e-Paper/RaspberryPi_JetsonNano/python/lib/waveshare_epd /opt/raspberryfluke/- Make the script executable:
sudo chmod 755 /opt/raspberryfluke/raspberryfluke.py- Install the System Service File
sudo cp /opt/raspberryfluke/raspberryfluke.service /etc/systemd/system/- Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable raspberryfluke.service
sudo systemctl start raspberryfluke.service- Verify the service is running:
sudo systemctl status raspberryfluke.serviceThe RaspberryFluke script will now run automatically each time the device boots.