jvde-github / AIS-catcher

AIS receiver for RTL SDR dongles, Airspy R2, Airspy Mini, Airspy HF+, HackRF, SDRplay and SoapySDR
https://aiscatcher.org
GNU General Public License v3.0
515 stars 78 forks source link

AIS-catcher emits "pressure" as floating point in JSON output, IMO289 specification says it should be integer #179

Closed cricalix closed 1 year ago

cricalix commented 1 year ago

I'm working from https://gpsd.gitlab.io/gpsd/AIVDM.html#_meteorological_and_hydrological_data_imo289, as well as looking at the data emitted by the AIS weather sources in Dublin Bay, Ireland. In both cases, the pressure field is defined as integer, not floating point. The GPSD documentation points at http://vislab-ccom.unh.edu/~schwehr/papers/2010-IMO-SN.1-Circ.289.pdf, and annex page 6 defines Air Pressure as incrementing in 1 hPa steps with no indication of floating point representation.

{
  "class": "AIS",
  "device": "AIS-catcher",
  "rxtime": "20230927180640",
  "scaled": true,
  "channel": "B",
  "nmea": [
    "!AIVDM,2,1,7,B,8>jQM6@0Gwm9V1QWG7LQV3Qdel@fEuEWgwl?wnSwe7wvlOwwsAwwnSGm,0*39",
    "!AIVDM,2,2,7,B,wvh0,0*4B"
  ],
  "signalpower": -14.809308,
  "ppm": 6.076389,
  "type": 8,
  "repeat": 0,
  "mmsi": 992501017,
  "country": "Ireland",
  "country_code": "IE",
  "dac": 1,
  "fid": 31,
...
  "airtemp": 13.3,
  "pressure": 978.000000,
...
}
jvde-github commented 1 year ago

Ok, there is no reason to use float, so I think I have amended that with an update. On your example, I now have:

{"class":"AIS","device":"AIS-catcher","scaled":true,"channel":"B","nmea":["!AIVDM,2,1,7,B,8>jQM6@0Gwm9V1QWG7LQV3Qdel@fEuEWgwl?wnSwe7wvlOwwsAwwnSGm,0*39","!AIVDM,2,2,7,B,wvh0,0*4B"],"type":8,"repeat":0,"mmsi":992501017,"dac":1,"fid":31,"lon":-5.925600,"lat":53.310802,"accuracy":true,"day":27,"hour":18,"minute":6,"wspeed":48,"wgust":56,"wdir":217,"wgustdir":221,"airtemp":13.300000,"pressure":978,"visgreater":0,"visibility":12.700000,"waterlevel":30.009998,"cspeed2":25.500000,"cdir2":360,"cdepth2":31,"cspeed3":25.500000,"cdir3":360,"cdepth3":31,"waveheight":25.500000,"waveperiod":63,"wavedir":360,"swellheight":25.500000,"swellperiod":63,"swelldir":360,"seastate":13}
Taxom commented 1 year ago

If you need a data source with type 8, you can take my http://taxom.ddns.net:8383/ I almost always have this type of message. By the way, can you add a type of message to the ships table so that it is easier to find a source? (TCP: 5011 NMEA, 5012 JSON)