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 a 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
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. You need to switch the "Advanced" options and set them as follows:
RESIN_HOST_CONFIG_enable_uart - set to 1
STATION_ID - paste it from the confirmation email
Press "+" to add variable:
TOKEN - paste it from the confirmation email
Tip: You can alter variables later on if necessary.β
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
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