RECEPTION OF NAVTEX
(2023)

What is NAVTEX
NAVTEX (NAVigational TEleX), sometimes styled Navtex or NavTex, is an international automated medium frequency direct-printing service for delivery of navigational and meteorological warnings and forecasts, as well as urgent maritime safety information (MSI) to ships.
NAVTEX was developed to provide a low-cost, simple, and automated means of receiving this information aboard ships at sea within approximately 370 km (200 nautical miles) off-shore.


The Python program for the reception of NAVTEX

Simple
This program can be executed with a Raspberry Pi Version 4. It can be used with Windows and Linux!
Connect your PC to the SSB shortwave receiver. Execute the Python program NAVTEXsnoop-v01x.py, if you do not know how, that is explained later.
Press the -START- button, select the desired audio input and the NAVTEX data will be displayed.

Buttons:

-START-
Press this button to start the reception or to stop the reception.

-48000-
This is the sample rate of your audio device. If you have a slow PC, then you can select 12000 samples/sec., that will reduce the processing power a lot! But then you need to use an audio device that supports this sample rate. It is also possible to select 44100 samples/sec.

-400 - 2400-
This is the audio range that is scanned for usable signals. Normally it is set to 400 - 2400 Hz. But if you have some unwanted signals in the spectrum you can select other ranges. For 1500 Hz center frequency you can select 1000 - 2000 Hz or 1200 - 1800 Hz. For a 1500 Hz center frequency, you have to tune the SSB receiver 1500 Hz lower than the NAVTEX frequency. So 516,5 kHz for the 518 kHz NAVTEX frequency and 488,5 kHz for the NAVTEX frequency of 490 kHz. Selection is done by pressing the button, the range is given by the button text.
For the Barefoot Navtex Receiver there is a special setting 17500 - 18500 Hz for the special 18 kHz center frequency. It has a mixer oscillator frequency of 500 kHz.

-Noise ID-
The new version has a Noise Indicator button. It has no scientific use whatsoever! Only useful for fixed gain receivers!

Noise is measured in the half hour before the message. Average and Peak noise of the lowest level during one minute is displayed. A low level means good condx. A high peak level is usually caused by thunderstorms.

-Auto Scroll-
Normally activated, the last message is shown on the display.

-FILE log ON-
If OFF, saving of the NAVTEX data to the files is stopped.

-Mode-
BASIC Mode: DX-RX errors in the message header are not allowed.
DX Mode: DX-RX errors in the message header are allowed and shown. Shows also Statistical Information.
DEBUG Mode: DX-RX errors shown - Invalid Header Characters allowed - Shows Control Characters.


The spectrum display

The spectrum display
The selected spectrum is displayed. The vertical red lines are the shift frequencies of the NAVTEX signal.
At the left there is a vertical green line. It displays the audio buffer size. If your PC is too slow, it will go up and become red colored.
At the right there is also a vertical green line. It displays the audio level and will become red colored if the audio level is too high.
When a ZCZC signal is detected, a horizontal orange line is displayed at the bottom. If the Signal to Noise is good, the line will be small, when you have a noisy signal, it will be a wide line. It moves a little around the white marker, that is the locking routine.
And just above the orange line, there is a yellow line, that moves left - right, depending of the bit synchronization being forwards or backwards.


The file structure

File structure
And of course we want to save the received data in files! There are 4 directories NAVTEXall, NAVTEXmsgs and NAVTEXspecial. In the first directory, there is a file with all the NAVTEX messages. The second directory contains the messages with the messages with the same number in one file. And the third directory contains only special messages, only distress messages and weather warnings at the moment. But you can edit the Python program so that for example only messages of a specific station are saved in this directory.
The fourth directory NAVTEXday contains the daily files. They are updated every half hour and can for example be uploaded to your NAVTEX website.


The script that is used to start NAVTEXsnoop on a Raspberry Pi

Script to start NAVTEXsnoop.py on a Raspberry Pi
Make the script on the desktop and make it executable. You have to edit the script to make it suitable for your own PC of course!
Execute the script and the program starts. But... you can see that also a second program is started here! It is FTPsnoop.py! This can be used to upload files to your website. Click the link here below to see how that works:

NAVTEX 518 kHz


The text files are uploaded and also converted to .htm files. But you cannot use FTPsnoop.py straight away, you have to edit it to set your own FTP login codes.

Downsampling
You can use the program with the Raspberry Pi version 4. The CPU percentage is approximately 25%, so it should also be possible to excecute it with a 3x slower Raspberry Pi version 3. But it might be that you have to downsample the audio stream. Before pressing Start, press the orange "48000" button and the sample rate can be reduced to 12000. Then the CPU percentage is lower than 10% on my Raspberry Pi version 4 and it should certainly be possible to excecute it with a Raspberry Pi version 3. My USB sound device supports a sample rate of 12000. It is a Behringer type UFO202 and even supports a 8000 Hz sampling rate. But if your device does not support it, you can do the downsampling with Pulseaudio. Then you have to install the "Pulse" audio platform on the Raspberry Pi. Pulse is then selected as audio input device and is used for the downsampling of the audio stream. Type the following commands in a terminal window:
sudo apt-get install pulseaudio
sudo apt-get install pavucontrol

Error handling
Every character is transmitted twice, once in the DX position and once 5 characters later in the RX position. And every byte of 7 bits is specially coded. If one bit or more bits of the same "Y" or "B" value is disturbed, it will become an invalid character.
To eliminate problems with fading, two zero crossings are combined ("YB" and "BY" crossings) for the bit synchronisation.
There is a special symbol to switch from letters to numbers. This will be activated if only one of the RX and DX transmissions contain that symbol.

Special settings
You can edit and modify the Python program with IDLE. There are two special settings that you perhaps want to change:
# Special settings for the user
LowerSideBand = False # If True then LSB instead of normal USB reception



Click this link to download the ZIP file with the Python programs and other scripts



FTPsnoop.py


You have to edit the first lines with login codes of FTPsnoop.py.

FTPsnoop.py
FTPsnoop.py is started after NAVTEXsnoop.py. Every 30 minutes, NAVTEXsnoop.py updates the daily text files with NAVTEX messages in the NAVTEXday directory. It saves the file names in the file FTPuploads.txt. FTPsnoop.py checks if this file exists. If it exists, it will upload the files to your FTP site. If you have set HTMLupload=True, then the text files are converted to HTML files and uploaded.


Receiving marine radio signals is a nice relaxing hobby!


SOFTWARE

Before you are using this program, you have to install Python. That is very simple. But read first something about Python by clicking the following link:

WHAT IS PYTHON AND HOW DO YOU INSTALL PYTHON

As the source code of Python is written in ASCII, it is very simple to modify the program to you own requirements. Think for example about the size of the screen, the colors etc.

Required Python version:

Required external modules (site-packages for the correct Python version!):

Index PA2OHH