Showing posts with label ais. Show all posts
Showing posts with label ais. Show all posts

SRT proprietary AIS commands

My Navico NAIS-300, like most other commercial AIS class B products that have been available for a while, uses the SRT AIS class B OEM board. I know the same board is used in the Raymarine 500, True Heading AIS-CTRX, Transas, Digital Yacht AIT250/1000, and many more. The tell-tale seems to be that the AIS transponder comes with Pro AIS software. I have hooked up a serial data logger so that I could find out what NMEA-0183 commands the Pro AIS software sends to the transponder. Unfortunately neither SRT nor any of the vendors publish the protocol.

My research into this started because I wanted to control my AIS transponder's transmit setting using software. For some reason there are many functions that you can assign to the remote button input, but not a reliable level-style on/off of the transmit functionality. This has been added to recent firmware versions, but mine contains older firmware. However, an hour's worth of analysis shows that controlling the transmitter is actually quite easy. In fact, almost everything that you can set up using Pro AIS is easy as pie to implement.

Basics


The SRT product, logically, uses the 'P' prefix to indicate Proprietary, followed by SRT. Here is an example of a PSRT message:
$PSRT,LED,01*49
Just like all other sentences I document on this page the shown message format is inclusive of the NMEA style checksum bytes at the end of the line, e.g. *49 in the message above.

For some reason some sentences start with a prefix $DUAIQ. I have no theory as to why this is so, maybe the data is intercepted by a different microcontroller.

Authorization

Some sentences require the passing of a password. Luckily, the protocol to do this is very simple -- just send the following sentence before every authorized message:
$PSRT,012,,,(--QuaRk--)*4B

Silent mode

To make the AIS silent (not transmit its own position) send the following authorized (prefix with the command above) sentence:
$PSRT,TRG,02,33*6A

To make the AIS transmit its own position send the following authorized sentence:
$PSRT,TRG,02,00*6A

Alarm mode

To make the AIS output all alarms every minute send the following authorized sentence:
$PSRT,ALM,0000*45

To make the AIS output only the active alarms send the following authorized sentence:
$PSRT,ALM,0001*44

GPS update speed

To make the AIS output GPS data every second send the following authorized sentence:
$PSRT,GER,01*54

To make the AIS output GPS data every four seconds send the following authorized sentence:
$PSRT,GER,00*55

GPS data


The SRT board has a complete GPS on-board. For some reason it only sends out two GPS sentences: RMC and GBS. See the GPSD source for more information on these sentences (as well as those below.)

To get the GPS to send out more GPS sentences send the following authorized sentence:
$PSRT,GPSDATA,,,1*60
This will cause the board to send out VTG, GGA, GSV, GLL and ZDA sentences as well as RMC and GBS. My particular board has a small bug in that it also starts sending out two copies each of the RMC and the GBS commands.

To get it to stop sending the additional GPS messages, send the following authorized command:
$PSRT,GPSDATA,,,0*61



Interrogating the board

There is a whole stack of sentences that can be used to read out system information. These are

LED status
Send: $DUAIQ,LED*29
Recv: $PSRT,LED,a*hh
a bit 1: Power On
a bit 2: TX timeout
a bit 3: Error
a bit 4: SRM status
hh: checksum

Internal data
Send: $DUAIQ,ADC*22
Recv: $PSRT,ADC,a,b,c,d,e,f,g*hh
a: Tx forward power
b: Tx reverse power
c: RSSI Rx 1
d: RSSI Rx 2
e: Internal 3V3 supply
f: Internal 6V supply
g: Supply voltage
hh: Checksum

Boat data
Send: $DUAIQ,SSD*20
Recv: $AISSD,a,b,c,d,e,f,g,h*hh
a: Callsign, 8 bytes fixed length; @ for unused bytes
b: Ship's name,20 bytes fixed length; @ for unused bytes
c: GPS antenna distance from bow, in m
d: GPS antenna distance from stern, in m
e: GPS antenna distance from port side, in m
f: GPS antenna distance from SB side, in m
g: ?
h: ?
hh: Checksum

MMSI
Send: $DUAIQ,010*55
Recv: $PSRT,010,,,c*hh
a: ?
b: ?
c: MMSI

