Thank you for your reply. The semi-colon was missed-off when I copied the relevant section of software.
Yes, you are right the above copy of the error messages is not the whole picture. Here is the complete text:
C:\Users\panda\Documents\Arduino sketches\sketch_ESP32_GPS\sketch_ESP32_GPS.ino:64:1: error: expected unqualified-id before 'switch'
64 | switch (status) {
| ^~~~~~
C:\Users\panda\Documents\Arduino sketches\sketch_ESP32_GPS\sketch_ESP32_GPS.ino:84:1: error: expected unqualified-id before 'if'
84 | if ((status != STATUS_GPS_ERROR) && (status != STATUS_PARSE_ERROR)) {
| ^~
C:\Users\panda\Documents\Arduino sketches\sketch_ESP32_GPS\sketch_ESP32_GPS.ino:86:3: error: expected unqualified-id before 'else'
86 | } else {
| ^~~~
C:\Users\panda\Documents\Arduino sketches\sketch_ESP32_GPS\sketch_ESP32_GPS.ino:89:1: error: expected unqualified-id before 'if'
89 | if (status == STATUS_SENT) {
| ^~
C:\Users\panda\Documents\Arduino sketches\sketch_ESP32_GPS\sketch_ESP32_GPS.ino:94:1: error: expected declaration before '}' token
94 | }
| ^
exit status 1
Compilation error: expected unqualified-id before 'switch'
type or paste code her
uint8_t status = geo.loop();
switch (status) {
case STATUS_SENT:
Serial.println("Data sent successfully!");
break;
case STATUS_GPS_ERROR:
Serial.println("GPS connection error!");
break;
case STATUS_NETWORK_ERROR:
Serial.println("Network error (buffered).");
break;
case STATUS_BAD_REQUEST_ERROR:
Serial.println("Bad request error!");
break;
case STATUS_PARSE_ERROR:
Serial.println("GPS data format error!");
break;
case STATUS_CELLULAR_NOT_REGISTERED:
Serial.println("GSM: Not registered to network!");
break;
}
if ((status != STATUS_GPS_ERROR) && (status != STATUS_PARSE_ERROR)) {
digitalWrite(GPSFix_LED, HIGH);
} else {
digitalWrite(GPSFix_LED, LOW);
}
if (status == STATUS_SENT) {
digitalWrite(DataSent_LED, HIGH);
delay(1000);
digitalWrite(DataSent_LED, LOW);
}
}
e
I also enclose again a list of the errors. After verifying the programme once more, these are still the same. When the sketch was first written these errors did not show-up; this is what has confused me!
When you post ALL the code then we can try to verify it and by auto-formatting it sometimes we can even quickly see something wrong. Until you do that our hands are tied.
@PerryBebbington I agree with Perry, the missing loop and a small (optional) rearrangement results in a successful compile although some libraries are not clean.