This tutorial will guide you through the process of setting up a station using the Balena Community Application ( or Balena MT Station ) on a Raspberry Pi (3B+, 4, or 5) with an RTL-SDR and a generic wideband RF or VHF antenna.
Requirements
Hardware
Raspberry Pi 3B+, 4, or 5
RTL-SDR dongle
Generic wideband RF or VHF antenna ( we are using COMAR antenna)
MicroSD card (at least 8GB)
Power supply for Raspberry Pi
Internet connection (Wi-Fi or Ethernet)
an RTL-SDR USB dongle
Software
Balena CLI (Command Line Interface) (optional) GitHub - balena-io/balena-cli: The official balena CLI tool.
git (optional) Git
Balena Etcher balenaEtcher - Flash OS images to SD cards & USB drives
Step 1: Login/Register to MarineTraffic
b. Fill the form
Step 2: Setup Balena Fleet and Application
Login/Register
Go to the The container-based platform for deploying IoT fleets - Balena and register/login
Setup your fleet
Go to balenaHub - IoT embedded device apps, edge computing resources, and developer tools the Balena Hub page for our MT Station application
Press the Deploy to Balena Button to create a fleet with the application as the main release
Or Go to the GitHub page of the application and read the instructions for using BalenaCLI and git to set up and deploy manually the application to your fleet
GitHub - Kpler/iot-balena-ais-station: Balena Community Application for the AIS Station
Step 2A: Pre-Configure Fleet ( Deploy by pressing Balena Button)
Pressing the Deploy button will open a modal. There you can pre-configure the fleet
Fill out the Fleet environment variables with the IP and Port provided in the confirmation email and don’t forget to change the value of
RESIN_HOST_CONFIG_enable_uart
to 1
Step 2B: Configure Fleet ( Manual Deployment)
Log in to Balena Dashboard:
Go to the Balena Dashboard and login to your account.
Go to your fleet
On the side-bar click Variables
Add the variables necessary for the application to broadcast data to MarineTraffic ( IP and Port from the confirmation email ( you can specify in which service these variables are to be applied - the service that is responsible for broadcasting data is broadcast service )
From the side-bar click on Configuration and enable UART for your devices
Deploy the application to your fleet
Follow the instructions for manually deploying the application to your fleet GitHub - Kpler/iot-balena-ais-station: Balena Community Application for the AIS Station
Step 4: Setup Device
Add device:
Flash the downloaded image to an SD card using balenaEtcher
Insert the SD card into your Raspberry Pi and power it on
Verify Device Connectivity
Step 5: Verify the Setup
Access the Logs:
Check AIS Data:
You can configure the logs output to be more verbose and to print the input received from the antenna. You can choose both or just one of the services to be verbose on the Services drop-down menu
You should see some of the data arriving on the rtl-sdr service and the valid NMEA data the broadcast service sends to MarineTraffic.
If you are using the rtl-sdr service you may want to see the decoded NMEA data coming from the dongle. You can achieve that by configuring your device and adding a variable( or setting this fleet-wise ). By adding the variableVERBOSE=true
you can later see the logs' output of rtl-sdr service all the decode NMEA messages
Check your Station Detail Page:
Conclusion
You have successfully set up a station using the Balena MT application on a Raspberry Pi. Your station is now capable of receiving, processing, and broadcasting to MarineTraffic AIS data