OEM name
Send: $DUAIQ,SRM*28
Recv: $PSRT,SRM,a,b,c*hh
a: ?
b: ?
c: OEM name used in AIS messages, 7 bytes fixed length; unused bytes are filled with @.
hh: Checksum

Vessel type
Send: $DUAIQ,VSD*25
Recv: $AIVSD,a,b,c,d,e,f,g,h*hh
a: vessel type. 36 = Sailing vessel, 37 = Pleasure craft
b: ?, always 00.0
c: ?, always 0000
d: ?, always @@@@@@@@@@@@@@@@@@@
e: ?, always 000000
f: ?, always 00
g: ?, always 00
h: ?, always 00
i: ?, always 00
hh: Checksum

Software version
Send: $DUAIQ,SWF*26
Recv: $PSRT,SWF,a,b*hh
a: AIS software version
b: FPGA version
hh: Checksum

Transponder Serial Number
Send: $DUAIQ,SNO*36
Recv: $PSRT,SNO,a*hh
a: Serial number in ASCII, 10 digits. Usually all 0.

Reset Data Programming

The following command is reputed to reset the AIS back to its factory settings, inclusive of the MMSI number, so that it can be reprogrammed.

$PSRT,RDP*6F

I haven't tried this myself, so I cannot say whether this actually works.

AIS class B update for packetlogger


Last week Ben Ellison at Panbo found that there is no AIS class B static data PGN agreed upon yet so when you connect a Navico NAIS-300 to a Garmin display there is no class B static data shown. As you can see in his NMEA 2000 PGN received list the NAIS-300 puts out a Navico specific PGN: 130842.

As I had a few days on the boat with the kids I dragged my NMEA 2000 network to the boat and rigged up a temporary network to verify some things. One reason was to see if I stumbled upon a Class B sender so I had some packets to analyze. Luckily I found one willing Class B sender half way down the IJsselmeer. This showed up nicely on the Lowrance HDS-8 that showed all this on the Info display shown up right. Side note: making pictures of displays out in the sunshine is harder than I thought. Weird how that dust shows up prominently on the photo, it was absolutely not irritating in the real world.


As a result I can verify that the Navico PGN 130842 does indeed contain the missing Class B static data: call sign, vessel type, dimensions. There are some other fields as well, but I can't yet place those. Interestingly, the PGN 130842 is transmitted every 6 minutes (on receipt of the over-the-air AIS message 24 Class B CS static data report) and then twice in succession, each with different length and somewhat different data.

The first format is 37 bytes long, and an example is (first in hex bytes, then ascii, then what I can make of it):
41 9F 81 FF 18 0F EA 8B 0E 25 54 52 55 45 48 44 47 50 45 34 32 35 38 00 6E 00 28 00 14 00 6E 00 FF FF FF FF C0
A . . . . . . . . . T R U E H D G P E 4 2 5 8 . n . . . . . n . . . . . .
A = 65 B = 159 C = 129 E = 24 MMSI = 244050447 Type of ship = Pleasure F = TRUEHDG Callsign = PE4258 Length = 11 m Beam = 4 m GPS from port = 2 m GPS from bow = 11 m L = 192

The second format is 29 bytes long, and an example in the same formats is:
41 9F 80 FF 18 0F EA 8B 0E 50 41 56 41 4E 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A . . . . . . . . P A V A N E . . . . . . . . . . . . . .
A = 65 B = 159 C = 128 E = 24 MMSI = 244050447 Name= PAVANE

Note the peculiar string embedded in the first format: TRUEHDG. This is likely to indicate that this NAIS-300 is based on a design from True Heading. After opening the case I did indeed find one Navico and one SRT circuit board, linked with a single four wire interconnect. The Navico specific board is much simpler, and only contains a smallish microprocessor. The SRT board contains a massive ASIC and a Texas Instruments 320Cxx class CPU, memory etc.

This seems to indicate that the communication between the two boards is a simple serial protocol, and that the Navico board only serves as the power circuit and NMEA 2000 interface.

The packetlogger program now understands the above forms of PGN 130842 as well as PGN 129039 (Class B position report) and can be downloaded from here. The list of messages and fields understood can be downloaded as well.