2017-12-01, 12:37 PM
(2017-12-01, 11:11 AM)seaspray Wrote: I got SDR/AIS working it just needed a new antenna.
My question is more around how to manipulate the AIS NMEA (eg can I view the AIS sentences in the NMEA diagnostics window, forward it to a serial output etc).
Assuming the AIS is going into Kplex then it should be sent out of address 10.10.10.1, port 10109. (which it should be..)
Then you can save it to a file using node red , code below. Probably won't do you much good though, AIS messages aren't like most NMEA where you can easily see the data, they are binary so not so easy to get into.
Quote:!AIVDM,2,2,2,B,000003v0100,2*61
!AIVDM,2,1,3,B,E>jae:?9PSa2ah77a:417bW2@7HwcHJp:OLb,0*09
!AIVDM,2,2,3,B,000003v0100,2*60
!AIVDM,2,1,4,B,E>jae:w9PSa2ah77a:417bW2@7JObO30:UOH,0*70
!AIVDM,2,2,4,B,000003v0100,2*67
!AIVDM,2,1,5,B,E>jae;?9PSa2ah9Wbb417bW2@9pwarrP:TfS,0*2D
!AIVDM,2,2,5,B,000003v0100,2*66
!AIVDM,2,1,6,B,E>jae;g9PSa2ah9Wbb417bW2@9qwbc@@:LtP,0*4E
!AIVDM,2,2,6,B,000003v0100,2*65
Code:
[
{
"id": "2ec38e6f.de4e32",
"type": "switch",
"z": "f1a0cb4.fe86138",
"name": "Filter just ais",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "regex",
"v": "!AIVDM*",
"vt": "str",
"case": true
}
],
"checkall": "true",
"outputs": 1,
"x": 412,
"y": 68.99998474121094,
"wires": [
[
"b94ee7ad.e95078"
]
]
},
{
"id": "36d7cef4.ce9742",
"type": "tcp in",
"z": "f1a0cb4.fe86138",
"name": "",
"server": "client",
"host": "10.10.10.1",
"port": "10109",
"datamode": "stream",
"datatype": "utf8",
"newline": "\\n",
"topic": "",
"base64": false,
"x": 184.00001525878906,
"y": 83,
"wires": [
[
"2ec38e6f.de4e32"
]
]
},
{
"id": "b94ee7ad.e95078",
"type": "file",
"z": "f1a0cb4.fe86138",
"name": "",
"filename": "/home/pi/savedais2.txt",
"appendNewline": true,
"createDir": false,
"overwriteFile": "false",
"x": 624,
"y": 45.99998474121094,
"wires": []
}
]