• So i've been experimenting reading the NMEA sentences, which has been going well but now looking at changing some of the GPS options sending commands to it.

    So with Espruino Wifi B6 connected to Adafruit RX.

    var refreshRate10Hz = "$PMTK220,1000*1F"; // ideal refresh rate (10hz)
    var refreshRate1Hz = "$PMTK220,100*2F"; // default (1hz)
    
    function AdafruitGPS(serial, options) {
      this.serial = serial;
    
      serial.setup(9600, { tx: options.tx, rx: options.rx });
    
      serial.println(refreshRate10Hz); // attempt to update refresh rate
      
      var line = '';
      serial.on('data', function (data) {
        line += data;
        
        if (line.indexOf("\n") > -1) {
          this.parseCommand(line);
          line = '';
        }
      }.bind(this));
    }
    
    AdafruitGPS.prototype.parseCommand = function (data) {
      var command = data.substring(0,6);
      console.log(command, data);
    };
    
    var gps = new AdafruitGPS(Serial1, { tx: B6, rx: B7 });
    

    So this connects and reads commands fine, but the write command doesn't seem to do anything (by the specs i believe regardless of the result i should be receiving a PMTK_ACK as a receipt of a command). I'm aware it's probably something very simple again! But having no luck, anything blindingly obvious in there?

    https://cdn-shop.adafruit.com/datasheets­/PMTK_A11.pdf (gps command sheet)

About

Avatar for ct5845 @ct5845 started