Code Monkey home page Code Monkey logo

jvde-github / ais-catcher-for-android Goto Github PK

View Code? Open in Web Editor NEW
90.0 5.0 7.0 1.4 MB

Android AIS receiver for RTL SDR dongles, Airspy R2, Airspy Mini, Airspy HF+ and TCP (RTL-TCP and SpyServer). Output is send via UDP and visualized on the built-in map

License: GNU General Public License v3.0

Java 74.80% CMake 4.52% C++ 20.68%
airspy airspyhf ais ais-receiver android android-app automatic-identification-system marine maritime rtl-sdr spyserver odroid

ais-catcher-for-android's Introduction

AIS-catcher for Android - A multi-platform AIS receiver

This Android App helps to change your Android device into a dual channel AIS receiver that can be used to pick up AIS signals from nearby vessels, even if offline! The App directly accesses a Software Defined Radio USB device, like a RTL-SDR dongle or an AirSpy decvice. Received vessels are visualized on the built-in map or messages are sent via UDP to plotting Apps like Boat Beacon or OpenCPN. A lightweight AIS receiver system when travelling. AIS-catcher for Android has been tested on an Odroid running Android.

An impression of AIS-catcher on the beach on a Galaxy Note 20 in July 2023 (thanks and credit: Roger G7RUH)

Here you can find a link to the APK file for latest Edge version or visit the Google Play Store. The engine and visualizations are based on AIS-catcher.

AIS-catcher had a recent overhaul. The instructions below still are relevant but the visualization of the results is now based on the same code as the AIS-catcher web interface. The instructions will be updated in due course.

     
     

The requirements to receive AIS signals are: a RTL-SDR dongle (or alternatively an AirSpy Mini/R2/HF+), a simple antenna, an Android device with USB connector and an OTG cable to connect the dongle with your Android device. AIS-catcher only receives and processes signals and then forwards the messages over UDP or visualizes them on the build-in map (internet connection required). And one more thing, you need to be in a region where there are ships broadcasting AIS signals, e.g. near the water.

What's New?

  • Improved functionality if offline (map tiles only to the extent cached by previous usage)
  • Fireworks mode for map, have a look!
  • APK for latest version always available for download, see below
  • Support for RTL-SDR Blog V4
  • Tab with realtime NMEA lines as it is received

Purpose and Disclaimer

AIS-catcher for Android is created for research and educational purposes under the GPL license. This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions. For details see the project page.

It is a hobby project and not tested and designed for reliability and correctness. You can play with the software but it is the user's responsibility to use it prudently. So, DO NOT rely upon this software in any way including for navigation and/or safety of life or property purposes. There are variations in the legislation concerning radio reception in the different administrations around the world. It is your responsibility to determine whether or not your local administration permits the reception and handling of AIS messages from ships and you can have this App on your phone. It is specifically forbidden to use this software for any illegal purpose whatsoever. The software is intended for use only in those regions where such use is permitted.

Installation and Download

You can download AIS-catcher-for-Android in the Release section in the form of an APK-file. There are various resources on how to install an APK file available on the web.

Some Android manufacturers prefer battery life over proper functionality of Apps which might be particular relevant for a SDR AIS receiver. You can find tips for various devices at https://dontkillmyapp.com/.

For a video of a field test of an early version see YouTube. Below we have included a Getting Started tutorial when running with a RTL-SDR dongle. The steps for the AirSpy and TCP connections are very similar. Please notice that your phone or tablet has to power the USB device and run the decoding algorithm and this will be a drain on your battery. When sending UDP NMEA lines over the network or decoding from TCP (SpyServer or RTL-TCP) this will require serious network traffic. Advice is to do this when connected via WiFi. Finally, the computationally intensive nature of AIS decoding requires the phone to give the Application sufficient run time. On some phones Android might restrict this and some tuning of the phone settings might be required.

Tutorial: Getting Started

1. Getting around: the main screen

The main screen of AIS-catcher is as follows:

The tabs section at the top provides access to the main statistics and information when AIS-catcher is running whereas the bottom navigation bar has the buttons to start/stop the receiver, clear the logs/statistics and select the source device you want to use for reception.

2. Configuring the connection with OpenCPN and/or BoatBeacon

AIS-catcher is a simple receiver that decodes messages and can send the messages from ships onward to specialized plotting apps via UDP. In this step we are going to set up the outward connections to BoatBeacon and OpenCPN. For this we will use port 10110 for BoatBeacon and 10111 for OpenCPN. Press the 3 vertical dots on the top right and select the Setting option. Scroll to the bottom and activate the two UDP output connections via the switch and set the parameters as follows:

3. Setting up the Connection on OpenCPN

Next we start OpenCPN and click on Options (top left icon) and choose the Connections tab. We need to add a Network connection using UDP at address 0.0.0.0 dataport 10111. You could initially select Show NMEA Debug Window as extra option which will give you a window in OpenCPN that shows all incoming NMEA messages it receives from AIS-catcher. This could be helpful debugging a connection issue between the receiver and OpenCPN. The Connections tab will look something like:

4. Granting AIS-catcher access to the USB dongle

