Avatar for ct5845

ct5845

Member since Nov 2017 • Last active Dec 2017
  • 1 conversations
  • 3 comments

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for ct5845

    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)

  • in Pico / Wifi / Original Espruino
    Avatar for ct5845

    Thanks.

    So it was as simple as the two above pieces of advice...

    (1) Place GPS closer to the window to actually get a fix!
    (2) Swap the wires round for RX/TX, i had GPS Tx -> Espruino Tx.

    Thanks!

  • in Pico / Wifi / Original Espruino
    Avatar for ct5845

    I've got an Espruino Wifi, and a Adafruit Ultimate GPS (https://www.adafruit.com/product/746).

    I've got the following code from the tutorials;

    Serial1.setup(9600, {tx: B6, rx: B7});
    
    function onInit() {
      var gps = require("GPS").connect(Serial1, function (data) {
        console.log(data);
      });
    }
    
    onInit();
    

    The GPS module appears to power up ok, it's red LED flashing once every 1 seconds for a satellite fix, however i'm getting absolutely nothing back from the console.log. Not an error, not a success, nothing.

    Not really sure where to go for troubleshooting from here. I believe I've got the pins wired up correctly.

    Is it simply that the GPS module provided won't work "out of the box" with this module, do i need to do some lower level interfacing? Or perhaps something else is afoot?

    Is there generally any way to debug/troubleshoot in circumstances like this?

    EDIT: just to note: experienced JS dev, completely inexperienced Espruino/Ardunio etc dev!

Actions