Update Example18_PointPerfectClient.ino
This commit is contained in:
@@ -45,6 +45,8 @@
|
|||||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> // Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS
|
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> // Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS
|
||||||
SFE_UBLOX_GNSS myGNSS;
|
SFE_UBLOX_GNSS myGNSS;
|
||||||
|
|
||||||
|
#define OK(ok) (ok ? F(" -> OK") : F(" -> ERROR!")) // Convert uint8_t into OK/ERROR
|
||||||
|
|
||||||
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||||
|
|
||||||
//Global variables
|
//Global variables
|
||||||
@@ -186,24 +188,29 @@ void setup()
|
|||||||
|
|
||||||
//myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial
|
//myGNSS.enableDebugging(); // Uncomment this line to enable debug messages on Serial
|
||||||
|
|
||||||
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
|
while (myGNSS.begin() == false) //Connect to the u-blox module using Wire port
|
||||||
{
|
{
|
||||||
Serial.println(F("u-blox GPS not detected at default I2C address. Please check wiring. Freezing."));
|
Serial.println(F("u-blox GNSS module not detected at default I2C address. Please check wiring."));
|
||||||
while (1);
|
delay(2000);
|
||||||
}
|
}
|
||||||
|
Serial.println(F("u-blox GNSS module connected"));
|
||||||
|
|
||||||
Serial.println(F("u-blox module connected"));
|
uint8_t ok = myGNSS.setI2COutput(COM_TYPE_UBX); //Turn off NMEA noise
|
||||||
myGNSS.setI2COutput(COM_TYPE_UBX); //Turn off NMEA noise
|
if (ok) ok = myGNSS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_SPARTN); // Be sure SPARTN input is enabled.
|
||||||
myGNSS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_SPARTN); // Be sure SPARTN input is enabled.
|
|
||||||
|
|
||||||
myGNSS.setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible
|
if (ok) ok = myGNSS.setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible
|
||||||
myGNSS.setNavigationFrequency(1); //Set output in Hz.
|
if (ok) ok = myGNSS.setNavigationFrequency(1); //Set output in Hz.
|
||||||
myGNSS.setVal8(UBLOX_CFG_SPARTN_USE_SOURCE, 0); // Use IP source (default). Change this to 1 for L-Band (PMP)
|
if (ok) ok = myGNSS.setVal8(UBLOX_CFG_SPARTN_USE_SOURCE, 0); // Use IP source (default). Change this to 1 for L-Band (PMP)
|
||||||
|
|
||||||
myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata so we can watch the carrier solution go to fixed
|
if (ok) ok = myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata so we can watch the carrier solution go to fixed
|
||||||
|
|
||||||
myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_I2C, 1); // Enable UBX-RXM-COR messages on I2C
|
if (ok) ok = myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_I2C, 1); // Enable UBX-RXM-COR messages on I2C
|
||||||
myGNSS.setRXMCORcallbackPtr(&printRXMCOR); // Print the contents of UBX-RXM-COR messages so we can check if the SPARTN data is being decrypted successfully
|
if (ok) ok = myGNSS.setRXMCORcallbackPtr(&printRXMCOR); // Print the contents of UBX-RXM-COR messages so we can check if the SPARTN data is being decrypted successfully
|
||||||
|
|
||||||
|
//if (ok) ok = myGNSS.saveConfiguration(VAL_CFG_SUBSEC_IOPORT | VAL_CFG_SUBSEC_MSGCONF); //Optional: Save the ioPort and message settings to NVM
|
||||||
|
|
||||||
|
Serial.print(F("GNSS: configuration "));
|
||||||
|
Serial.println(OK(ok));
|
||||||
|
|
||||||
Serial.print(F("Connecting to local WiFi"));
|
Serial.print(F("Connecting to local WiFi"));
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
|
|||||||
Reference in New Issue
Block a user