You are reading a single comment by @halemmerich and its replies.
Click here to read the full conversation.
-
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; }
I have tried to make the PCAS-commands a bit more usable in a library, but some seem to do nothing at all (e.g. setting Standby mode) while other work fine (update interval). Is there a way to dump the current config to check?
Does your command miss the checksum or did you omit that on purpose?
https://github.com/halemmerich/BangleApps/blob/pcas/modules/pcas.js