A integração entre NMEA para SIoT utiliza o middleware que converte as sentenças NMEA via TCP ou Serial Port em padrão MQTT e envia ao SIoT.
Instalação execução
Necessário instalar .NET 5
Realizar o download da última versão do Middleware.NMEA
Extrair os arquivos compactados em um diretório.
Configurar as váriaveis do ambiente no appsettings.json
{
"NMEA": { // configurações de conexão com o NMEA
"Mode": "SERIAL", // modo de conexão (utilizar SERIAL ou TCP)
"Serial": { // configurações para o modo SERIAL, informar apenas se o `Mode: SERIAL`
"Port": "COM2", // Serial Port
"Baudrate": 9600 // Baudrate
},
"TCP": { // configurações para o modo TCP, informar apenas se o `Mode: TCP`
"Endpoint": "localhost", // Endpoint TCP
"Port": 3000 // Porta TCP
}
},
"MQTT": { // configurações da conexão MQTT para envio dos sinais para o broker do SIoT
"Endpoint": "siot-broker-mqtt-dev.konztec.com.br", // endpoint do MQTT
"Port": 8883, // porta MQTT
"TLS": true // utiliza SSL/TLS (true ou false)
},
"BUFFER": { // configurações do buffer de sinais
"CronSend": "0/30 * * * * ?", // intervalo de tempo no formato CRON para verificar o buffer e enviar os sinais
"TotalFiles": 10000 // limite de arquivos a serem enviados no intervalo
},
"IntervalSend": 10000 // Intervalo para envio dos sinais de NMEA para o SIoT
}
Copiar config.example.json para config.json e configurar
$ cp config.example.json config.json
Verifique a documentação do cadastro e geração de token no SIoT para gerar os valores do token e idMachine
{
"idMachine": "maquina1", // ID da máquina no SIoT
"token": "token", // Token da máquina no SIoT
"items": [
{
"sentenceId": "MTW", // Tipo de setença NMEA (Utilizar as listadas abaixo)
"sensorId": "temperatura_agua", // ID do sensor no SIoT
"signals": [
{
"signalId": "atual", // ID do sinal no SIoT
"packet": "Degrees" // Propriedade da setença NMEA (Utilizar a propriedade das sentenças listadas abaixo)
}
]
}
]
}
Codecs NMEA e suas propriedades/tipo de variável:
GGAGlobal Positioning System Fix Data- FixTime TimeSpan
- Latitude Float
- Longitude Float
- NumberOfSatellites Int
- HorizontalDilution Float
- AltitudeUnits String
- FixQuality Int
- Invalid = 0
- GpsFix = 1
- DgpsFix = 2
- PpsFix = 3
- Rtk = 4
- FloatRtk = 5
- Estimated = 6
- ManualInput = 7
- Simulation = 8
- Altitude Float
- HeightOfGeoId Float
- HeightOfGeoIdUnits String
- TimeSpanSinceDgpsUpdate Int
- DgpsStationId Int
HDTHeading - True- Heading Float
VTGTrack made good and Ground speed- TrackTrue Float
- TrackMagnetic Float
- SpeedKnots Float
- SpeedKmph Float
- FaaMode String
DBKDepth Below Keel- DepthFeet Float
- DepthMeters Float
- DepthFathoms Float
DBSDepth Below Surface- DepthFeet Float
- DepthMeters Float
- DepthFathoms Float
DBTDepth below transducer- DepthFeet Float
- DepthMeters Float
- DepthFathoms Float
DPTDepth of Water- Depth Float
- OffsetTransducer Float
- MaximumRangeScale Float
GLLGeographic Position - Latitude/Longitude- Latitude Float
- Longitude Float
- Time TimeSpan
- Status String
- FaaMode String
GSAActive satellites and dilution of precision- SelectionMode Int
- Auto = 0
- Manual = 1
- FixMode Int
- NotAvailable = 1
- Fix2D = 2
- Fix3D = 3
- SatelliteIDs Int[]
- Pdop Float
- Hdop Float
- Vdop Float
MTWMean Temperature of Water- Degrees Float
- UnitMeasurement String
MWDWind Direction- WindAngleTrue Float
- WindAngleMagnetic Float
- SpeedKnots Float
- SpeedMps Float
MWVWind Speed and Angle- WindAngle Float
- Speed Float
- Reference String (R = Relative, T = True)
- Units String (K = km/hr, M = m/s, N = knots, S = statute)
- Status Int
- Valid = 0
- Invalid = 1
RMCRecommended Minimum Navigation Information- DateTime DateTime
- Status String
- Latitude Float
- Longitude Float
- SpeedKnots Float
- TrackTrue Float
- Variation Float
- VariationPole String (E or W)
- FaaMode String
RPMRevolutions- Source Int
- Shaft = 0
- Engine = 1
- SourceValue Float
- SpeedMinute Float
- PropellerPitch Float
- Status Int
- Valid = 0
- Invalid = 1
VHWWater speed and heading- DegreesTrue Float
- DegreesMagnetic Float
- SpeedKnots Float
- SpeedKmph Float
ZDATime & Date - UTC, day, month, year and local time zone- DateTime DateTime
- LocalZoneHours Int
- LocalZoneMinutes Int