Avatar for HopeToBeUseful1day

HopeToBeUseful1day

Member since Jul 2023 • Last active Aug 2023
  • 1 conversations
  • 10 comments

Mostly ask questions. Barely can answer anything

Most recent activity

  • in Bangle.js
    Avatar for HopeToBeUseful1day

    Does it mean nrf5340 would drain the battery when working with audio?

  • in Bangle.js
    Avatar for HopeToBeUseful1day

    Looks like @BillM implemented the checksum function another way. His version computes 28 without "$" sign. Attached screenshot

  • in Bangle.js
    Avatar for HopeToBeUseful1day

    I'm not sure if "$" should be accounted in the checksum.
    As shown here, NMEA checksum calculation does not include "$" and "*"

    Lets assume the following NMEA sentence:

    $GPGLL,5300.97914,N,00259.98174,E,125926,A*28
    

    In this sentence the checksum is the character representation of the
    hexadecimal value 28. The string that the checksum is calculated over
    is

    GPGLL,5300.97914,N,00259.98174,E,125926,A
    

    To calculate the checksum you parse all characters between $ and *
    from the NMEA sentence into a new string.

  • in Bangle.js
    Avatar for HopeToBeUseful1day

    Dual-frequency GPS please

  • in Bangle.js
    Avatar for HopeToBeUseful1day

    I thing line 19 of the presented code add the leading "$"

  • in Bangle.js
    Avatar for HopeToBeUseful1day

    Thank for the reply. The post misses the checksum. The real code is:

    function checksum(str) {
    	var cs = 0;
      
    	for (const c of str) {
    		cs = cs ^ c.charCodeAt(0); //XOR
    	}
      
    	return cs.toString(16).toUpperCase().padStart(2, '0');
    }
    
    function configureSBAS() {
       const thisTime = new Date(); 
       let timeString = thisTime.toISOString();
    	
      // SBAS satellite (SBAS satellite No. 1-19, corresponding to PRN 120-138
      var cmd = "PCAS15,4,FFFF"; //turn on satellites 1-16 of SBAS
      //var cmd = "PCAS15,4,7FFFF"; //turn on satellites 1-19 of SBAS
    
      cmd = "$" + cmd + "*" + checksum(cmd);
      Serial1.println(cmd);
      writeLogFile(timeString + ": " + cmd + "\n");
      
      SBASon = true;
    }
    
  • in Bangle.js
    Avatar for HopeToBeUseful1day

    Playing with @BillM 's code. Despite forcing AT6558(R?) into the SBAS mode by sending

    "PCAS15,4,FFFF"
    

    to the chip, the error is still over 7 meters.
    Is there a way to get the error below 2 meters as stated in most SBAS articles?

    UPD:
    After taking weighted by time between records average of recorded coordinates at a static point and comparing those average coordinates to the true coordinates, the error seems to be closer to 20 meters.

    UPD2:
    The command checksum is not included in the post. When the command is sent to the GPS chip the checksum is added.

Actions