My basic Arduino sketch below is to read the sentence from a gps using Tinygps++ and display the seconds part of the time.
The internet connect works fine.
When I comment out the line cayenne.loop, the gps through the SoftwareSerial read provides the seconds data and prints correctly.
When I uncomment the line cayenne.loop, no gps data appears.
Does cayenne interact somehow with the serial read facility of SoftwareSerial
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
// WiFi network info.
char ssid[] = "*******";
char wifiPassword[] = "************";
static const int RXPin = 12, TXPin = 13;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "*********";
char password[] = "*********";
char clientID[] = "*********";
void setup() {
Serial.begin(115200);
ss.begin(GPSBaud);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}
void loop() {
Cayenne.loop();
//get the data every time a new sentence is correctly encoded.
while (ss.available() > 0)
if (gps.encode(ss.read())){
Serial.println(gps.time.second());
}
}