Skip to main content
All CollectionsAIS Network for Station OwnersTutorials
Tutorial for RPI + dAISy hat + VHF/RF Antennas
Tutorial for RPI + dAISy hat + VHF/RF Antennas

Setting Up a dAISy 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 a dAISy HAT and a generic wideband RF or VHF antenna.

Requirements

Hardware

  • Raspberry Pi 3B+, 4, or 5

    rpi3_4.png
  • dAISy HAT

    daisyHat.png
  • Generic wideband RF or VHF antenna ( we are using COMAR antenna)

    comar_anntena_full.png

    Open

    comar_antenna.png

  • 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

    a. 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 serial-input and the valid NMEA data the broadcast service sends to MarineTraffic.

  3. Possible error in serial input

    • RPI 4 may need to be configured to use a different Serial port than the default one. If you see in the logs the error from the serial-input service that

      Error on serial /dev/ttyXXX: No such file or directory cannot open…….

      there is a misconfiguration in the application.


      So you need to add a device variable to set the SERIAL environment variable to be

      /dev/ttyS0

      or in any serial port, you are sending the output of the dAISy hat. When the changes are applied you should see that the service is opening the correct serial port without an error

  4. 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?