diff --git a/monitor/js/device.js b/monitor/js/device.js index ee59976..273f933 100644 --- a/monitor/js/device.js +++ b/monitor/js/device.js @@ -120,7 +120,7 @@ function deviceInit(ip) { } else if (json.ip !== undefined) { // from cookie argument device.name = json.name; device.ip = json.ip; - device.ws = json.ws; + device.ws = json.ws.replace(/^wss?:\/\//, proto); // force matching protocol } else { device.name = 'unknown'; device.ip = window.location.hostname; diff --git a/monitor/js/engine.js b/monitor/js/engine.js index 8836cdf..f749539 100644 --- a/monitor/js/engine.js +++ b/monitor/js/engine.js @@ -91,7 +91,7 @@ function messageTable(message) { dump += 'Type' + message.type.toUpperCase() + ''; dump += 'Length' + message.data.length + ''; dump += 'Text Dump' + textDump(message.data, message.binary) + ''; - dump += 'Hex Dump' + hexDump(message.data) + ''; + dump += 'Hex Dump' + hexDump(message.data) + ''; if (message.fields) dump += 'Fields' + jsonDump(message.fields) + ''; // if (message.spec) @@ -622,341 +622,394 @@ const mapCfgLayer = { 0:'RAM', 1:'BBR', 2:'FLASH', /* ... */ 7:'DEFAULT', const spec = { // NAV ------------ - 'NAV-DOP': { descr:'Dilution of precision', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'gDop', type:'U2', scale:1e-2, }, - { name:'pDop', type:'U2', scale:1e-2, }, - { name:'tDop', type:'U2', scale:1e-2, }, - { name:'vDop', type:'U2', scale:1e-2, }, - { name:'hDop', type:'U2', scale:1e-2, }, - { name:'nDop', type:'U2', scale:1e-2, }, - { name:'eDop', type:'U2', scale:1e-2, }, ] }, - 'NAV-HPPOSLLH': { descr:'High Precision Geodetic Position Solution', - spec:[ { name:'version', type:'U1' }, - { type:'U1[3]' }, - { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'lon', type:'I4', scale:1e-7, unit:'deg' }, - { name:'lat', type:'I4', scale:1e-7, unit:'deg' }, - { name:'height', type:'I4', scale:1e-3, unit:'m' }, - { name:'msl', type:'I4', scale:1e-3, unit:'m' }, - { name:'lonHp', type:'I1', scale:1e-9, unit:'deg' }, - { name:'latHP', type:'I1', scale:1e-9, unit:'deg' }, ] }, - 'NAV-POSECEF': { descr:'Position Solution in ECEF', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'ecefX', type:'I4', scale:1e-2, unit:'m' }, - { name:'ecefY', type:'I4', scale:1e-2, unit:'m' }, - { name:'ecefZ', type:'I4', scale:1e-2, unit:'m' }, - { name:'pAcc', type:'U4', scale:1e-2, unit:'m' }, ] }, - 'NAV-POSLLH': { descr:'Geodetic Position Solution', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'lon', type:'I4', scale:1e-7, unit:'deg' }, - { name:'lat', type:'I4', scale:1e-7, unit:'deg' }, - { name:'height', type:'I4', scale:1e-3, unit:'m' }, - { name:'msl', type:'I4', scale:1e-3, unit:'m' }, - { name:'hAcc', type:'U4', scale:1e-3, unit:'m' }, - { name:'vAcc', type:'U4', scale:1e-3, unit:'m' }, ] }, - 'NAV-PL': { descr:'Protection Level', - spec:[ { name:'version', type:'U1', }, - { name:'tmirCoeff', type:'U1', }, - { name:'tmirExp', type:'U1', }, - { name:'plPosValid', type:'U1', }, - { name:'plPosFrame', type:'U1', }, - { name:'plVelValid', type:'U1', }, - { name:'plVelFrame', type:'U1', }, - { name:'plTimeValid', type:'U1', }, - { type:'U1[4]' }, - { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'plPos1', type:'U4', scale:1e-3, unit:'m' }, - { name:'plPos2', type:'U4', scale:1e-3, unit:'m' }, - { name:'plPos3', type:'U4', scale:1e-3, unit:'m' }, - { name:'plVel1', type:'U4', scale:1e-3, unit:'m/s' }, - { name:'plVel2', type:'U4', scale:1e-3, unit:'m/s' }, - { name:'plVel3', type:'U4', scale:1e-3, unit:'m/s' }, - { name:'plPosHorOr', type:'U2', scale:1e-2, unit:'deg' }, - { name:'plVelHorOr', type:'U2', scale:1e-2, unit:'deg' }, - { name:'plTime', type:'U4', }, ] }, - 'NAV-PVT': { descr:'Navigation Position Velocity Time Solution', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'year', type:'U2', unit:'y' }, - { name:'month', type:'U1', unit:'month' }, - { name:'day', type:'U1', unit:'d' }, - { name:'hour', type:'U1', unit:'h' }, - { name:'min', type:'U1', unit:'min' }, - { name:'sec', type:'U1', unit:'s' }, - { name:'valid', spec: [ - { name:'validDate', type:'x1' }, // bit0:validDate, - { name:'validTime', type:'x1' }, // bit1:validTime, - { name:'fullyResolved', type:'x1' }, // bit2:fullyResolved - { type:'x5' } ] }, - { name:'tAcc', type:'U4', unit:'ns' }, - { name:'nano', type:'I4', unit:'ns' }, - { name:'fixType', type:'U1', }, - { name:'flags', spec: [ - { name:'fixOk', type:'x1' }, // bit0:fixOk, - { name:'diffSol', type:'x1' }, // bit1:diffSol, - { name:'psmState', type:'x3' }, // bit2-4: psmState, - { name:'headVehVal', type:'x1' }, // bit5:headVehVal, - { name:'carrSol', type:'x2' } ] }, // bit6-7:carrSol - { name:'flags2', spec: [ - { type:'x5' }, - { name:'confirmedAvai', type:'x1' }, - { name:'confirmedDate', type:'x1' }, - { name:'confirmedTime', type:'x1' } ] }, - { name:'numSV', type:'U1', }, - { name:'lon', type:'I4', scale:1e-7, unit:'deg' }, - { name:'lat', type:'I4', scale:1e-7, unit:'deg' }, - { name:'height', type:'I4', scale:1e-3, unit:'m' }, - { name:'msl', type:'I4', scale:1e-3, unit:'m' }, - { name:'hAcc', type:'U4', scale:1e-3, unit:'m' }, - { name:'vAcc', type:'U4', scale:1e-3, unit:'m' }, - { name:'velN', type:'I4', scale:1e-3, unit:'m/s' }, - { name:'velE', type:'I4', scale:1e-3, unit:'m/s' }, - { name:'velD', type:'I4', scale:1e-3, unit:'m/s' }, - { name:'gSpeed', type:'U4', scale:1e-3, unit:'m/s' }, - { name:'headMot', type:'I4', scale:1e-5, unit:'deg' }, - { name:'sAcc', type:'U4', scale:1e-3, unit:'m/s' }, - { name:'cAcc', type:'U4', scale:1e-5, unit:'deg' }, - { name:'pDop', type:'U2', scale:1e-2, }, - { type:'U1[6]' }, - { name:'headVeh', type:'I4', scale:1e-5, unit:'deg' }, - { type:'U1[4]' }, ] }, - 'NAV-STATUS': { descr:'Receiver Navigation Status', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'gpsFix', type:'U1', }, // 0:no fix, 1:dead reckoning only, 2:2D-fix, 3:3D-fix, 4:GPS + dead reckoning combined, 5:Time only fix - { name:'flags', spec: [ - { name:'fixOk', type:'x1' }, // bit0:fixOk, - { name:'diffSol', type:'x1' }, // bit1:diffSol, - { name:'wknSet', type:'x1' }, // bit2:wknSet, - { name:'towSet', type:'x1' }, // bit3:towSet - { type:'x4' } ] }, - { name:'fixStat', spec: [ - { name:'dgpsIStat', type:'x1' }, // bit0:dgpsIStat, - { type:'x5' }, - { name:'mapMatching', type:'x2' } ] }, // bit6/7:mapMatching - { name:'flags2', spec: [ - { name:'psmState', type:'x2' }, // bit0/1:psmState, - { name:'spoofDetState', type:'x2' }, // bit3/4:spoofDetState - { type:'x4' } ] }, - { name:'ttff', type:'U4', scale:1e-3, unit:'s' }, - { name:'msss', type:'U4', scale:1e-3, unit:'s' }, ] }, - 'NAV-VELECEF': { descr:'Velocity Solution in ECEF', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'ecefVX', type:'I4', scale:1e-2, unit:'m/s' }, - { name:'ecefVY', type:'I4', scale:1e-2, unit:'m/s' }, - { name:'ecefVZ', type:'I4', scale:1e-2, unit:'m/s' }, - { name:'sAcc', type:'U4', scale:1e-2, unit:'m/s' }, ] }, - 'NAV-VELNED': { descr:'Velocity Solution in NED', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'velN', type:'I4', scale:1e-2, unit:'m/s' }, - { name:'velE', type:'I4', scale:1e-2, unit:'m/s' }, - { name:'velD', type:'I4', scale:1e-2, unit:'m/s' }, - { name:'speed', type:'U4', scale:1e-2, unit:'m/s' }, - { name:'gSpeed', type:'U4', scale:1e-2, unit:'m/s' }, - { name:'headMot', type:'I4', scale:1e-5, unit:'deg' }, - { name:'sAcc', type:'U4', scale:1e-2, unit:'m/s' }, - { name:'cAcc', type:'U4', scale:1e-5, unit:'deg' }, ] }, - 'NAV-SAT': { descr:'Satellite Information', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'version', type:'U1' }, - { name:'numSvs', type:'U1' }, - { type:'U1[2]' }, - { name:'svs', repeat:'numSvs', spec: [ - { name:'gnssId', type:'U1' }, - { name:'svId', type:'U1' }, // U:Used, e:Ephemeris but not used, -:Not used - { name:'cno', type:'U1', unit:'dBHz'}, - { name:'elv', type:'I1', unit:'deg' }, - { name:'azim', type:'I2', unit:'deg' }, - { name:'prRes', type:'I2', scale:0.1, unit:'m' }, - { name:'flags', spec: [ - { name:'qualityInd', type:'x3' }, // bit0..2:qualityInd, - { name:'svUsed', type:'x1' }, // bit3:svUsed, - { name:'healthy', type:'x2' }, // bit4..5:healthy, - { name:'diffCorr', type:'x1' }, // bit6:diffCorr - { name:'smoothed', type:'x1' }, // bit7:smoothed - { name:'orbitSource', type:'x3' }, // bit8..10:orbitSource - { name:'ephAvail', type:'x1' }, // bit11:ephAvail - { name:'almAvail', type:'x1' }, // bit12:almAvail - { name:'anoAvail', type:'x1' }, // bit13:anoAvail - { name:'aopAvail', type:'x1' }, // bit14:aopAvail - { type:'x1' }, - { name:'sbasCorrUsed', type:'x1' }, // bit16:sbasCorrUsed - { name:'rtcmCorrUsed', type:'x1' }, // bit17:rtcmCorrUsed - { name:'slasCorrUsed', type:'x1' }, // bit18:slasCorrUsed - { name:'spartnCorrUsed', type:'x1' }, // bit19:spartnCorrUsed - { name:'prCorrUsed', type:'x1' }, // bit20:prCorrUsed - { name:'crCorrUsed', type:'x1' }, // bit21:crCorrUsed - { name:'doCorrUsed', type:'x1' }, // bit22:doCorrUsed - { name:'clasCorrUsed', type:'x1' }, // bit23:clasCorrUsed - { type:'x8' } ] } ] }, ] }, + 'NAV-DOP': { + descr: 'Dilution of precision', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'gDop', type:'U2', scale:1e-2, }, + { name:'pDop', type:'U2', scale:1e-2, }, + { name:'tDop', type:'U2', scale:1e-2, }, + { name:'vDop', type:'U2', scale:1e-2, }, + { name:'hDop', type:'U2', scale:1e-2, }, + { name:'nDop', type:'U2', scale:1e-2, }, + { name:'eDop', type:'U2', scale:1e-2, }, ] }, + 'NAV-HPPOSLLH': { + descr: 'High Precision Geodetic Position Solution', + spec:[ { name:'version', type:'U1' }, + { type:'U1[3]' }, + { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'lon', type:'I4', scale:1e-7, unit:'deg' }, + { name:'lat', type:'I4', scale:1e-7, unit:'deg' }, + { name:'height', type:'I4', scale:1e-3, unit:'m' }, + { name:'msl', type:'I4', scale:1e-3, unit:'m' }, + { name:'lonHp', type:'I1', scale:1e-9, unit:'deg' }, + { name:'latHP', type:'I1', scale:1e-9, unit:'deg' }, ] }, + 'NAV-POSECEF': { + descr: 'Position Solution in ECEF', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'ecefX', type:'I4', scale:1e-2, unit:'m' }, + { name:'ecefY', type:'I4', scale:1e-2, unit:'m' }, + { name:'ecefZ', type:'I4', scale:1e-2, unit:'m' }, + { name:'pAcc', type:'U4', scale:1e-2, unit:'m' }, ] }, + 'NAV-POSLLH': { + descr: 'Geodetic Position Solution', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'lon', type:'I4', scale:1e-7, unit:'deg' }, + { name:'lat', type:'I4', scale:1e-7, unit:'deg' }, + { name:'height', type:'I4', scale:1e-3, unit:'m' }, + { name:'msl', type:'I4', scale:1e-3, unit:'m' }, + { name:'hAcc', type:'U4', scale:1e-3, unit:'m' }, + { name:'vAcc', type:'U4', scale:1e-3, unit:'m' }, ] }, + 'NAV-PL': { + descr: 'Protection Level', + spec:[ { name:'version', type:'U1', }, + { name:'tmirCoeff', type:'U1', }, + { name:'tmirExp', type:'U1', }, + { name:'plPosValid', type:'U1', }, + { name:'plPosFrame', type:'U1', }, + { name:'plVelValid', type:'U1', }, + { name:'plVelFrame', type:'U1', }, + { name:'plTimeValid', type:'U1', }, + { type:'U1[4]' }, + { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'plPos1', type:'U4', scale:1e-3, unit:'m' }, + { name:'plPos2', type:'U4', scale:1e-3, unit:'m' }, + { name:'plPos3', type:'U4', scale:1e-3, unit:'m' }, + { name:'plVel1', type:'U4', scale:1e-3, unit:'m/s' }, + { name:'plVel2', type:'U4', scale:1e-3, unit:'m/s' }, + { name:'plVel3', type:'U4', scale:1e-3, unit:'m/s' }, + { name:'plPosHorOr', type:'U2', scale:1e-2, unit:'deg' }, + { name:'plVelHorOr', type:'U2', scale:1e-2, unit:'deg' }, + { name:'plTime', type:'U4', }, ] }, + 'NAV-PVT': { + descr: 'Navigation Position Velocity Time Solution', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'year', type:'U2', unit:'y' }, + { name:'month', type:'U1', unit:'month' }, + { name:'day', type:'U1', unit:'d' }, + { name:'hour', type:'U1', unit:'h' }, + { name:'min', type:'U1', unit:'min' }, + { name:'sec', type:'U1', unit:'s' }, + { name:'valid', spec: [ + { name:'validDate', type:'x1' }, + { name:'validTime', type:'x1' }, + { name:'fullyResolved', type:'x1' }, + { type:'x5' } ] }, + { name:'tAcc', type:'U4', unit:'ns' }, + { name:'nano', type:'I4', unit:'ns' }, + { name:'fixType', type:'U1', }, + { name:'flags', spec: [ + { name:'fixOk', type:'x1' }, + { name:'diffSol', type:'x1' }, + { name:'psmState', type:'x3' }, + { name:'headVehVal', type:'x1' }, + { name:'carrSol', type:'x2' } ] }, + { name:'flags2', spec: [ + { type:'x5' }, + { name:'confirmedAvai', type:'x1' }, + { name:'confirmedDate', type:'x1' }, + { name:'confirmedTime', type:'x1' } ] }, + { name:'numSV', type:'U1', }, + { name:'lon', type:'I4', scale:1e-7, unit:'deg' }, + { name:'lat', type:'I4', scale:1e-7, unit:'deg' }, + { name:'height', type:'I4', scale:1e-3, unit:'m' }, + { name:'msl', type:'I4', scale:1e-3, unit:'m' }, + { name:'hAcc', type:'U4', scale:1e-3, unit:'m' }, + { name:'vAcc', type:'U4', scale:1e-3, unit:'m' }, + { name:'velN', type:'I4', scale:1e-3, unit:'m/s' }, + { name:'velE', type:'I4', scale:1e-3, unit:'m/s' }, + { name:'velD', type:'I4', scale:1e-3, unit:'m/s' }, + { name:'gSpeed', type:'U4', scale:1e-3, unit:'m/s' }, + { name:'headMot', type:'I4', scale:1e-5, unit:'deg' }, + { name:'sAcc', type:'U4', scale:1e-3, unit:'m/s' }, + { name:'cAcc', type:'U4', scale:1e-5, unit:'deg' }, + { name:'pDop', type:'U2', scale:1e-2, }, + { type:'U1[6]' }, + { name:'headVeh', type:'I4', scale:1e-5, unit:'deg' }, + { type:'U1[4]' } ] }, + 'NAV-STATUS': { + descr: 'Receiver Navigation Status', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'gpsFix', type:'U1', }, // 0:no fix, 1:dead reckoning only, 2:2D-fix, 3:3D-fix, 4:GPS + dead reckoning combined, 5:Time only fix + { name:'flags', spec: [ + { name:'fixOk', type:'x1' }, + { name:'diffSol', type:'x1' }, + { name:'wknSet', type:'x1' }, + { name:'towSet', type:'x1' }, + { type:'x4' } ] }, + { name:'fixStat', spec: [ + { name:'dgpsIStat', type:'x1' }, + { type:'x5' }, + { name:'mapMatching', type:'x2' } ] }, + { name:'flags2', spec: [ + { name:'psmState', type:'x2' }, + { name:'spoofDetState', type:'x2' }, + { type:'x4' } ] }, + { name:'ttff', type:'U4', scale:1e-3, unit:'s' }, + { name:'msss', type:'U4', scale:1e-3, unit:'s' } ] }, + 'NAV-VELECEF': { + descr: 'Velocity Solution in ECEF', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'ecefVX', type:'I4', scale:1e-2, unit:'m/s' }, + { name:'ecefVY', type:'I4', scale:1e-2, unit:'m/s' }, + { name:'ecefVZ', type:'I4', scale:1e-2, unit:'m/s' }, + { name:'sAcc', type:'U4', scale:1e-2, unit:'m/s' }, ] }, + 'NAV-VELNED': { + descr: 'Velocity Solution in NED', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'velN', type:'I4', scale:1e-2, unit:'m/s' }, + { name:'velE', type:'I4', scale:1e-2, unit:'m/s' }, + { name:'velD', type:'I4', scale:1e-2, unit:'m/s' }, + { name:'speed', type:'U4', scale:1e-2, unit:'m/s' }, + { name:'gSpeed', type:'U4', scale:1e-2, unit:'m/s' }, + { name:'headMot', type:'I4', scale:1e-5, unit:'deg' }, + { name:'sAcc', type:'U4', scale:1e-2, unit:'m/s' }, + { name:'cAcc', type:'U4', scale:1e-5, unit:'deg' } ] }, + 'NAV-SAT': { + descr: 'Satellite Information', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'version', type:'U1' }, + { name:'numSvs', type:'U1' }, + { type:'U1[2]' }, + { name:'svs', repeat:'numSvs', spec: [ + { name:'gnssId', type:'U1' }, + { name:'svId', type:'U1' }, // U:Used, e:Ephemeris but not used, -:Not used + { name:'cno', type:'U1', unit:'dBHz' }, + { name:'elv', type:'I1', unit:'deg' }, + { name:'azim', type:'I2', unit:'deg' }, + { name:'prRes', type:'I2', scale:0.1, unit:'m' }, + { name:'flags', spec: [ + { name:'qualityInd', type:'x3' }, + { name:'svUsed', type:'x1' }, + { name:'healthy', type:'x2' }, + { name:'diffCorr', type:'x1' }, + { name:'smoothed', type:'x1' }, + { name:'orbitSource', type:'x3' }, + { name:'ephAvail', type:'x1' }, + { name:'almAvail', type:'x1' }, + { name:'anoAvail', type:'x1' }, + { name:'aopAvail', type:'x1' }, + { type:'x1' }, + { name:'sbasCorrUsed', type:'x1' }, + { name:'rtcmCorrUsed', type:'x1' }, + { name:'slasCorrUsed', type:'x1' }, + { name:'spartnCorrUsed',type:'x1' }, + { name:'prCorrUsed', type:'x1' }, + { name:'crCorrUsed', type:'x1' }, + { name:'doCorrUsed', type:'x1' }, + { name:'clasCorrUsed', type:'x1' }, + { type:'x8' } ] } ] } ] }, // RXM ------------ - 'RXM-COR': { descr:'Differential correction input status', - spec:[ { name:'ver', type:'U1', }, - { name:'ebn0', type:'U1', scale:0.125, unit:'dB' }, - { type:'U1[2]' }, - { name:'statusInfo', type:'X4', }, - { name:'msgType', type:'U2', }, - { name:'msgSubType', type:'U2', } ] }, - 'RXM-PMP': { descr:'PMP point to multipoint', - spec:[ { name:'ver', type:'U1', }, - { /*name:'res0',*/ type:'U1', }, - { name:'numUserBytes',type:'U2', }, - { name:'timeTag', type:'U4' }, - { name:'uniqueWord', type:'U4[2]', }, - { name:'serviceId', type:'U2', }, - { /*name:'spare',*/ type:'U1', }, - { name:'bitErrors', type:'U1', }, - { name:'fecBits', type:'U2', }, - { name:'ebn0', type:'U1', scale:0.125, unit:'dB' }, - { /*name:'rese1',*/ type:'U1', }, - { name:'userData', type:'U1[504]', } ] }, - 'RXM-QZSSL6': { descr:'QZSS L6 message', - spec:[ { name:'ver', type:'U1', }, - { name:'svId', type:'U1', }, - { name:'cno', type:'U2', scale:0.00390625, unit:'dB' }, - { name:'timeTag', type:'U4' }, - { name:'groupDelay', type:'U1', }, - { name:'bitErrCorr', type:'U1', }, - { name:'chInfo', type:'U2', }, - { /*name:'res0',*/ type:'U1[2]' }, - { name:'msgBytes', type:'U1[250]', } ] }, + 'RXM-COR': { + descr: 'Differential correction input status', + spec:[ { name:'ver', type:'U1', }, + { name:'ebn0', type:'U1', scale:0.125, unit:'dB' }, + { type:'U1[2]' }, + { name:'statusInfo', type:'X4', }, + { name:'msgType', type:'U2', }, + { name:'msgSubType', type:'U2', } ] }, + 'RXM-PMP': { + descr: 'PMP point to multipoint', + spec:[ { name:'ver', type:'U1', }, + { /*name:'res0',*/ type:'U1', }, + { name:'numUserBytes', type:'U2', }, + { name:'timeTag', type:'U4' }, + { name:'uniqueWord', type:'U4[2]', }, + { name:'serviceId', type:'U2', }, + { /*name:'spare',*/ type:'U1', }, + { name:'bitErrors', type:'U1', }, + { name:'fecBits', type:'U2', }, + { name:'ebn0', type:'U1', scale:0.125, unit:'dB' }, + { /*name:'rese1',*/ type:'U1', }, + { name:'userData', type:'U1[504]', } ] }, + 'RXM-QZSSL6': { + descr: 'QZSS L6 message', + spec:[ { name:'ver', type:'U1', }, + { name:'svId', type:'U1', }, + { name:'cno', type:'U2',scale:0.00390625,unit:'dB'}, + { name:'timeTag', type:'U4' }, + { name:'groupDelay', type:'U1', }, + { name:'bitErrCorr', type:'U1', }, + { name:'chInfo', type:'U2', }, + { /*name:'res0',*/ type:'U1[2]' }, + { name:'msgBytes', type:'U1[250]', } ] }, // INF ------------ - 'INF-ERROR': { descr:'ASCII output with error contents', - spec:[ { name:'infTxt', type:'S*' }, ] }, - 'INF-WARNING': { descr:'ASCII output with warning contents', - spec:[ { name:'infTxt', type:'S*' }, ] }, - 'INF-NOTICE': { descr:'ASCII output with informational contents', - spec:[ { name:'infTxt', type:'S*' }, ] }, - 'INF-TEST': { descr:'ASCII output with test contents', - spec:[ { name:'infTxt', type:'S*' }, ] }, - 'INF-DEBUG': { descr:'ASCII output with debug contents', - spec:[ { name:'infTxt', type:'S*' }, ] }, + 'INF-ERROR': { + descr: 'ASCII output with error contents', + spec:[ { name:'infTxt', type:'S*' } ] }, + 'INF-WARNING': { + descr: 'ASCII output with warning contents', + spec:[ { name:'infTxt', type:'S*' } ] }, + 'INF-NOTICE': { + descr: 'ASCII output with informational contents', + spec:[ { name:'infTxt', type:'S*' } ] }, + 'INF-TEST': { + descr: 'ASCII output with test contents', + spec:[ { name:'infTxt', type:'S*' } ] }, + 'INF-DEBUG': { + descr:'ASCII output with debug contents', + spec:[ { name:'infTxt', type:'S*' } ] }, // ACK ------------ - 'ACK-NAK': { descr:'Message Not-Acknowledged', - spec:[ { name:'clsID', type:'U1' }, - { name:'msgID', type:'U1' }, ] }, - 'ACK-ACK': { descr:'Message Acknowledged', - spec:[ { name:'clsID', type:'U1' }, - { name:'msgID', type:'U1' }, ] }, + 'ACK-NAK': { + descr: 'Message Not-Acknowledged', + spec:[ { name:'clsID', type:'U1' }, + { name:'msgID', type:'U1' } ] }, + 'ACK-ACK': { + descr: 'Message Acknowledged', + spec:[ { name:'clsID', type:'U1' }, + { name:'msgID', type:'U1' } ] }, // CFG ------------ - 'CFG-PRT': { descr:'Port Configuration', - spec:[ { name:'portID', type:'U1' }, // 0:DDC/I2C/UART0 1:UART1 2:UART2 3:USB 4:SPI - { type:'X1' }, - { name:'txReady', type:'X2' }, - { name:'mode', type:'X4' }, // 8N1:0x000008D0 SPI:0x00000100 - { name:'baudRate', type:'U4' }, - { name:'inProtoMask', type:'X2' }, // bit0:UBX bit1:NMEA bit2:RTCM, bit5:RTCM3 - { name:'outProtoMask',type:'X2' }, - { name:'flags', type:'X4' }, ] }, - 'CFG-MSG': { descr:'Set Message Rate', - spec:[ { name:'clsID', type:'U1' }, - { name:'msgID', type:'U1' }, - { name:'rate', type:'U1[]' }, ] }, - 'CFG-INF': { descr:'Information message configuration', - spec:[ { name:'protocolID', type:'U1' }, // 0:UBX, 1:NMEA - { /*name:'res1',*/ type:'U1[3]' }, - { name:'infMsgMask', type:'U1[]' }, ] }, // bit0:ERROR, bit1:WARNING, bit2:NOTICE, bit3:TEST, bit4:DEBUG - 'CFG-RST': { descr:'Reset Receiver / Clear Backup Data Structures', - spec:[ { name:'navBbrMask', type:'X2' }, // 0x0000:Hotstart 0x0001:Warmstart 0xFFFF:Coldstart - { name:'resetMode', type:'U1' }, // 0:WD 1:SW 2:GNSS only 4:HD+WD 8:stop 9:start - { type:'X1' }, ] }, - 'CFG-CFG': { descr:'Clear, Save and Load configurations', - spec:[ { name:'clear', type:'X4' }, - { name:'save', type:'X4' }, - { name:'load', type:'X4' }, - { name:'deviceMask', type:'X1' }, ] }, // bit0:BBR bit1:FLASH bit2:EEPROM bit4:SPI - 'CFG-VALSET': { descr:'Sets values corresponding to provided key-value pairs', - spec:[ { name:'version', type:'U1' }, // 0/1 - { name:'layer', type:'U1' }, // 0:RAM, 1:BBR, 2:FLASH, 7:DEFAULT - { name:'transaction', type:'U1' }, // if (version == 1): 0:Transactionless, 1:(Re)Start deletion transaction, 2: Deletion transaction ongoing, 3: Apply and end a deletion transaction - { /*name:'res1',*/ type:'U1' }, - { name:'cfgData', type:'U1[]' }, ] }, // key/value pairs U4 + x1|x2|x4|x8 - 'CFG-VALGET': { descr:'Get Configuration Items', - spec:[ { name:'version', type:'U1' }, // set 1 - { name:'layers', type:'U1' }, // bit0:RAM, bit1:BBR, bit2:FLASH - { /*name:'res1',*/ type:'U1[2]' }, - { name:'cfgData', type:'U1[]' }, ] }, // key/value pairs U4 + x1|x2|x4|x8 - 'CFG-VALDEL': { descr:'Deletes values corresponding to provided keys', - spec:[ { name:'version', type:'U1' }, // set 0/1 - { name:'layers', type:'U1' }, // bit1:BBR, bit2:FLASH - { name:'transaction', type:'U1' }, // if (version == 1): 0:Transactionless, 1:(Re)Start deletion transaction, 2: Deletion transaction ongoing, 3: Apply and end a deletion transaction - { /*name:'res1',*/ type:'U1' }, - { name:'keys', type:'U4[]' }, ] }, // keys + 'CFG-PRT': { + descr: 'Port Configuration', + spec:[ { name:'portID', type:'U1' }, // 0:DDC/I2C/UART0 1:UART1 2:UART2 3:USB 4:SPI + { type:'X1' }, + { name:'txReady', type:'X2' }, + { name:'mode', type:'X4' }, // 8N1:0x000008D0 SPI:0x00000100 + { name:'baudRate', type:'U4' }, + { name:'inProtoMask', type:'X2' }, // bit0:UBX bit1:NMEA bit2:RTCM, bit5:RTCM3 + { name:'outProtoMask', type:'X2' }, + { name:'flags', type:'X4' } ] }, + 'CFG-MSG': { + descr: 'Set Message Rate', + spec:[ { name:'clsID', type:'U1' }, + { name:'msgID', type:'U1' }, + { name:'rate', type:'U1[]' } ] }, + 'CFG-INF': { + descr:'Information message configuration', + spec:[ { name:'protocolID', type:'U1' }, // 0:UBX, 1:NMEA + { /*name:'res1',*/ type:'U1[3]' }, + { name:'infMsgMask', type:'U1[]' } ] }, // bit0:ERROR, bit1:WARNING, bit2:NOTICE, bit3:TEST, bit4:DEBUG + 'CFG-RST': { + descr: 'Reset Receiver / Clear Backup Data Structures', + spec:[ { name:'navBbrMask', type:'X2' }, // 0x0000:Hotstart 0x0001:Warmstart 0xFFFF:Coldstart + { name:'resetMode', type:'U1' }, // 0:WD 1:SW 2:GNSS only 4:HD+WD 8:stop 9:start + { type:'X1' } ] }, + 'CFG-CFG': { + descr: 'Clear, Save and Load configurations', + spec:[ { name:'clear', type:'X4' }, + { name:'save', type:'X4' }, + { name:'load', type:'X4' }, + { name:'deviceMask', type:'X1' } ] }, // bit0:BBR bit1:FLASH bit2:EEPROM bit4:SPI + 'CFG-VALSET': { + descr: 'Sets values corresponding to provided key-value pairs', + spec:[ { name:'version', type:'U1' }, // 0/1 + { name:'layer', type:'U1' }, // 0:RAM, 1:BBR, 2:FLASH, 7:DEFAULT + { name:'transaction', type:'U1' }, // if (version == 1): 0:Transactionless, 1:(Re)Start deletion transaction, 2: Deletion transaction ongoing, 3: Apply and end a deletion transaction + { /*name:'res1',*/ type:'U1' }, + { name:'cfgData', type:'U1[]' } ] }, // key/value pairs U4 + x1|x2|x4|x8 + 'CFG-VALGET': { + descr: 'Get Configuration Items', + spec:[ { name:'version', type:'U1' }, // set 1 + { name:'layers', type:'U1' }, // bit0:RAM, bit1:BBR, bit2:FLASH + { /*name:'res1',*/ type:'U1[2]' }, + { name:'cfgData', type:'U1[]' } ] }, // key/value pairs U4 + x1|x2|x4|x8 + 'CFG-VALDEL': { + descr: 'Deletes values corresponding to provided keys', + spec:[ { name:'version', type:'U1' }, // set 0/1 + { name:'layers', type:'U1' }, // bit1:BBR, bit2:FLASH + { name:'transaction', type:'U1' }, // if (version == 1): 0:Transactionless, 1:(Re)Start deletion transaction, 2: Deletion transaction ongoing, 3: Apply and end a deletion transaction + { /*name:'res1',*/ type:'U1' }, + { name:'keys', type:'U4[]' } ] }, // keys // MON ------------ - 'MON-VER': { descr:'Receiver/Software Version', - spec:[ { name:'swVer', type:'S30' }, - { name:'hwVer', type:'S10' }, - { name:'extVer', type:'S30[]' }, ] }, - 'MON-PMP': { descr:'PMP monitoring data', - spec:[ { name:'version', type:'U1' }, - { name:'entries', type:'U1' }, - { /*name:'res0',*/ type:'U1[2]'}, - { name:'entry', repeat:'entries', spec: [ - { name:'timeTag', type:'U4', unit:'ms' }, - { name:'status', type:'X4' }, // bit0:locked, bit1:frameSync - { name:'lockTime', type:'U4', unit:'ms' }, - { name:'centerFreq',type:'U4',unit:'Hz' }, - { name:'cn0', type:'U1', unit:'dbHz' }, - { name:'cn0Frac', type:'U1', unit:'dbHz', scale:1./256, }, - { /*name:'res1',*/ type:'U1[2]'}, ] }, ] }, + 'MON-VER': { + descr: 'Receiver/Software Version', + spec:[ { name:'swVer', type:'S30' }, + { name:'hwVer', type:'S10' }, + { name:'extVer', type:'S30[]' } ] }, + 'MON-PMP': { + descr: 'PMP monitoring data', + spec:[ { name:'version', type:'U1' }, + { name:'entries', type:'U1' }, + { /*name:'res0',*/ type:'U1[2]' }, + { name:'entry', repeat:'entries', spec: [ + { name:'timeTag', type:'U4', unit:'ms' }, + { name:'status', spec: [ + { name:'locked', type:'x1' }, + { name:'frameSync', type:'x1' }, + { type:'x30' } ] }, + { name:'lockTime', type:'U4', unit:'ms' }, + { name:'centerFreq', type:'U4', unit:'Hz' }, + { name:'cn0', type:'U1', unit:'dbHz' }, + { name:'cn0Frac', type:'U1', unit:'dbHz',scale:1./256 }, + { /*name:'res1',*/ type:'U1[2]' } ] } ] }, // ESF ------------ - 'ESF-STATUS': { descr:'External Sensor Fusion Status', - spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, - { name:'version', type:'U1' }, - { /*name:'res0',*/ type:'U1[7]' }, - { name:'fusionMode', type:'U1' }, // 0:init, 1:fusion mode, 2:temp suspended, 3:disabled - { /*name:'res1',*/ type:'U1[2]' }, - { name:'numSens', type:'U1' }, - { name:'sensor', repeat:'numSens', spec: [ - { name:'sensStatus1', type:'X1' }, // bit0..5:type, bit6:used, bit7:ready - { name:'sensStatus2', type:'X1' }, // bit0..1:calibStatus, bit2..3:timeStatus - { name:'freq', type:'U1', unit:'Hz' }, - { name:'faults', type:'X1' }, ] }, ] }, // bit0:badMeas, bit1:badTtag, bit2:missingMeas, bit3:noisyMeas - 'MGA-GPS': { descr:'GPS Assistance Date', - spec:[ { name:'type', type:'U1' }, // 1:EPH, 2: ALM, 3:TIMEOFFSET, 4:HEALTH 5:UTC 6:IONO - { name:'version', type:'U1' }, - { name:'svid', type:'U1' }, - { name:'gnss', type:'U1' }, ] }, - 'MGA-GAL': { descr:'Galileo Assistance Date', - spec:[ { name:'type', type:'U1' }, - { name:'version', type:'U1' }, - { name:'svid', type:'U1' }, - { name:'gnss', type:'U1' }, ] }, - 'MGA-BDS': { descr:'Beidou Assistance Date', - spec:[ { name:'type', type:'U1' }, - { name:'version', type:'U1' }, - { name:'svid', type:'U1' }, - { name:'gnss', type:'U1' }, ] }, - 'MGA-QZSS': { descr:'QZSS Assistance Date', - spec:[ { name:'type', type:'U1' }, - { name:'version', type:'U1' }, - { name:'svid', type:'U1' }, - { name:'gnss', type:'U1' }, ] }, - 'MGA-GLO': { descr:'Glonass Assistance Date', - spec:[ { name:'type', type:'U1' }, - { name:'version', type:'U1' }, - { name:'svid', type:'U1' }, - { name:'gnss', type:'U1' }, ] }, - 'MGA-ANO': { spec:[ { name:'type', type:'U1' }, - { name:'version', type:'U1' }, - { name:'svid', type:'U1' }, - { name:'gnss', type:'U1' }, - { name:'year', type:'U1' }, - { name:'month', type:'U1' }, - { name:'day', type:'U1' }, - {/*name:'res1', */ type:'U1' }, - { name:'data', type:'U1[64]' }, - {/*name:'res2',*/ type:'U1[4]' }, ] }, - 'MGA-FLASH': { spec:[ { name:'type', type:'U1' }, // 1:DATA, 2:STOP, 3:ACK - { name:'version', type:'U1' }, - { name:'_data_', repeat:'((type==1)?1:0)', spec: [ - { name:'sequence', type:'U2' }, - { name:'size', type:'U2' }, - { name:'data', type:'U1[]' }, ] }, - { name:'_ack_', repeat:'((type==3)?1:0)', spec: [ - { name:'ack', type:'U1' }, - {/*name:'res1',*/ type:'U1' }, - { name:'sequence', type:'U2' }, ] }, - ] }, + 'ESF-STATUS': { + descr:'External Sensor Fusion Status', + spec:[ { name:'itow', type:'U4', scale:1e-3, unit:'s' }, + { name:'version', type:'U1' }, + { /*name:'res0',*/ type:'U1[7]' }, + { name:'fusionMode', type:'U1' }, // 0:init, 1:fusion mode, 2:temp suspended, 3:disabled + { /*name:'res1',*/ type:'U1[2]' }, + { name:'numSens', type:'U1' }, + { name:'sensor', repeat:'numSens', spec: [ + { name:'sensStatus1', spec: [ + { name:'type', type:'x6' }, + { name:'used', type:'x1' }, + { name:'ready', type:'x1' } ] }, + { name:'sensStatus1', spec: [ + { name:'calibStatus', type:'x2' }, + { name:'timeStatus', type:'x2' }, + { type:'x4' } ] }, + { name:'freq', type:'U1', unit:'Hz' }, + { name:'faults', spec: [ + { name:'badMeas', type:'x1' }, + { name:'badTtag', type:'x1' }, + { name:'missingMeas', type:'x1' }, + { name:'noisyMeas', type:'x1' }, + { type:'x4' } ] } ] } ] }, + 'MGA-GPS': { + descr: 'GPS Assistance Date', + spec:[ { name:'type', type:'U1' }, // 1:EPH, 2: ALM, 3:TIMEOFFSET, 4:HEALTH 5:UTC 6:IONO + { name:'version', type:'U1' }, + { name:'svid', type:'U1' }, + { name:'gnss', type:'U1' } ] }, + 'MGA-GAL': { + descr: 'Galileo Assistance Date', + spec:[ { name:'type', type:'U1' }, + { name:'version', type:'U1' }, + { name:'svid', type:'U1' }, + { name:'gnss', type:'U1' } ] }, + 'MGA-BDS': { + descr:'Beidou Assistance Date', + spec:[ { name:'type', type:'U1' }, + { name:'version', type:'U1' }, + { name:'svid', type:'U1' }, + { name:'gnss', type:'U1' }, ] }, + 'MGA-QZSS': { + descr:'QZSS Assistance Date', + spec:[ { name:'type', type:'U1' }, + { name:'version', type:'U1' }, + { name:'svid', type:'U1' }, + { name:'gnss', type:'U1' } ] }, + 'MGA-GLO': { + descr: 'Glonass Assistance Date', + spec:[ { name:'type', type:'U1' }, + { name:'version', type:'U1' }, + { name:'svid', type:'U1' }, + { name:'gnss', type:'U1' } ] }, + 'MGA-ANO': { + descr: 'Assist Now Offline', + spec:[ { name:'type', type:'U1' }, + { name:'version', type:'U1' }, + { name:'svid', type:'U1' }, + { name:'gnss', type:'U1' }, + { name:'year', type:'U1' }, + { name:'month', type:'U1' }, + { name:'day', type:'U1' }, + {/*name:'res1', */ type:'U1' }, + { name:'data', type:'U1[64]' }, + {/*name:'res2',*/ type:'U1[4]' } ] }, + 'MGA-FLASH': { + descr: 'Assist Now Flash Commands', + spec:[ { name:'type', type:'U1' }, // 1:DATA, 2:STOP, 3:ACK + { name:'version', type:'U1' }, + { name:'_data_', repeat:'((type==1)?1:0)', spec: [ + { name:'sequence', type:'U2' }, + { name:'size', type:'U2' }, + { name:'data', type:'U1[]' }, ] }, + { name:'_ack_', repeat:'((type==3)?1:0)', spec: [ + { name:'ack', type:'U1' }, + {/*name:'res1',*/ type:'U1' }, + { name:'sequence', type:'U2' } ] } ] } }; function ubxClsMsgId(cls,msg) { @@ -1084,194 +1137,234 @@ const ProtocolNMEA = (function () { // L:Lat/Long, T:Time, D:Date, // [xx]: Array, add optional size xx const spec = { - DTM:{ suggest:false, - descr: 'GNSS Satellite Fault Detection', - spec:[ { name:'datum', type:'S' }, - { name:'subDatum', type:'S' }, - { name:'offsetLat', type:'R', unit:'min' }, { name:'latI', type:'C' }, // N/S - { name:'offsetLong', type:'R', unit:'min' }, { name:'longI', type:'C' }, // E/W - { name:'offsetAlt', type:'R', unit:'m' }, - { name:'refDatum', type:'S' }, ] }, - GBS:{ suggest:false, - descr: 'GNSS Satellite Fault Detection', - spec:[ { name:'time', type:'T' }, - { name:'errLat', type:'R', unit:'m' }, - { name:'errLon', type:'R', unit:'m' }, - { name:'errAlt', type:'R', unit:'m' }, - { name:'svid', type:'U' }, - { name:'prob', type:'R' }, - { name:'bias', type:'R', unit:'m' }, - { name:'stddev', type:'R', unit:'m' }, - { name:'systemId', type:'U' }, - { name:'signalId', type:'U' }, ] }, - GGA:{ suggest:false, - descr: 'Global positioning system fix data', - spec:[ { name:'time', type:'T' }, - { name:'latN', type:'L' }, { name:'latI', type:'C' }, // N/S - { name:'longN', type:'L' }, { name:'longI', type:'C' }, // E/W - { name:'quality', type:'I' }, - { name:'numSV', type:'U' }, - { name:'hDop', type:'R' }, - { name:'msl', type:'R', unit:'m' }, {/*name:'mslI',*/ type:'C' }, - { name:'sep', type:'R', unit:'m' }, {/*name:'sepI',*/ type:'C' }, - { name:'diffAge', type:'I', unit:'s' }, - { name:'diffStation', type:'S' }, ] }, - GLL:{ suggest:false, - descr: 'Latitude and longitude, with time of position fix and status', - spec:[ { name:'latN', type:'L' }, { name:'latI', type:'C' }, - { name:'longN', type:'L' }, { name:'longI', type:'C' }, - { name:'time', type:'T' }, - { name:'status', type:'S' }, - { name:'posMode', type:'S' }, ] }, + DTM: { + suggest:false, + descr: 'GNSS Satellite Fault Detection', + spec:[ { name:'datum', type:'S' }, + { name:'subDatum', type:'S' }, + { name:'offsetLat', type:'R', unit:'min' }, + { name:'latI', type:'C' }, // N/S + { name:'offsetLong', type:'R', unit:'min' }, + { name:'longI', type:'C' }, // E/W + { name:'offsetAlt', type:'R', unit:'m' }, + { name:'refDatum', type:'S' } ] }, + GBS: { + suggest:false, + descr: 'GNSS Satellite Fault Detection', + spec:[ { name:'time', type:'T' }, + { name:'errLat', type:'R', unit:'m' }, + { name:'errLon', type:'R', unit:'m' }, + { name:'errAlt', type:'R', unit:'m' }, + { name:'svid', type:'U' }, + { name:'prob', type:'R' }, + { name:'bias', type:'R', unit:'m' }, + { name:'stddev', type:'R', unit:'m' }, + { name:'systemId', type:'U' }, + { name:'signalId', type:'U' } ] }, + GGA: { + suggest:false, + descr: 'Global positioning system fix data', + spec:[ { name:'time', type:'T' }, + { name:'latN', type:'L' }, + { name:'latI', type:'C' }, // N/S + { name:'longN', type:'L' }, + { name:'longI', type:'C' }, // E/W + { name:'quality', type:'I' }, + { name:'numSV', type:'U' }, + { name:'hDop', type:'R' }, + { name:'msl', type:'R', unit:'m' }, + {/*name:'mslI',*/ type:'C' }, + { name:'sep', type:'R', unit:'m' }, + {/*name:'sepI',*/ type:'C' }, + { name:'diffAge', type:'I', unit:'s' }, + { name:'diffStation', type:'S' } ] }, + GLL:{ + suggest:false, + descr: 'Latitude and longitude, with time of position fix and status', + spec:[ { name:'latN', type:'L' }, + { name:'latI', type:'C' }, + { name:'longN', type:'L' }, + { name:'longI', type:'C' }, + { name:'time', type:'T' }, + { name:'status', type:'S' }, + { name:'posMode', type:'S' } ] }, EIGNQ: { - descr: 'Poll a standard message', - spec:[ { name:'msgId', type:'S' }, ] }, - GNS:{ suggest:false, - descr: 'GNSS fix data' , - spec:[ { name:'time', type:'T' }, - { name:'latN', type:'L' }, { name:'latI', type:'C' }, - { name:'longN', type:'L' }, { name:'longI', type:'C' }, - { name:'posMode', type:'S' }, // two posModec chars for GPS + GLONASS - { name:'numSV', type:'U' }, - { name:'hDop', type:'R' }, - { name:'msl', type:'R', unit:'m' }, {/*name:'mslI',*/ type:'C' }, - { name:'sep', type:'R', unit:'m' }, {/*name:'sepI',*/ type:'C' }, - { name:'diffAge', type:'I', unit:'s' }, - { name:'diffStation', type:'S' }, - { name:'navStatus', type:'C' }, ] }, - GRS:{ suggest:false, - descr: 'GNSS Range Residuals', - spec:[ { name:'time', type:'T' }, - { name:'mode', type:'U' }, - { name:'residual', type:'R[12]', unit:'m' }, - { name:'systemId', type:'U' }, - { name:'signalId', type:'U' }, ] }, - GSA:{ suggest:false, - descr: 'GNSS DOP and Active Satellites', - spec:[ { name:'opMode', type:'S' }, - { name:'navMode', type:'U' }, - { name:'sv', type:'U[12]' }, - { name:'pDop', type:'R' }, - { name:'hDop', type:'R' }, - { name:'vDop', type:'R' }, - { name:'systemId', type:'U' }, ] }, - GST:{ suggest:false, - descr: 'GNSS Pseudo Range Error Statistics', - spec:[ { name:'time', type:'T' }, - { name:'rangeRms', type:'R', unit:'m' }, - { name:'stdMajor', type:'R', unit:'m' }, - { name:'stdMinor', type:'R', unit:'m' }, - { name:'orient', type:'R', unit:'deg' }, - { name:'stdLat', type:'R', unit:'m' }, - { name:'stdLong', type:'R', unit:'m' }, - { name:'stdAlt', type:'R', unit:'m' }, ] }, - GSV:{ suggest:false, - descr: 'GNSS Satellites in View', - spec:[ { name:'numMsg', type:'U' }, - { name:'msgNum', type:'U' }, - { name:'numSV', type:'U' }, - { name:'svs', repeat:'min(numSV-(msgNum-1)*4,4)', spec: [ - { name:'sv', type:'U' }, - { name:'elv', type:'U', unit:'deg' }, - { name:'az', type:'U', unit:'deg' }, - { name:'cno', type:'U', unit:'dBHz' }, ] }, - { name:'signalId', type:'U' }, ] }, - RMC:{ suggest:false, - descr: 'Recommended Minimum data', - spec:[ { name:'time', type:'T' }, - { name:'status', type:'C' }, - { name:'latN', type:'L' }, { name:'latI', type:'C' }, - { name:'longN', type:'L' }, { name:'longI', type:'C' }, - { name:'spdKn', type:'R', unit:'knots' }, - { name:'cogt', type:'R', unit:'deg' }, - { name:'date', type:'D' }, - { name:'mv', type:'R', unit:'deg' }, { name:'mvI', type:'C' }, // E/W - { name:'posMode', type:'S' }, - { name:'navStatus', type:'S' } ] }, - TXT:{ suggest:false, - descr: 'Text Transmission', - spec:[ { name:'msg', type:'U' }, - { name:'num', type:'U' }, - { name:'lvl', type:'U' }, - { name:'infTxt', type:'*' }, ] }, - VLW:{ suggest:false, - descr: 'Dual ground/water distance', - spec:[ { name:'twd', type:'R', unit:'nm' }, {/*name:'twdUnit',*/ type:'C' }, - { name:'wd', type:'R', unit:'nm' }, {/*name:'wdUnit',*/ type:'C' }, - { name:'tgd', type:'R', unit:'nm' }, {/*name:'tgdUnit',*/ type:'C' }, - { name:'gd', type:'R', unit:'nm' }, {/*name:'gdUnit',*/ type:'C' }, ] }, - VTG:{ suggest:false, - descr: '', - spec:[ { name:'cog', type:'R', unit:'deg' }, {/*name:'cogI',*/ type:'C' }, - { name:'cogm', type:'R', unit:'deg' }, {/*name:'cogmI',*/ type:'C' }, - { name:'spdKn', type:'R', unit:'knots' }, {/*name:'spdKnI',*/type:'C' }, - { name:'spdKm', type:'R', unit:'km/h' }, {/*name:'spdKmI',*/type:'C' }, - { name:'posMode', type:'S' }, ] }, - ZDA:{ suggest:false, - descr: 'Time and Date', - spec:[ { name:'time', type:'T' }, - { name:'day', type:'U' }, - { name:'month', type:'U' }, - { name:'year', type:'U' }, - { name:'ltzh', type:'I' }, ] }, + descr: 'Poll a standard message', + spec:[ { name:'msgId', type:'S' } ] }, + GNS:{ + suggest:false, + descr: 'GNSS fix data' , + spec:[ { name:'time', type:'T' }, + { name:'latN', type:'L' }, + { name:'latI', type:'C' }, + { name:'longN', type:'L' }, + { name:'longI', type:'C' }, + { name:'posMode', type:'S' }, // two posModec chars for GPS + GLONASS + { name:'numSV', type:'U' }, + { name:'hDop', type:'R' }, + { name:'msl', type:'R', unit:'m' }, + {/*name:'mslI',*/ type:'C' }, + { name:'sep', type:'R', unit:'m' }, + {/*name:'sepI',*/ type:'C' }, + { name:'diffAge', type:'I', unit:'s' }, + { name:'diffStation', type:'S' }, + { name:'navStatus', type:'C' } ] }, + GRS:{ + suggest:false, + descr: 'GNSS Range Residuals', + spec:[ { name:'time', type:'T' }, + { name:'mode', type:'U' }, + { name:'residual', type:'R[12]', unit:'m' }, + { name:'systemId', type:'U' }, + { name:'signalId', type:'U' } ] }, + GSA:{ + suggest:false, + descr: 'GNSS DOP and Active Satellites', + spec:[ { name:'opMode', type:'S' }, + { name:'navMode', type:'U' }, + { name:'sv', type:'U[12]' }, + { name:'pDop', type:'R' }, + { name:'hDop', type:'R' }, + { name:'vDop', type:'R' }, + { name:'systemId', type:'U' } ] }, + GST:{ + suggest:false, + descr: 'GNSS Pseudo Range Error Statistics', + spec:[ { name:'time', type:'T' }, + { name:'rangeRms', type:'R', unit:'m' }, + { name:'stdMajor', type:'R', unit:'m' }, + { name:'stdMinor', type:'R', unit:'m' }, + { name:'orient', type:'R', unit:'deg' }, + { name:'stdLat', type:'R', unit:'m' }, + { name:'stdLong', type:'R', unit:'m' }, + { name:'stdAlt', type:'R', unit:'m' } ] }, + GSV:{ + suggest:false, + descr: 'GNSS Satellites in View', + spec:[ { name:'numMsg', type:'U' }, + { name:'msgNum', type:'U' }, + { name:'numSV', type:'U' }, + { name:'svs', repeat:'min(numSV-(msgNum-1)*4,4)', spec: [ + { name:'sv', type:'U' }, + { name:'elv', type:'U', unit:'deg' }, + { name:'az', type:'U', unit:'deg' }, + { name:'cno', type:'U', unit:'dBHz' } ] }, + { name:'signalId', type:'U' } ] }, + RMC:{ + suggest:false, + descr: 'Recommended Minimum data', + spec:[ { name:'time', type:'T' }, + { name:'status', type:'C' }, + { name:'latN', type:'L' }, + { name:'latI', type:'C' }, + { name:'longN', type:'L' }, + { name:'longI', type:'C' }, + { name:'spdKn', type:'R', unit:'knots' }, + { name:'cogt', type:'R', unit:'deg' }, + { name:'date', type:'D' }, + { name:'mv', type:'R', unit:'deg' }, + { name:'mvI', type:'C' }, // E/W + { name:'posMode', type:'S' }, + { name:'navStatus', type:'S' } ] }, + TXT:{ + suggest:false, + descr: 'Text Transmission', + spec:[ { name:'msg', type:'U' }, + { name:'num', type:'U' }, + { name:'lvl', type:'U' }, + { name:'infTxt', type:'*' } ] }, + VLW:{ + suggest:false, + descr: 'Dual ground/water distance', + spec:[ { name:'twd', type:'R', unit:'nm' }, + {/*name:'twdUnit',*/ type:'C' }, + { name:'wd', type:'R', unit:'nm' }, + {/*name:'wdUnit',*/ type:'C' }, + { name:'tgd', type:'R', unit:'nm' }, + {/*name:'tgdUnit',*/ type:'C' }, + { name:'gd', type:'R', unit:'nm' }, + {/*name:'gdUnit',*/ type:'C' } ] }, + VTG:{ + suggest:false, + descr: 'Track made good and speed over ground', + spec:[ { name:'cog', type:'R', unit:'deg' }, + {/*name:'cogI',*/ type:'C' }, + { name:'cogm', type:'R', unit:'deg' }, + {/*name:'cogmI',*/ type:'C' }, + { name:'spdKn', type:'R', unit:'knots' }, + {/*name:'spdKnI',*/ type:'C' }, + { name:'spdKm', type:'R', unit:'km/h' }, + {/*name:'spdKmI',*/ type:'C' }, + { name:'posMode', type:'S' } ] }, + ZDA:{ + suggest:false, + descr: 'Time and Date', + spec:[ { name:'time', type:'T' }, + { name:'day', type:'U' }, + { name:'month', type:'U' }, + { name:'year', type:'U' }, + { name:'ltzh', type:'I' } ] }, // Proprietary Sentences aka PUBX 'PUBX,00':{ - suggest:false, - descr: 'Lat/Long Position Data', - spec:[ { name:'time', type:'T' }, - { name:'latN', type:'L' }, { name:'latI', type:'C' }, - { name:'longN', type:'L' }, { name:'longI', type:'C' }, - { name:'altRef', type:'R', unit:'m' }, - { name:'navStatus', type:'S' }, // e.g. NF:No Fix DR:Dead reckoning only solution - // G2:Stand alone 2D solution G3:Stand alone 3D solution - // D2:Differential 2D solution D3:Differential 3D solution - // RK:Combined GPS + dead reckoning solution TT:Time only solution - { name:'hAcc', type:'R', unit:'m' }, - { name:'vAcc', type:'R', unit:'m' }, - { name:'sog', type:'R', unit:'km/h' }, - { name:'cog', type:'R', unit:'deg' }, - { name:'vVel', type:'R', unit:'m/s' }, - { name:'diffAge', type:'I', unit:'s' }, - { name:'hDop', type:'R' }, - { name:'vDop', type:'R' }, - { name:'tDop', type:'R' }, - { name:'numSvs', type:'U' }, - { type:'S' }, - { name:'DRused', type:'U' }, ] }, + suggest:false, + descr: 'Lat/Long Position Data', + spec:[ { name:'time', type:'T' }, + { name:'latN', type:'L' }, + { name:'latI', type:'C' }, + { name:'longN', type:'L' }, + { name:'longI', type:'C' }, + { name:'altRef', type:'R', unit:'m' }, + { name:'navStatus', type:'S' }, + // e.g. NF:No Fix DR:Dead reckoning only solution + // G2:Stand alone 2D solution G3:Stand alone 3D solution + // D2:Differential 2D solution D3:Differential 3D solution + // RK:Combined GPS + dead reckoning solution TT:Time only solution + { name:'hAcc', type:'R', unit:'m' }, + { name:'vAcc', type:'R', unit:'m' }, + { name:'sog', type:'R', unit:'km/h' }, + { name:'cog', type:'R', unit:'deg' }, + { name:'vVel', type:'R', unit:'m/s' }, + { name:'diffAge', type:'I', unit:'s' }, + { name:'hDop', type:'R' }, + { name:'vDop', type:'R' }, + { name:'tDop', type:'R' }, + { name:'numSvs', type:'U' }, + { type:'S' }, + { name:'DRused', type:'U' } ] }, 'PUBX,03':{ - suggest:false, - descr: 'Satellite Status', - spec:[ { name:'numSV', type:'U' }, - { name:'svs', spec: [ - { name:'sv', type:'U' }, - { name:'status', type:'U' }, // U:Used, e:Ephemeris but not used, -:Not used - { name:'az', type:'U', unit:'deg' }, - { name:'elv', type:'U', unit:'deg' }, - { name:'cno', type:'U', unit:'dBHz' }, - { name:'lck', type:'U', unit:'s' }, ] }, ] }, + suggest:false, + descr: 'Satellite Status', + spec:[ { name:'numSV', type:'U' }, + { name:'svs', spec: [ + { name:'sv', type:'U' }, + { name:'status', type:'U' }, // U:Used, e:Ephemeris but not used, -:Not used + { name:'az', type:'U', unit:'deg' }, + { name:'elv', type:'U', unit:'deg' }, + { name:'cno', type:'U', unit:'dBHz' }, + { name:'lck', type:'U', unit:'s' } ] } ] }, 'PUBX,04':{ - suggest:false, - descr: 'Time of Day and Clock Information', - spec:[ { name:'time', type:'T', unit:'hhmmss.ss' }, - { name:'date', type:'D', unit:'ddmmyy' }, - { name:'utcTow', type:'R', unit:'s' }, - { name:'utcWk', type:'U', unit:'weeks' }, - { name:'leapSec', type:'S', unit:'s' }, - { name:'clkBias', type:'R', unit:'ns' }, - { name:'clkDrift', type:'R', unit:'ns/s' }, - { name:'tpGran', type:'R', unit:'ns' }, ] }, + suggest:false, + descr: 'Time of Day and Clock Information', + spec:[ { name:'time', type:'T', unit:'hhmmss.ss' }, + { name:'date', type:'D', unit:'ddmmyy' }, + { name:'utcTow', type:'R', unit:'s' }, + { name:'utcWk', type:'U', unit:'weeks' }, + { name:'leapSec', type:'S', unit:'s' }, + { name:'clkBias', type:'R', unit:'ns' }, + { name:'clkDrift', type:'R', unit:'ns/s' }, + { name:'tpGran', type:'R', unit:'ns' } ] }, 'PUBX,40':{ - descr: 'Set NMEA message output rate', - spec:[ { name:'msgID', type:'Q' }, - { name:'rate', type:'U[6]' }, ] }, + descr: 'Set NMEA message output rate', + spec:[ { name:'msgID', type:'Q' }, + { name:'rate', type:'U[6]' } ] }, 'PUBX,41':{ - descr: 'Set Protocols and Baudrate', - spec:[ { name:'portId', type:'U' }, - { name:'inProto', type:'X' }, - { name:'outProto', type:'X' }, - { name:'baudrate', type:'U', unit:'bits/s' }, - { name:'autobauding', type:'U' }, ] }, + descr: 'Set Protocols and Baudrate', + spec:[ { name:'portId', type:'U' }, + { name:'inProto', type:'X' }, + { name:'outProto', type:'X' }, + { name:'baudrate', type:'U', unit:'bits/s' }, + { name:'autobauding', type:'U' } ] }, }; function parse(data, i) { @@ -1357,79 +1450,79 @@ return { process: process, parse: parse, make:make, spec:spec }; const ProtocolRTCM3 = (function () { const spec = { - 1001: { descr: 'L1-only GPS RTK observables', }, - 1002: { descr: 'Extended L1-only GPS RTK observables', }, - 1003: { descr: 'L1 & L2 GPS RTK observables', }, - 1004: { descr: 'Extended L1 & L2 GPS RTK observables', }, - 1005: { descr: 'Stationary RTK reference station ARP', }, - 1006: { descr: 'Stationary RTK reference station ARP with antenna height', }, - 1007: { descr: 'Antenna descriptor', }, - 1009: { descr: 'L1-only GLONASS RTK observables', }, - 1010: { descr: 'Extended L1-only GLONASS RTK observables', }, - 1011: { descr: 'L1 & L2 GLONASS RTK observables', }, - 1012: { descr: 'Extended L1 & L2 GLONASS RTK observables', }, - 1074: { descr: 'GPS MSM4', }, - 1077: { descr: 'GPS MSM7', }, - 1084: { descr: 'GLONASS MSM4', }, - 1087: { descr: 'GLONASS MSM7', }, - 1094: { descr: 'Galileo MSM4', }, - 1097: { descr: 'Galileo MSM7', }, - 1124: { descr: 'BeiDou MSM4', }, - 1127: { descr: 'BeiDou MSM7', }, - 4072: { descr: 'u-blox proprietary message', }, - '4072.0': { descr: 'u-blox sub-type 0: Reference station PVT', }, - '4072.1': { descr: 'u-blox sub-type 1: Additional reference station information', }, + 1001: { descr: 'L1-only GPS RTK observables' }, + 1002: { descr: 'Extended L1-only GPS RTK observables' }, + 1003: { descr: 'L1 & L2 GPS RTK observables' }, + 1004: { descr: 'Extended L1 & L2 GPS RTK observables' }, + 1005: { descr: 'Stationary RTK reference station ARP' }, + 1006: { descr: 'Stationary RTK reference station ARP with antenna height' }, + 1007: { descr: 'Antenna descriptor' }, + 1009: { descr: 'L1-only GLONASS RTK observables' }, + 1010: { descr: 'Extended L1-only GLONASS RTK observables' }, + 1011: { descr: 'L1 & L2 GLONASS RTK observables' }, + 1012: { descr: 'Extended L1 & L2 GLONASS RTK observables' }, + 1074: { descr: 'GPS MSM4' }, + 1077: { descr: 'GPS MSM7' }, + 1084: { descr: 'GLONASS MSM4' }, + 1087: { descr: 'GLONASS MSM7' }, + 1094: { descr: 'Galileo MSM4' }, + 1097: { descr: 'Galileo MSM7' }, + 1124: { descr: 'BeiDou MSM4' }, + 1127: { descr: 'BeiDou MSM7' }, + 4072: { descr: 'u-blox proprietary message' }, + '4072.0': { descr: 'u-blox sub-type 0: Reference station PVT' }, + '4072.1': { descr: 'u-blox sub-type 1: Additional reference station information' }, // not used by u-blox // https://www.use-snip.com/kb/knowledge-base/rtcm-3-message-list/ - 1008: { descr: 'Antenna Descriptor and Serial Number', }, - 1013: { descr: 'System Parameters, time offsets, lists of messages sent', }, - 1014: { descr: 'Network Auxiliary Station Data', }, - 1015: { descr: 'GPS Ionospheric Correction Differences', }, - 1016: { descr: 'GPS Geometric Correction Differences', }, - 1017: { descr: 'GPS Combined Geometric and Ionospheric Correction Differences', }, - 1019: { descr: 'GPS Broadcast Ephemeris (orbits)', }, - 1020: { descr: 'GLONASS Broadcast Ephemeris (orbits)', }, - 1021: { descr: 'Helmert / Abridged Molodenski Transformation Parameters', }, - 1022: { descr: 'Molodenski-Badekas Transformation Parameters', }, - 1023: { descr: 'Residuals, Ellipsoidal Grid Representation', }, - 1024: { descr: 'Residuals, Plane Grid Representation', }, - 1025: { descr: 'Projection Parameters, Projection Types other than Lambert Conic Conformal', }, - 1026: { descr: 'Projection Parameters, Projection Type LCC2SP (Lambert Conic Conformal', }, - 1027: { descr: 'Projection Parameters, Projection Type OM (Oblique Mercator)', }, + 1008: { descr: 'Antenna Descriptor and Serial Number' }, + 1013: { descr: 'System Parameters, time offsets, lists of messages sent' }, + 1014: { descr: 'Network Auxiliary Station Data' }, + 1015: { descr: 'GPS Ionospheric Correction Differences' }, + 1016: { descr: 'GPS Geometric Correction Differences' }, + 1017: { descr: 'GPS Combined Geometric and Ionospheric Correction Differences' }, + 1019: { descr: 'GPS Broadcast Ephemeris (orbits)' }, + 1020: { descr: 'GLONASS Broadcast Ephemeris (orbits)' }, + 1021: { descr: 'Helmert / Abridged Molodenski Transformation Parameters' }, + 1022: { descr: 'Molodenski-Badekas Transformation Parameters' }, + 1023: { descr: 'Residuals, Ellipsoidal Grid Representation' }, + 1024: { descr: 'Residuals, Plane Grid Representation' }, + 1025: { descr: 'Projection Parameters, Projection Types other than Lambert Conic Conformal' }, + 1026: { descr: 'Projection Parameters, Projection Type LCC2SP (Lambert Conic Conformal' }, + 1027: { descr: 'Projection Parameters, Projection Type OM (Oblique Mercator)' }, 1029: { descr: 'Unicode Text String (used for human readable text)', - spec:[ { name:'refSta', type:'u12' }, // bit 12..23: Ref Station Id - { name:'mjdDay', type:'u16' }, // bit 24..47: MJD - day of year - { name:'mjdSec', type:'u17' }, // bit 48..56: UTC - sec of day - { name:'nUnicode', type:'u7' }, // bit 57..63: unicode Chars, - { name:'nUtf8', type:'U1' }, // num chars in utf8 (N) - { name:'txtUtf8', type:'S*' } ]}, // utf8(N) - 1030: { descr: 'GPS Network RTK Residual Message', }, - 1031: { descr: 'GLONASS Network RTK Residual', }, - 1032: { descr: 'Physical Reference Station Position', }, - 1033: { descr: 'Receiver and Antenna Descriptors', }, - 1034: { descr: 'GPS Network FKP Gradient', }, - 1035: { descr: 'GLONASS Network FKP Gradient', }, - 1036: { descr: 'Not defined at this time', }, - 1037: { descr: 'GLONASS Ionospheric Correction Differences', }, - 1038: { descr: 'GLONASS Geometric Correction Differences', }, - 1039: { descr: 'GLONASS Combined Geometric and Ionospheric Correction Differences', }, - 1042: { descr: 'BDS Satellite Ephemeris Data', }, - 1044: { descr: 'QZSS Ephemerides', }, - 1045: { descr: 'Galileo Broadcast Ephemeris', }, - 1046: { descr: 'Galileo I/NAV Satellite Ephemeris Data' }, - 1057: { descr: 'SSR GPS orbit corrections to Broadcast Ephemeris', }, - 1058: { descr: 'SSR GPS clock corrections to Broadcast Ephemeris', }, - 1059: { descr: 'SSR GPS code biases', }, - 1060: { descr: 'SSR Combined orbit and clock corrections to GPS Broadcast Ephemeris', }, - 1061: { descr: 'SSR GPS User Range Accuracy', }, - 1062: { descr: 'SSR High-rate GPS clock corrections to Broadcast Ephemeris', }, - 1063: { descr: 'SSR GLONASS orbit corrections for Broadcast Ephemeris', }, - 1064: { descr: 'SSR GLONASS clock corrections for Broadcast Ephemeris', }, - 1065: { descr: 'SSR GLONASS code biases', }, - 1066: { descr: 'SSR Combined orbit and clock corrections to GLONASS Broadcast Ephemeris', }, - 1067: { descr: 'SSR GLONASS User Range Accuracy (URA)', }, - 1068: { descr: 'High-rate GLONASS clock corrections to Broadcast Ephemeris', }, + spec:[ { name:'refSta', type:'u12' }, // bit 12..23: Ref Station Id + { name:'mjdDay', type:'u16' }, // bit 24..47: MJD - day of year + { name:'mjdSec', type:'u17' }, // bit 48..56: UTC - sec of day + { name:'nUnicode', type:'u7' }, // bit 57..63: unicode Chars, + { name:'nUtf8', type:'U1' }, // num chars in utf8 (N) + { name:'txtUtf8', type:'S*' } ]}, // utf8(N) + 1030: { descr: 'GPS Network RTK Residual Message' }, + 1031: { descr: 'GLONASS Network RTK Residual' }, + 1032: { descr: 'Physical Reference Station Position' }, + 1033: { descr: 'Receiver and Antenna Descriptors' }, + 1034: { descr: 'GPS Network FKP Gradient' }, + 1035: { descr: 'GLONASS Network FKP Gradient' }, + 1036: { descr: 'Not defined at this time' }, + 1037: { descr: 'GLONASS Ionospheric Correction Differences' }, + 1038: { descr: 'GLONASS Geometric Correction Differences' }, + 1039: { descr: 'GLONASS Combined Geometric and Ionospheric Correction Differences' }, + 1042: { descr: 'BDS Satellite Ephemeris Data' }, + 1044: { descr: 'QZSS Ephemerides' }, + 1045: { descr: 'Galileo Broadcast Ephemeris' }, + 1046: { descr: 'Galileo I/NAV Satellite Ephemeris Data' }, + 1057: { descr: 'SSR GPS orbit corrections to Broadcast Ephemeris' }, + 1058: { descr: 'SSR GPS clock corrections to Broadcast Ephemeris' }, + 1059: { descr: 'SSR GPS code biases' }, + 1060: { descr: 'SSR Combined orbit and clock corrections to GPS Broadcast Ephemeris' }, + 1061: { descr: 'SSR GPS User Range Accuracy' }, + 1062: { descr: 'SSR High-rate GPS clock corrections to Broadcast Ephemeris' }, + 1063: { descr: 'SSR GLONASS orbit corrections for Broadcast Ephemeris' }, + 1064: { descr: 'SSR GLONASS clock corrections for Broadcast Ephemeris' }, + 1065: { descr: 'SSR GLONASS code biases' }, + 1066: { descr: 'SSR Combined orbit and clock corrections to GLONASS Broadcast Ephemeris' }, + 1067: { descr: 'SSR GLONASS User Range Accuracy (URA)' }, + 1068: { descr: 'High-rate GLONASS clock corrections to Broadcast Ephemeris' }, /* MSM1 DGNSS uses, Pseudorange, (conventional and advanced) MSM2 RTK uses, Pseudorange only @@ -1439,41 +1532,41 @@ const spec = { MSM6 RTK uses, Pseudorange, PhaseRange CNR, with high resolution MSM7 RTK uses, Pseudorange, PhaseRange, Doppler, CNR, with high resolution */ - 1071: { descr: 'GPS MSM1', }, - 1072: { descr: 'GPS MSM2', }, - 1073: { descr: 'GPS MSM3', }, - 1075: { descr: 'GPS MSM5', }, - 1076: { descr: 'GPS MSM6', }, - 1081: { descr: 'GLONASS MSM1', }, - 1082: { descr: 'GLONASS MSM2', }, - 1083: { descr: 'GLONASS MSM3', }, - 1085: { descr: 'GLONASS MSM5', }, - 1086: { descr: 'GLONASS MSM6', }, - 1091: { descr: 'Galileo MSM1', }, - 1092: { descr: 'Galileo MSM2', }, - 1093: { descr: 'Galileo MSM3', }, - 1095: { descr: 'Galileo MSM5', }, - 1096: { descr: 'Galileo MSM6', }, - 1101: { descr: 'SBAS MSM1', }, - 1102: { descr: 'SBAS MSM2', }, - 1103: { descr: 'SBAS MSM3', }, - 1104: { descr: 'SBAS MSM4', }, - 1105: { descr: 'SBAS MSM5', }, - 1106: { descr: 'SBAS MSM6', }, - 1107: { descr: 'SBAS MSM7', }, - 1111: { descr: 'QZSS MSM1', }, - 1112: { descr: 'QZSS MSM2', }, - 1113: { descr: 'QZSS MSM3', }, - 1114: { descr: 'QZSS MSM4', }, - 1115: { descr: 'QZSS MSM5', }, - 1116: { descr: 'QZSS MSM6', }, - 1117: { descr: 'QZSS MSM7', }, - 1121: { descr: 'BeiDou MSM1', }, - 1122: { descr: 'BeiDou MSM2', }, - 1123: { descr: 'BeiDou MSM3', }, - 1125: { descr: 'BeiDou MSM5', }, - 1126: { descr: 'BeiDou MSM6', }, - 1230: { descr: 'GLONASS L1 and L2 Code-Phase Biases', }, + 1071: { descr: 'GPS MSM1' }, + 1072: { descr: 'GPS MSM2' }, + 1073: { descr: 'GPS MSM3' }, + 1075: { descr: 'GPS MSM5' }, + 1076: { descr: 'GPS MSM6' }, + 1081: { descr: 'GLONASS MSM1' }, + 1082: { descr: 'GLONASS MSM2' }, + 1083: { descr: 'GLONASS MSM3' }, + 1085: { descr: 'GLONASS MSM5' }, + 1086: { descr: 'GLONASS MSM6' }, + 1091: { descr: 'Galileo MSM1' }, + 1092: { descr: 'Galileo MSM2' }, + 1093: { descr: 'Galileo MSM3' }, + 1095: { descr: 'Galileo MSM5' }, + 1096: { descr: 'Galileo MSM6' }, + 1101: { descr: 'SBAS MSM1' }, + 1102: { descr: 'SBAS MSM2' }, + 1103: { descr: 'SBAS MSM3' }, + 1104: { descr: 'SBAS MSM4' }, + 1105: { descr: 'SBAS MSM5' }, + 1106: { descr: 'SBAS MSM6' }, + 1107: { descr: 'SBAS MSM7' }, + 1111: { descr: 'QZSS MSM1' }, + 1112: { descr: 'QZSS MSM2' }, + 1113: { descr: 'QZSS MSM3' }, + 1114: { descr: 'QZSS MSM4' }, + 1115: { descr: 'QZSS MSM5' }, + 1116: { descr: 'QZSS MSM6' }, + 1117: { descr: 'QZSS MSM7' }, + 1121: { descr: 'BeiDou MSM1' }, + 1122: { descr: 'BeiDou MSM2' }, + 1123: { descr: 'BeiDou MSM3' }, + 1125: { descr: 'BeiDou MSM5' }, + 1126: { descr: 'BeiDou MSM6' }, + 1230: { descr: 'GLONASS L1 and L2 Code-Phase Biases' } }; function parse(data, i) { @@ -1591,44 +1684,44 @@ const mapType = { 0:'OCB', 1:'HPAC', 2:'GAD', 3:'BPAC', 4:'EAS', 120:'PROP', } const mapSubType = { - 0/*OCB*/: { 0:'GPS', 1:'GLONASS', 2:'GALILEO', 3:'BEIDOU', 4:'QZSS', }, - 1/*HPAC*/: { 0:'GPS', 1:'GLONASS', 2:'GALILEO', 3:'BEIDOU', 4:'QZSS', }, - 2/*GAD*/: { 0:'MSG0', }, - 3/*BPAC*/: { 0:'POLYNOMIAL' }, - 4/*EAS*/: { 0:'DYNAMICKEY', 1:'GROUPAUTH', }, - 120/*PROP*/: { 0:'SAPCORDA', 1:'UBLOX', 2:'SWIFT', } + 0/*OCB*/: { 0:'GPS', 1:'GLONASS', 2:'GALILEO', 3:'BEIDOU', 4:'QZSS' }, + 1/*HPAC*/: { 0:'GPS', 1:'GLONASS', 2:'GALILEO', 3:'BEIDOU', 4:'QZSS' }, + 2/*GAD*/: { 0:'MSG0' }, + 3/*BPAC*/: { 0:'POLYNOMIAL' }, + 4/*EAS*/: { 0:'DYNAMICKEY', 1:'GROUPAUTH' }, + 120/*PROP*/: { 0:'SAPCORDA', 1:'UBLOX', 2:'SWIFT' } } const spec = { // type 0: GNSS Orbit, Clock, Bias (OCB) messages - 'OCB' : { descr: 'GNSS Orbit, Clock, Bias', }, - 'OCB-GPS' : { descr: 'GPS Orbit, Clock, Bias', }, - 'OCB-GLONASS' : { descr: 'Glonass Orbit, Clock, Bias', }, - 'OCB-GALILEO' : { descr: 'Galileo Orbit, Clock, Bias', }, - 'OCB-BEIDOU' : { descr: 'BeiDou Orbit, Clock, Bias', }, - 'OCB-QZSS' : { descr: 'QZSS Orbit, Clock, Bias', }, - // type 1: High-precision atmosphere correction (HPAC) messages - 'HPAC' : { descr: 'GNSS High-precision atmosphere correction', }, - 'HPAC-GPS' : { descr: 'GPS High-precision atmosphere correction', }, - 'HPAC-GLONASS' : { descr: 'Glonass High-precision atmosphere correction', }, - 'HPAC-GALILEO' : { descr: 'Galileo High-precision atmosphere correction', }, - 'HPAC-BEIDOU' : { descr: 'BeiDou High-precision atmosphere correction', }, - 'HPAC-QZSS' : { descr: 'QZSS High-precision atmosphere correction', }, - // type 2: Geographic Area Definition (GAD) messages - 'GAD' : { descr: 'Geographic Area Definition', }, - 'GAD-MSG0' : { descr: 'Geographic Area Definition', }, - // type 3: Basic-peecision atmosphere correction (BPAC) messages - 'BPAC' : { descr: 'Basic-precision atmosphere correction', }, - 'BPAC-POLYNOMIAL' : { descr: 'Basic-precision atmosphere correction polynomial', }, - // type 4: Encryption and Authentication Support (EAS) messages - 'EAS' : { descr: 'Encryption and Authentication Support', }, - 'EAS-DYNAMICKEY' : { descr: 'Dynamic Key', }, - 'EAS-GROUPAUTH' : { descr: 'Group Authentication', }, - // type 120: Proprietary messages - 'PROP' : { descr: 'Proprietary', }, - 'PROP-SAPCORDA' : { descr: 'Proprietary Sapcorda', }, - 'PROP-UBLOX' : { descr: 'Proprietary u-blox AG', }, - 'PROP-SWIFT' : { descr: 'Proprietary Swift Navigation', }, + 'OCB' : { descr: 'GNSS Orbit, Clock, Bias' }, + 'OCB-GPS' : { descr: 'GPS Orbit, Clock, Bias' }, + 'OCB-GLONASS' : { descr: 'Glonass Orbit, Clock, Bias' }, + 'OCB-GALILEO' : { descr: 'Galileo Orbit, Clock, Bias' }, + 'OCB-BEIDOU' : { descr: 'BeiDou Orbit, Clock, Bias' }, + 'OCB-QZSS' : { descr: 'QZSS Orbit, Clock, Bias' }, + // type 1: High-precision atmosphere correction (HPAC) messages + 'HPAC' : { descr: 'GNSS High-precision atmosphere correction' }, + 'HPAC-GPS' : { descr: 'GPS High-precision atmosphere correction' }, + 'HPAC-GLONASS' : { descr: 'Glonass High-precision atmosphere correction' }, + 'HPAC-GALILEO' : { descr: 'Galileo High-precision atmosphere correction' }, + 'HPAC-BEIDOU' : { descr: 'BeiDou High-precision atmosphere correction' }, + 'HPAC-QZSS' : { descr: 'QZSS High-precision atmosphere correction' }, + // type 2: Geographic Area Definition (GAD) messages + 'GAD' : { descr: 'Geographic Area Definition' }, + 'GAD-MSG0' : { descr: 'Geographic Area Definition' }, + // type 3: Basic-peecision atmosphere correction (BPAC) messages + 'BPAC' : { descr: 'Basic-precision atmosphere correction' }, + 'BPAC-POLYNOMIAL' : { descr: 'Basic-precision atmosphere correction polynomial' }, + // type 4: Encryption and Authentication Support (EAS) messages + 'EAS' : { descr: 'Encryption and Authentication Support' }, + 'EAS-DYNAMICKEY' : { descr: 'Dynamic Key' }, + 'EAS-GROUPAUTH' : { descr: 'Group Authentication' }, + // type 120: Proprietary messages + 'PROP' : { descr: 'Proprietary' }, + 'PROP-SAPCORDA' : { descr: 'Proprietary Sapcorda' }, + 'PROP-UBLOX' : { descr: 'Proprietary u-blox AG' }, + 'PROP-SWIFT' : { descr: 'Proprietary Swift Navigation' } }; function parse(data, i) { diff --git a/monitor/js/monitor.js b/monitor/js/monitor.js index baff770..1c85a39 100644 --- a/monitor/js/monitor.js +++ b/monitor/js/monitor.js @@ -39,7 +39,8 @@ window.onload = function _onload() { const href = window.location.href.replace(/^https:/, 'http:'); if (confirm('This page does not work when loaded with secure https: protocol. ' + 'The insecure ws: websocket connection used to connect to the device would cause mixed content issues.'+ - '\n\nRedirect to ' + href)) { + '\n\nRedirect to ' + href + '\n\n' + + 'If this does not work for you, type http: protocol in the address bar manually!')) { window.open(href,'_self'); } } diff --git a/software/WEBSOCKET.h b/software/WEBSOCKET.h index cb7d550..def94be 100644 --- a/software/WEBSOCKET.h +++ b/software/WEBSOCKET.h @@ -308,28 +308,28 @@ WEBSOCKET Websocket; //!< The global WEBSOCKET peripherial object // -------------------------------------------------------------------------------------- //! the content of served file monitor.html -const char WEBSOCKET::HTML[] = R"html( +const char WEBSOCKET::HTML[] = R"( - - + + - Monitor + )" WEBSOCKET_BUTTON R"( -

Monitor

+

)" WEBSOCKET_BUTTON R"(

-)html"; +)"; //! the content of served file monitor.css -const char WEBSOCKET::CSS[] = R"css( +const char WEBSOCKET::CSS[] = R"( body { display: grid; grid-gap: 1em; @@ -364,10 +364,10 @@ const char WEBSOCKET::CSS[] = R"css( outline: none; box-sizing: border-box; } -)css"; +)"; //! the content of served file monitor.js -const char WEBSOCKET::JS[] = R"js( +const char WEBSOCKET::JS[] = R"( "use strict"; let map = null; let track = null; @@ -442,7 +442,7 @@ const char WEBSOCKET::JS[] = R"js( ws.addEventListener('message', ({ data }) => { if (typeof(data) == 'string') { log(`${data}`) - // time src fix car acc lat lon + // time src fix car acc lat lon const m = data.match(/^\d+:\d+:\d+ [\w-]+ (\S+) \w+ \d+\.\d+ (-?\d+\.\d+) (-?\d+\.\d+)/) if (map && track && m) { if (m[1] != "No") { @@ -461,6 +461,6 @@ const char WEBSOCKET::JS[] = R"js( }) log(`Connecting to ${url} ...`, 'blue') } -)js"; +)"; #endif diff --git a/software/software.ino b/software/software.ino index 8c95cdf..2a7da43 100644 --- a/software/software.ino +++ b/software/software.ino @@ -24,7 +24,7 @@ // Github Repository: https://github.com/espressif/arduino-esp32 // Third parties libraries -//----------------------------------- +//------------------------------------------------------------------------------------- // ArduinoMqttClient by Arduino, version 0.1.8 // Library Manager: http://librarymanager/All#ArduinoMqttClient @@ -51,7 +51,7 @@ // Github Repository: https://github.com/h2zero/NimBLE-Arduino // Sparkfun libraries -//----------------------------------- +//------------------------------------------------------------------------------------- // SparkFun u-blox GNSS Arduino Library by Sparkfun Electronics, version 2.2.25 // Library Manager: http://librarymanager/All#SparkFun_u-blox_GNSS_Arduino_Library @@ -62,17 +62,19 @@ // Github Repository: https://github.com/sparkfun/SparkFun_u-blox_SARA-R5_Arduino_Library // Header files of this project -//----------------------------------- -#include "LOG.h" // Comment this if you do not want a separate log level for this application +// to remove LTE, BLUETOOTH, LBAND, CANBUS fucnztion simply comment to save memory, the +// peripherial is however not put into low power mode or its pins remain uncontrolled +//------------------------------------------------------------------------------------- +#include "LOG.h" // Comment this if you do not want a separate log level for this application #include "HW.h" #include "CONFIG.h" #include "UBXFILE.h" -//#include "BLUETOOTH.h" // Comment this to save memory if not needed, choose the flash size 4MB and suitable partition +//#include "BLUETOOTH.h" // Optional, Comment this to save memory if not needed, choose the flash size 4MB and suitable partition #include "WLAN.h" #include "GNSS.h" -#include "LBAND.h" -#include "LTE.h" -//#include "CANBUS.h" // Comment this if not on vehicle using the CAN interface +#include "LBAND.h" // Optional, comment this if not needed +#include "LTE.h" // Optional, comment this if not needed, +//#include "CANBUS.h" // Optional, comment this if not on vehicle using the CAN interface, CAN PHY is reqired // ==================================================================================== // MAIN setup / loop @@ -100,20 +102,23 @@ void setup(void) { Bluetooth.init(hwName); #endif Wlan.init(); // WLAN runs in a tasks, creates an additional LED task +#ifdef __LTE_H__ //Lte.enableDebugging(Serial); //Lte.enableAtDebugging(Serial); // we use UbxSerial for data logging instead //Lte.enableAtDebugging(Websocket); // forward all messages Lte.init(); // LTE runs in a task +#endif // i2c wire UbxWire.begin(I2C_SDA, I2C_SCL); // Start I2C UbxWire.setClock(400000); //Increase I2C clock speed to 400kHz if (!Gnss.detect()) { log_w("GNSS ZED-F9 not detected, check wiring"); } +#ifdef __LBAND_H__ if (!LBand.detect()) { log_w("LBAND NEO-D9 not detected, check wiring"); } - +#endif #ifdef __CANBUS_H__ Canbus.init(); #endif @@ -122,7 +127,9 @@ void setup(void) { /** Main Arduino loop function is used to manage the GPS and LBAND communication */ void loop(void) { +#ifdef __LBAND_H__ LBand.poll(); +#endif Gnss.poll(); delay(50);