Next we connect AIS-catcher to the RTL-SDR dongle. By default the user needs to give applications the rights to use a USB device. For this connect the dongle with your Android device using the OTG cable (if needed) and, if all is well, you should be asked if AIS-catcher can get access. With Dutch language settings (sorry) this should look like:

Accept the request and consider giving AIS-catcher permanent access to the device so this step can be skipped in the future.

5. Configuring the RTL-SDR dongle

Next go back to the Settings menu via the 3 vertical dots on the main screen and set up the RTL-SDR settings:

These settings should be ok but don't forget to set the frequency correction in PPM if needed for your device. You can set the dongle settings at any point in time but they will only become active when a new run is started.

6. Selecting the input source

In the Main screen select the Source by clicking the right-most item in the bottom navigation bar. Select the RTL-SDR device:

The bottom navigation bar should show which device is currently active and will be used for AIS reception.

7. Running AIS-catcher

In the main screen now click Start on the left in the bottom navigation bar. This starts the run and a notification is given that a foreground service is started. The navigation tabs allow you to see different statistics during the run (like message count (STAT), messages from the receiver (LOG) and received NMEA lines (NMEA) ).

AIS-catcher will run as a foreground service so the app will continue to receive messages when closed. That's all there is to it. Have fun!

Credits

AIS-catcher for Android uses the following libraries:

libusb-1.0.26+: https://github.com/libusb/libusb

libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD, Haiku and Solaris userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).

rtl-sdr: https://github.com/osmocom/rtl-sdr

Turns your Realtek RTL2832 based DVB dongle into a SDR receiver. Licensed under the GPL-2.0 license. Modified for Android to open devices with file descriptors: https://github.com/jvde-github/rtl-sdr.

airspyhf: https://github.com/airspy/airspyhf

This repository contains host software (Linux/Windows) for Airspy HF+, a high performance software defined radio for the HF and VHF bands. Licensed under the BSD-3-Clause license. Modified for Android to open devices with file descriptors: https://github.com/jvde-github/airspyhf.

airspyone_host: https://github.com/airspy/airspyone_host

AirSpy usemode driver and associated tools. Modified for file descriptors here: https://github.com/jvde-github/airspyone_host.

AIS-catcher: https://github.com/jvde-github/AIS-catcher

AIS receiver for RTL SDR dongles, Airspy R2, Airspy Mini, Airspy HF+, HackRF and SDRplay. Licensed under the GPGL license.

Privacy Policy

At the moment we don't collect any user data. This policy will vary per version so please check this policy for each release.

To do

  • More testing....
  • Application crashes when USB device is unplugged whilst in the source selection menu
  • Application should automatically switch to SDR source if not playing and device connected
  • Application crashes when AirSpy HF+ is disconnected (seems to be a more general issue) Solved.
  • Shorter timeouts when connecting to RTL-TCP
  • WiFi-only check in case: RTL-TCP streaming or UDP NMEA broadcast to other machines
  • Wakelocks and WiFi performance settings, etc...
  • Add sync locks for updates
  • Count buffer under- and over-runs
  • Simple map - radar view
  • Simple graphs with statistics
  • Start button not properly reset when receiver stops due to timeout?

ais-catcher-for-android's People

Contributors

jvde-github avatar xlv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ais-catcher-for-android's Issues

RTLTCP possible error on Pi

Jasper,

I have the following on my Pi screen while runninl rtl_tcp. I saw it yesterday, briefly too. Is it indicating a problem? Is it a sample overload type issue as I am using 2304 rate?

Use the device argument 'rtl_tcp=172.27.0.45:12345' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).
client accepted! 172.27.0.57 43310
Allocating 15 zero-copy buffers
set freq correction 0
set gain mode 1
set gain 240
set sample rate 2304000
set freq 162000000
ll+, now 1
ll+, now 2
ll+, now 3
ll+, now 4
ll+, now 5
ll+, now 6
ll+, now 7
ll+, now 8
ll+, now 9
ll+, now 10
ll+, now 11
ll+, now 12
ll+, now 13
ll+, now 14
ll-, now 0
ll+, now 1
ll+, now 2
ll-, now 0
ll+, now 1
ll+, now 2
ll+, now 3
ll+, now 4

use web browser like AIS-catcher main app

Jasper

I have loaded the ap and tested with an RTL-SDR dongle. Rather than use another app to view the data, is it possible to have the web server functionality from AIS-catcher added to the Android version?

If so, will it be possible to use the device GPS to provide location data for the web server map?

It would make it a "one stop shop" for AIS-catcher when mobile.

Thanks

Roger G7RUH

APP still available?

Sorry, but I am just tried to pick up the app in Play Store by searching "ais catcher". But no success so far. Finding apps like MarineTraffic, RTL SDR AIS Driver and other.

AIS-catcher-for-Android stops receiving

I have a no name rtl dongle.
When I start I get 20 to 60 Messages, and than it stops.
Even when I start the app again, or reattach the dongle, I only 0 to 2 new messages.
With the same setting, dongle and antenna, with windows 10 and SDRangel I get a continous stream of NMEA messages
Any idea what is wrong?

