• AIS and OpenCPN

    Timo Birnschein05/11/2021 at 01:19 0 comments

    I live on a boat. The Automated Identification System (AIS) is great to have on a boat. If you don't have a transceiver to send AIS packages, you should at least be able to receive and display AIS targets on your chart plotter.

    An RTL-SDR is the cheapest way I am aware of to accomplish this. All we need is the RTL-SDR itself and a VHF antenna that is able to pick up the signals around 162 Mhz.

    To start with, I fiddled around with the antenna that came with my kit. It's not the right antenna for this frequency and I wasn't able to receive anything more than 0.5 miles away. That's useless (this antenna might get another chance though as I'll explain bit bit below. Spoiler alert: I think having the signal gain set automatically doesn't work well). But I was more hopeful with my boat's 8' VHF antenna. Turns out, I was right, but it needed at least some tuning. The results are great!

    Here are the steps to make the above possible:

    Download OpenCPN from their website. This is an open source chart plotter software that's excellent. Many boaters around the globe are using this software package as it also includes open and up to date charts! My own setup can be found here.

    Download the RTL-AIS binary package from this website.

    Install OpenCPN and unzip rtl-ais to a folder you want to use for it. Open the folder and navigate to the "ais.bat" file. Right click on it and EDIT the file.

    Note that, in the last line of the file, the actual application is started. For my AIS reception to work, I needed to add a parameter "-g30" to the list of arguments to set the gain for the receiver. By default, it is set to AUTO which did not result in good results (see complaint about the kit antenna at the beginnig of this post). In fact, it wasn't any better than the antenna that came with the RTL-SDR kit. Makes me wonder if I can get better results with that antenna now as well...

    I determined the gain by opening SDRsharp, clicking on the gear icon in the top left to get into the settings and increase the gain until I saw massive amounts of harmonics show up in the spectrum. I assume, the default setting of rtl-ais increased the gain too far which messed up the reception.

    With the gain set to 29.7 dB:

    With the gain set to >30dB:

    At >30dB, the signal gets somewhat distorted and worst from there. If you know why, please let me know in the comments! This is really puzzling to me. It went so far that I was able to hear other audio channels on the AIS frequencies. That doesn't work for digital data transmissions.

    Close SDRsharp, add the gain to the “ais.bat” file and run "ais.bat".

    You will see a command line box show up that selects the sdr dongle, sets some parameters and then starts receiving AIS NMEA strings.  

    Next, I went into OpenCPN, clicked the gear icon in the top left to get into the settings and clicked on Connections:

    There, I added a new UDP connection to listen on localhost (127.0.0.1) on port 10110. This is the port RTL-AIS is transmitting to as the application mentions when it is started. That's it!

    You can check your work by clicking on Apply and then the Show NMEA Debug Window checkbox further up and see that the AIS messages are coming in.

    Please note, the debug window MUST be closed by unchecking the checkbox again. You CANNOT click the X at the top right.

    If you receive AIS messages here, they will slowly fill your OpenCPN chart plotter window!

    Please also note that AIS is slow, especially for targets that are not moving! So it might take a couple minutes to receive them all. In addition, packages are being received and checked if the data was received correctly. Often, that is not the case! You will get lots of damaged packages that are consequently discarded. Look at this screenshot somewhere in the middle. It tells you how many packages where received, how many were malformed and how many had CRC errors. Ignore that. It's just good to know whether you...

    Read more »

  • Experimenting with Weatherfax - Shortwave (ongoing post)

    Timo Birnschein05/09/2021 at 03:54 0 comments

    The actual reason why I wanted to get into SDR was weatherfax. At some point in my life, I want to go cruising on a sail boat. To be able to receive current weather information without spending a fortune on satellite internet one would use weatherfax. Weatherax is a free service provided world wide to people with a shortwave radio and either an actual weatherfax machine or a piece of software to decode the data stream.

    The primary issue with weatherfax, or shortwave rather, is that it requires a really long antenna. The frequencies range from about 5 Mhz to  17 Mhz with a useful center around 10 Mhz. To receive this reasonably well without spending a roll of $$$ on a professional antenna, you would need either a full wave antenna (~46 feet or ~14 meters) or a half wave antenna (~23 feet or ~7 meters). That's quite a substantial length when it is required to be vertical.

    There are some active antennas that seem to bend radio waves to their will and can therefore be very compact but those usually suffer from lower reception quality. 

    Some sailors use an insulated backstay as an antenna because it goes all the way up the mast. That works well, but is quite costly. 

    My problem is, that I do not have a mast on my power boat, so all that's left for me is to experiment a little on a day by day basis and ask people if I may use their spare halyard to run a 23' cable up their mast for a few minutes.

    This video gives a nice overview of what's involved when no SDR is used.

    This video shows how to use an active mini whip antenna with an SDR. I'm actually surprised that this works at all. The Amazon reviews for this antenna are quite terrible.

    This video goes into detail on using different software packages to decode weatherfax.

    Next steps for me is to get a long piece of wire of at least 23 feet in length and somehow plug it into my HamItUp converter (essentially multiplies the frequencies from shortware into something my RTL-SDR can easily work with) and get someone in my harbor to allow me to run it up their mast. 

    This seems to be an antenna people have success with, depending on their location.

  • Tracking Airplanes with ADS-B

    Timo Birnschein05/09/2021 at 01:12 0 comments

    ADS-B is a system to communicate the position of airplanes to other aircraft as well as towers.

    It's making sure that fewer mid air and ground collisions take place. An SDR dongle allows to receive these signals as well and plot the received airplanes on a google maps chart.

    We need two pieces of software for this: 1090dump (you can also find the binary for windows in this forkas a zip file) and Virtual Radar Server.

    Download both, unzip 1090dump and install virtual radar server as usual.

    Go into the folder containing 1090dump and double click the 1090dump.bat file. A command box should show up with a bit of text, showing that the RTL-SDR was found.

     The window then changes into the actual tracking window showing airplanes in range of your antenna. This might be only a few or none depending on your area and vicinity to an airport and the quality if your antenna. Here in the Bay Area around San Francisco I saw more then 20 tracked airplanes and right now...

    If you see something here, fantastic!

    Now fire up Virtual Radar Server, click on Tools and then Options. Go to the Receiver -> Receivers section:

    In the top right corner click Wizard.

    Select Software Defined Radio

    Select Dump 1090

    Click yes.

    Click Finish and then Test Connection on the right under the Wizard button. The connection should be made successfully.

    Now, your system should be set up and you should be seeing the number of total messages ticking upwards:

    To view the google maps window with tracked airplanes, simply click on the link in the center on the left. A browser should pop up and show the tracked airplanes with some additional data. the view can be configured in various ways. I have mine set up to show the track of every airplane as long as they are still being tracked.

    Like I said, at the day of writing, I'm not seeing much. But hey, airplanes tracking. I need a better antenna for this sort of thing.

  • Getting started - SDRSharp

    Timo Birnschein05/09/2021 at 00:35 0 comments

    Welcome to SDR.

    I'll keep these logs as short as possible to allow you to follow along without reading a ton text.

    In order to do anything at all, we need a driver for the SDR to work. SDRSharp comes with a driver package that installs the correct driver for your RTL-SDR dongle or any other most common dongle. Please check out the Setup Guide section here and follow the steps to install the driver.

    After this, the dongle will show up in SDRSharp as your signal source.

    Open SDRSharp and clock on the gear to open the settings:

    Select your RTL-SDR stock from the devices list, set or leave the sample rate (higher sample rate gives you more visible spectrum) and set your RF Gain to something reasonable like 28 dB.

    Hit close and then press the play button at the top of the screen. A spectrum should now be visible on the right, flickering away, with a so called waterfall spectrum underneath it. Does it work? Great! You have succeeded in getting your receiver to work.

    I recommend dialing into something you can receive with your standard antenna like one of the NOOA weather channels. Make sure you set the Radio to NFM to receive it properly.

    Maybe the frequencies are a bit different where you are in the world. For the US you can find them here.

    Don't forget to use an antenna that works with this frequency. You can calculate it's length here for whip antennas or here for dipole antennas.

    If your reception is terrible, it is at least very likely that you are in a very noisy RF environment. Make sure you turn as many devices in your house or boat off by pulling the plug or flipping the breaker. I have a number of LED lights and apparently, the transformer is a terrible RF source messing with my reception! The more quiet the environment is the better your reception of actual signals will be.