Skip to main content
All CollectionsAIS Network for Station OwnersTutorials
Tutorial for RPI + RTL-SDR + VHF/RF Antennas
Tutorial for RPI + RTL-SDR + VHF/RF Antennas

Setting Up a AIS Station with Balena Community Application on Raspberry Pi 3B+/4/5

L
Written by Laura-Monica Voicu
Updated today

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

Step 1: Login/Register to MarineTraffic

  1. Become a contributor or add an existing station

    1. Go to My Account ---> My Stations

b. Fill the form

  1. Get the confirmation email with the information


Step 2: Setup Balena Fleet and Application

  1. Login/Register

  2. Setup your fleet

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)

  1. Log in to Balena Dashboard:

  2. 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

  3. Deploy the application to your fleet

    1. 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

  1. Add device:

    • Inside your new fleet, click Add device

    • Select the appropriate device type (e.g., Raspberry Pi 4)

    • Choose BalenaOS Version (the latest recommended version)

    • Select Network Connection (Ethernet or Wi-Fi):

      • If using Wi-Fi, enter your SSID and password

    • Click Download balenaOS

  2. Flash the downloaded image to an SD card using balenaEtcher

  3. Insert the SD card into your Raspberry Pi and power it on

  4. Verify Device Connectivity

    • Wait for the device to appear in your fleet on BalenaCloud

    • Ensure it shows Online before proceeding.

Step 5: Verify the Setup

  1. Access the Logs:

    • In the Balena Dashboard, navigate to your device and check the logs to ensure that the application is running correctly.

  2. 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 variable

      VERBOSE=true

      you can later see the logs' output of rtl-sdr service all the decode NMEA messages

  3. Check your Station Detail Page:

    • Visit the MarineTraffic Station Details by clicking on My Account---> My Stations and clicking your new Station. Once on your Station Detail Page, you should check its name and if the new station is receiving any data

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

Did this answer your question?