A Software EAS/NWS Data Receiver

Matt Roberts - matt-at-kk5jy-dot-net

Published: 2018-06-20


Many open-source projects start out as a curiosity.  This one is certainly no different.  One evening, while watching storm chasing videos on YouTube, I heard the NWS alert tones in the receiver in one of the storm chaser's car.  That led me to think, "I wonder what is in those data bursts...?"  I did a little reading about the EAS, of which the NWS weather alerts are a part.  As it turns out, the data is simple FSK to encode a very terse summary of each alert.

That led me to wonder what it would take to decode the data in those alerts.

There are two parts to reading the information contained in an NWS alert.  The first is translating the audio FSK into its ASCII (SAME) data representation.  The second part is extracting the various text codes from the SAME message, and converting those into human-readable text.  The second part of that problem has already been solved, via the very nice DSAME library.  This library is written in Python, and can run on any platform that supports Python, including PC-based Linux and the RasPi's Raspbian.  The first part of the problem, the FSK demodulation was the part I set out to solve.

I already had an FSK demodulator library written for another project.  With a little bit of tuning, I was able to adapt that demodulator to the 521bps FSK used by the NWS weather radio.  Unlike with RTTY, the bit stream in the EAS bursts are synchronous, with no start or stop bits.  Instead, the EAS bursts use a 16-byte synchronization header, followed by another five bytes of data header, to allow the receiver to align its byte boundaries to the transmission.  With a little bit of clock recovery logic, the receiver was able to receive the raw data from an audio stream.

All of this has been wrapped up in a tight little utility called nwsrx, which can read either a WAV file or a sound card in real time, listening for the EAS SAME messages, and writing their raw ASCII content to standard output.  This can be used as the front end to any number of utilities for intercepting alerts.

The utility can build and run on any Linux system.  The command line is very simple, and can use any of the following forms:
nwsrx <input_audio_file>
nwsrx -c <sound_device_number>
nwsrx -l
The first line is an example of reading data from a WAV file.  The second line reads audio data in real-time from a sound card.  The third line is used to list the available sound cards, and show the ID number for each.

An example of the decoder being used on a test file follows:
$ nwsrx EAS.wav

ZCZC-WXR-TOR-017021-017115+0045-1000042-KILX/NWS-
ZCZC-WXR-TOR-017021-017115+0045-1000042-KILX/NWS-
ZCZC-WXR-TOR-017021-017115+0045-1000042-KILX/NWS-
NNNN
NNNN
NNNN

$
The format of the messages is described in this NOAA document, but the general idea is that the alert is sent three times, with a second of silence between each data burst.  After an audio or audio/video message with details about the alert, the end-of-message (NNNN) is sent.  Each alert frame starts with a header (ZCZC-) followed by the service code, in this case NWS (WXR-), the alert type, in this case a tornado warning (TOR-), followed by geographic zone information, effective time and expiration information, and then station identification.

The dsame utility can be used to translate this into a more readable form:
$ dsame.py --msg="ZCZC-WXR-TOR-017021-017115+0045-1000042-KILX/NWS-"

The National Weather Service in Lincoln, Illinois has issued a Tornado Warning
valid until 08:27 PM for the following counties in Illinois: Christian, Macon.
(KILX/NWS)

$
The code is very lightweight, and should be able to run on even low-power systems, such as the RasPi Zero, even when decoding in real-time from an audio source such as a VHF FM receiver.  This should allow it to be used as part of a larger project, which could include things such as displays, logging facilities, etc.


Software Downloads

The software for the project is available in source form, below.  Building the software on Linux (including RasPi) requires some prerequisites: This project is still in-progress, but the core functions are working.  And that is enough for a kit, which is the point.  I will continue to develop the kit for my own uses, but the software is available here for those who would like to experiment with detection and decoding of EAS messages.

CAUTION:  This software is provided for educational purposes only, and must not be used in situations, devices, or products, where safety or protection of life or property is dependent upon the operation of the software.  Please see the limitations provided in the terms of the GPL version 3.

nwsrx 1.0 Downloads  (Click Here)

Click the link above to download software packages.  The source is being released under the GPL version 3, which is also available on the download page.


Release History

2018-06-20 - Initial release.

Copyright (C) 2018 by Matt Roberts, KK5JY.
All Rights Reserved.