|
36 | 36 | If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
|
37 | 37 | Open the serial monitor at 115200 baud to see the output
|
38 | 38 | */
|
| 39 | + |
39 | 40 | #include <WiFi.h>
|
40 | 41 | #include <WiFiClientSecure.h>
|
41 | 42 | #include <ArduinoMqttClient.h> // Click here to get the library: http://librarymanager/All#ArduinoMqttClient
|
@@ -67,8 +68,11 @@ void setup()
|
67 | 68 | Serial.println(F("u-blox module connected"));
|
68 | 69 | myGNSS.setI2COutput(COM_TYPE_UBX); //Turn off NMEA noise
|
69 | 70 | myGNSS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_SPARTN); // Be sure SPARTN input is enabled.
|
70 |
| - |
| 71 | + |
| 72 | + myGNSS.setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible |
71 | 73 | myGNSS.setNavigationFrequency(1); //Set output in Hz.
|
| 74 | + myGNSS.setVal8(UBLOX_CFG_SPARTN_USE_SOURCE, 0); // use IP source (default) |
| 75 | + |
72 | 76 | Serial.print(F("Connecting to local WiFi"));
|
73 | 77 | WiFi.begin(ssid, password);
|
74 | 78 | while (WiFi.status() != WL_CONNECTED) {
|
@@ -151,7 +155,7 @@ void beginClient()
|
151 | 155 | // Subscribe to MQTT and register a callback
|
152 | 156 | Serial.println(F("Subscribe to Topics"));
|
153 | 157 | mqttClient.onMessage(mqttMessageHandler);
|
154 |
| - mqttClient.subscribe(MQTT_TOPIC_KEY); |
| 158 | + //mqttClient.subscribe(MQTT_TOPIC_KEY); // The ZED does not need the keys in this example. SPARTN is delivered via secure MQTT |
155 | 159 | mqttClient.subscribe(MQTT_TOPIC_SPARTN);
|
156 | 160 | lastReceived_ms = millis();
|
157 | 161 | } //End attempt to connect
|
|
0 commit comments