at what time interval are you sending the GPS uplink? can you share your entire code?
Well. I just removed the widget and added it again and now it works just fine. Thank you so much for your help. Appreciate it!
hey artem, any chance i can get a copy of that completed code? im trying to set up a lilygo board with a sim7000a and a esp32
@roberttalley76 you can check the code above with addition of
im not sure where any of that needs to go. i havnt seen anything that works or know the format for gps to be sent to cayenne. also brackets and some other formatting issues seem to be an issue when posting to here.
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
//#include “High_Temp.h”
#define TINY_GSM_MODEM_SIM7000
#define CAYENNE_DEBUG
#include <CayenneMQTTGSM.h>
// This sketch uses a software serial connection.
#include <SoftwareSerial.h>
#define gsmSerial Serial1
// GSM connection info.
char apn = “vzwinternet”; // Access point name. Leave empty if it is not needed. i know calls and sms are disabled
char gprsLogin = “”; // GPRS username. Leave empty if it is not needed.
char gprsPassword = “”; // GPRS password. Leave empty if it is not needed.
char pin = “”; // SIM pin number. Leave empty if it is not needed.
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = “”;
char password = “”;
char clientID = “”;
char latBuff[12], longBuff[12], locBuff[50], altBuff[12];
float lat = -113.053020080;
float lon = 50.06766842;
float alt = 1051.8;
void setup() {
Serial.begin(9600);
Serial.println("Hello ");
// Auto-detect the GSM serial baud rate. You can manually set it instead if you want to save a bit of space.
TinyGsmAutoBaud(gsmSerial);
Cayenne.begin(username, password, clientID, gsmSerial, apn, gprsLogin, gprsPassword, pin);
}
void loop() {
Cayenne.loop();
dtostrf(lat, 1, 8, latBuff); // float_val, min_width, digits_after_decimal, char_buffer
dtostrf(lon, 1, 8, longBuff);
dtostrf(alt, 1, 1, altBuff);
// Construct a combined, comma-separated location array
sprintf(locBuff, “%s,%s,%s”, latBuff, longBuff, altBuff); // This could look like “10,33.123456,-85.123456,120.5”
delay(100);
// Construct a combined, comma-separated location array
Cayenne.virtualWrite(2,locBuff,“gps”, “m”);
buffer1[0] = ‘[’;
size_t offset1 = 1;
dtostrf(x1, 1, 3, &buffer1[offset1]);
offset1 += strlen(&buffer1[offset1]);
buffer1[offset1++] = ‘,’;
dtostrf(d1, 1, 3, &buffer1[offset1]);
offset1 += strlen(&buffer1[offset1]);
buffer1[offset1++] = ‘,’;
dtostrf(z1, 1, 0, &buffer1[offset1]);
offset1 += strlen(&buffer1[offset1]);
buffer1[offset1++] = ‘,’;
dtostrf(a1, 1, 0, &buffer1[offset1]);
offset1 += strlen(&buffer1[offset1]);
buffer1[offset1++] = ‘]’;
buffer1[offset1] = 0;
Serial.println(buffer1);
}
Thats what i got. and without adding anything its got some issues like:\
Arduino: 1.8.13 (Windows 10), Board: “ESP32 Wrover Module, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), QIO, 80MHz, 921600, None”
sketch_jul06a:42:1: error: stray ‘\342’ in program
sprintf(locBuff, “%s,%s,%s”, latBuff, longBuff, altBuff); // This could look like “10,33.123456,-85.123456,120.5”
^
sketch_jul06a:42:1: error: stray ‘\200’ in program
sketch_jul06a:42:1: error: stray ‘\234’ in program
sketch_jul06a:42:1: error: stray ‘\342’ in program
sketch_jul06a:42:1: error: stray ‘\200’ in program
sketch_jul06a:42:1: error: stray ‘\235’ in program
sketch_jul06a:45:1: error: stray ‘\342’ in program
Cayenne.virtualWrite(2,locBuff,“gps”, “m”);
^
sketch_jul06a:45:1: error: stray ‘\200’ in program
sketch_jul06a:45:1: error: stray ‘\234’ in program
sketch_jul06a:45:1: error: stray ‘\342’ in program
sketch_jul06a:45:1: error: stray ‘\200’ in program
sketch_jul06a:45:1: error: stray ‘\235’ in program
sketch_jul06a:45:1: error: stray ‘\342’ in program
sketch_jul06a:45:1: error: stray ‘\200’ in program
sketch_jul06a:45:1: error: stray ‘\234’ in program
sketch_jul06a:45:1: error: stray ‘\342’ in program
sketch_jul06a:45:1: error: stray ‘\200’ in program
sketch_jul06a:45:1: error: stray ‘\235’ in program
C:\Users\User\Documents\Arduino\sketch_jul06a\sketch_jul06a.ino: In function ‘void loop()’:
sketch_jul06a:42:21: error: expected primary-expression before ‘%’ token
sprintf(locBuff, “%s,%s,%s”, latBuff, longBuff, altBuff); // This could look like “10,33.123456,-85.123456,120.5”
^
sketch_jul06a:42:22: error: ‘s’ was not declared in this scope
sprintf(locBuff, “%s,%s,%s”, latBuff, longBuff, altBuff); // This could look like “10,33.123456,-85.123456,120.5”
^
sketch_jul06a:42:24: error: expected primary-expression before ‘%’ token
sprintf(locBuff, “%s,%s,%s”, latBuff, longBuff, altBuff); // This could look like “10,33.123456,-85.123456,120.5”
^
sketch_jul06a:42:27: error: expected primary-expression before ‘%’ token
sprintf(locBuff, “%s,%s,%s”, latBuff, longBuff, altBuff); // This could look like “10,33.123456,-85.123456,120.5”
^
sketch_jul06a:45:35: error: ‘gps’ was not declared in this scope
Cayenne.virtualWrite(2,locBuff,“gps”, “m”);
^
sketch_jul06a:45:46: error: ‘m’ was not declared in this scope
Cayenne.virtualWrite(2,locBuff,“gps”, “m”);
^
sketch_jul06a:46:1: error: ‘buffer1’ was not declared in this scope
buffer1[0] = ‘[’;
^
sketch_jul06a:48:11: error: ‘x1’ was not declared in this scope
dtostrf(x1, 1, 3, &buffer1[offset1]);
^
sketch_jul06a:51:11: error: ‘d1’ was not declared in this scope
dtostrf(d1, 1, 3, &buffer1[offset1]);
^
sketch_jul06a:54:11: error: ‘z1’ was not declared in this scope
dtostrf(z1, 1, 0, &buffer1[offset1]);
^
sketch_jul06a:57:11: error: ‘a1’ was not declared in this scope
dtostrf(a1, 1, 0, &buffer1[offset1]);
^
exit status 1
stray ‘\342’ in program
This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
“Will love for help”
that x1, d1, z1 should be lat, lon and alt
which you are measuring from the sim700a