AIS-catcher Android does not shut down when closed

Jasper,

Before the most recent version (with the TCP bug), when using AIS-catcher and accessing the web client, ending the web client would close the web page and the AIS-catcher icon would have an orange dot on it, indicating it was still running in the background.

In the current version, there is no orange dot on closing the web client.

AIS-catcher still runs in the background and processes data and when icon pressed screen comes back with correct display.

If stop feed, the program still runs in the background, the Running Time counter increments, even though there is no feed (tested using rtl_tcp).

I think that the previous version did end, but I might be wrong.

A force stop for the app ends the program and on startup the Running Time counter is reset.

I would expect the following to happen:

Assume AIS-catcher is running with the web client displaying a page:

End web client, should end it (it does) and leaves AIS-catcher still running (it does). It should indicate that the app is running in the background (orange dot), it does not do that.

Select AIS-catcher icon and it displays current data (it was running in background): expected result.

Stop processing by pressing Stop: AIS-catcher disconnects from feed (expected). Running Time increments (if it is 'app running time', that is correct).

Press the square symbol in middle bottom of screen, AIS-catcher appears to close. It still has the Running Timer running. I would expect the app to end and stop completely if not processing data. On restart app, it should be a new session with Running Time reset.

If 'force stop' app, it does end and reset Running Time counter on restart.

Is the current behaviour intended?

Roger

Update Aug26-2023 version.. gb8ef1ad app not ending

Jasper,

Several, I suspect interrelated issues:

  1. The app does not close when you select the square icon in middle bottom of screen. An app 'force stop' is needed.

Start app with sample rate = 288K Tuner = 49

  1. when connect to rtl_tcp app works as expected until press 'Stop' on app

AIS-catcher-Android-startup-OK-Screenshot 2023-08-27 100448

After stop pressed, rtl_tcp gives the following:

AIS-catcher-Android-after press stop-Screenshot 2023-08-27 093511

then a bit later the following with a ctl-C to stop it. rtl_tcp does not exit but then returns to listening... Select 'Start' on app and all starts going again until select 'Stop' and the same thing happens

AIS-catcher-Android-after-press-stop-2-Screenshot 2023-08-27 094834

A second ctl-C will end rtl_tcp as expected.

Is AIS-catcher not terminating the link to rtl_tcp correctly? It was all working fine on the previous version and I only saw the "11+, now..." messages at high sample rates, which you confirmed is an overload condition.

EDITED to add:

I recall that pressing the square icon would close the screen and leave an orange dot on the app icon as it was still open and processing: there is no such indicator on this version

regards
Roger

getting messages but can't see a thing on opencpn

Hi,
Your project seems great!
I have a RTL-SDR receiver and live near the sea, I successfully got 11 messages (type: other) and set up a connection (UDP, 127.0.0.1:10110) on opencpn free (android) but I don't see any boat on the map.

Would you please share the full process to link your catcher and opencpn?

Thank you

driver crashes after a minute or 2

I'm getting boat positions in OpenCPN now.
I think a full tutorial is needed though 😄

For now, the problem is with duration. The RTL-SDR driver is started manually and it throws:

onStart
RtlSdr: found 1 device opening options
HackRF: found 0 device opening options
Only 1 option available, no need to ask user. Opening rtl-sdr /dev/bus/usb/001/003
Queueing
Arguments SdrTcpArguments{gain=24, samplerateHz=1024000, frequencyHz=91800000, address='0.0.0.0', port=14423, ppm=0}
Starting service with device rtl-sdr /dev/bus/usb/001/003
Opening fd 48
Set sampling rate to 1024000
Tuner gain set to 2.400000 dB
SdrTcp: Listening on [0.0.0.0:14423](http://0.0.0.0:14423/)
SdrTcp: Waiting for client...
Device was open. Closing the prompt activity.
The rtl-tcp implementation is running and is ready to accept clients
Acquired wake lock. Will keep the screen on.
Starting was successful!

SdrTcp: TCP server succesfully started and listening for clients!
SdrTcp: Client has connected.
set freq correction 0
set gain mode 0
set sample rate 240000
SdrTcp: commandListener failed to receive command
SdrTcp: Command listener thread exiting
SdrTcp: Waiting for command thread to die
SdrTcp: TCP server shutting down.
SdrTcp: Closing sdrtcp due to main thread finishing
SdrTcp: Closing from state 0
SdrTcp: Server thread shut down
rtlsdr_read_async finished successfully
SdrTcp: Requested sdrtcp stop but already stopped
Successfully closed service
Wake lock released
Closing service

Starting was successful! is the last message before launching AIS-catcher.
I don't know what commandListener is, but it seems that it's missing at some point and it closes.

Wrong version number?

Moin,
I installed your latest version, but it say's 0.21, and not 0.22.
Wrong apk or wrong number?
Greetings

Using rtl_tcp

Jasper.

I have been testing all the interfaces but I cannot get rtl_tcp to work.

Can you give me a few points as to setup on the Pi and phone, not sure I have done it right or if the is a problem. Most likely the former!

Roger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.