This repository is a landing station in the AirPost drone-delivery system: the physical helipad a drone takes off from and lands on, made "smart" by a Raspberry Pi and a handful of sensors.
A station is a small always-on IoT device sitting under a helipad with an AprilTag marker. Its job is to make the pad known, safe, and landable at any time:
- Knows where it is — a GPS module reports the pad's exact coordinates, so the backend can route drones to it (no hardcoded map).
- Knows its condition — temperature, humidity and a light sensor report the pad's environment.
- Stays landable at night — when the light sensor reads "dark", the station turns on a pad LED (lamp) so the drone's downward camera can still see the AprilTag and precision-land. This is the station's key trick: vision landing needs light, so the pad provides its own.
- Checks clearance — a Pi camera can verify the landing space is clear.
AirPost_Station (Raspberry Pi)
├─ GPS, temp, humidity, light ──MQTT──► Sink ──► Kafka ──► backend (map + dashboards)
└─ light sensor "dark?" ──► turn ON pad LED ──► drone camera can read the AprilTag at night
The station continuously publishes its sensors over MQTT; the Sink forwards them to Kafka, and the backend stores/charts them and shows the station on the live map. The night-lamp rule is driven by the light reading (locally and/or via the backend's logic engine).
In the simulation,
station_iot.pyplays this exact role: each station self-registers with the backend and streams GPS/temp/humidity/ light, raising a virtual pad lamp in the dark — so the simulated world behaves like these real boards.
The rest of this README is the hardware list and the Raspberry-Pi bring-up (wiring and installing the GPS, camera, DHT11, light sensor, LED, and the MQTT client).
- Raspberry Pi
-
USB-Port-GPS Module SKU:EZ-0048
To specify station coordination through gps.
-
Raspberry Pi Camera Module V2
To measure cleaerence of landing space
-
DHT11 Temperature, Humid Sensor
To measure status of landing space.
-
Light Sensor
To measure light value of landing space. Sensor value used for actuating LED to ensure landing space visibility at night.
-
MQTT
Between sink node server and station
-
GPIO
Between companion computer and sensors
-
Run
- type following command
python3 run.py
- type following command
-
Packages
-
GPS
-
Preparing
-
install packages for GPS module.
sudo apt-get update && sudo apt-get -y install gpsd gpsd-clients python-gpspip3 install gps -
Start the gpsd service and control it.
Enable it:
sudo systemctl enable gpsd.socketStart it:
sudo systemctl start gpsd.socketRestart it:
sudo systemctl restart gpsd.socketCheck status:
sudo systemctl status gpsd.socket -
Modify the configuration file of gpsd in /etc/default/gpsd Modify the "DEVICE" parameter according to the name of serial port in /dev folder. It is usually named "/dev/ttyUSB0" if you connect it to Raspberry Pi via USB cable. You can use "nano" or "vim.tiny" editor to finish it.
-
Restart service:
sudo systemctl restart gpsd.socketFinally, use this command to get information from GPS module.
sudo cgps -s
-
-
-
Camera
-
Preparing
- Camset
- enable rasberry pi camera in
sudo raspi-config sudo vim /etc/modulesand addbcm2835-v4l2below
- enable rasberry pi camera in
-
opencv-python
-
install dependent packages
-
sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install build-essential cmake pkg-config -y sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng-dev -y sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y sudo apt-get install libxvidcore-dev libx264-dev -y sudo apt-get install libfontconfig1-dev libcairo2-dev -y sudo apt-get install libgdk-pixbuf2.0-dev libpango1.0-dev -y sudo apt-get install libgtk2.0-dev libgtk-3-dev -y sudo apt-get install libatlas-base-dev gfortran -y sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103 -y sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5 -y sudo apt-get install python3-dev -y -
install opencv-python with pip3
sudo pip install opencv-contrib-python==4.1.0.25
-
-
cd Requirements/apriltag cmake . sudo make install -
other packages
pip install Cython pip install --upgrade imutils # Update pip python -m pip install -U pip # Install scikit-image python -m pip install -U scikit-image
- Camset
-
Preparing
-
py-spidev
cd py-spidev/ sudo python setup.py install
-
-
-
TempHumid Sensor
-
Prepareing
-
Adafruit_DHT
sudo python3 -m pip install --upgrade pip setuptools wheel sudo pip3 install Adafruit_DHT -
python board package
pip3 install board
-
-
-
MQTT client
-
mosquitto-client python
sudo apt-get install build-essential libc-ares-dev uuid-dev libssl-dev libcurl4-openssl-dev libmysqlclient-dev sudo apt-get install mosquitto-clients pip3 install paho-mqtt
-
