• to shut NMEA output you can use CAS06 with 0 for all types.

    I got CAS06 as product information. I think its CAS03 to set the outputs

    None of these attempts worked for me.

    // try and slow the output down 
    function cas02() {
      // example $PCAS02,1000*2E  - 1 second in milliseconds
      sendCommand("CAS02,5000");  // does not work
    }
    
    // try and stop the NMEA output
    function stp() {
      //example:  $PCAS03,1,1,1,1,1,1,1,1,0,0,,,1,1,,,,1*3­3
      // attempt no output - did not work
      //sendCommand("CAS03,0,0,0,0,0,0,0,0,0,0­,,,0,0,,,,0");
      // attempt every 100, does not work
      sendCommand("CAS03,100,100,100,100,100,1­00,100,100,100,100,,,100,100,,,,100");
    }
    

    I can see gnss.setSentencesAll("0"); in your code, so assume that works for you.

     gnss.setSystems(1,0,0);
      gnss.setSentencesAll("0");
      gnss.setSentences({RMC:"1"});
      gnss.setUpdateRate(500);
    

    Not to worry, I'm more interested in the CASIC controls to get the NAV frequency down to once every 2 minutes.

    I'm working on trying to get a checksum function to work.
    I will test it from the output of your parse_casic code.

  • @HughB

    Not to worry, I'm more interested in the CASIC controls to get the NAV frequency down to once every 2 minutes.

    I doubt it is possible.
    I've made code that can set intervals 1000, 500, 200,100,50(yes, 20Hz!). But for other values it returns NACK.

    function ckSum(len,cls,mid, pldDV){
      var cs = (mid<<24)|(cls<<16)|len;
      for(var i=6; i<pldDV.buffer.length; i+=4){
        print(i, pldDV.getUint32(i, true));
        cs += pldDV.getUint32(i, true);
      }
      print(cs.toString(16));
      return cs;
    }
    const UD='undefined';
    function sendCfgRate(cfg){
      const cls=0x06, mid=0x04;
      var len = (typeof(cfg.interval)!=UD)?4:0;
      var msg = new ArrayBuffer(6+len+4);
      var dv = new DataView(msg);
      dv.setUint8(0,0xBA); dv.setUint8(1,0xCE);
      dv.setUint16(2, len, true);
      dv.setUint8(4,cls); dv.setUint8(5,mid);
    
      if(typeof(cfg.interval)!=UD){dv.setUint1­6(6+0,cfg.interval,true);}
      cs = ckSum(len,cls,mid,dv);
      dv.setUint32(6+len,cs, true);
      print(msg);
      Serial2.write(msg);
    }
    
    sendCfgRate({interval:10000})
    6 10000
    10 0
    4062714
    new Uint8Array([186, 206, 4, 0, 6, 4, 16, 39, 0, 0, 20, 39, 6, 4]).buffer
    =undefined
    { "hdr": 47822, "len": 4,
      "payload": new Uint8Array([6, 4, 0, 0]).buffer,
      "payloadBytes": new Uint8Array([6, 4, 0, 0]),
      "class": 5, "msgId": 0, "checkSum": 168035584,
      "name": "ACK-NACK"
     }
    >
    
About

Avatar for HughB @HughB started