You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 6, 2023. It is now read-only.
I am using google-cloud-iot-arduino on an ESP8266 based board. I am trying to send files to Google Cloud and I am currently able to do it by splitting them in 256 byte chunks. I store these chunks in Firestore using a cloud function and then put them back together using another cloud function and I store the file in a GCS bucket. What is the best way for me to use publishTelemetry to send an entire file (avg file size is 40k)? thanks! Marco .. here below what I am currently doing
int i = 0;
int total_bytes = 0;
while (dataFile.available()) {
if (i < 256) {
// if we haven't read 256 bytes yet, then keep reading!
data[i++] = dataFile.read();
total_bytes ++;
} else {
delay(100);
// send the read 256 bytes and reset the counter
publishTelemetry("/pictures", (char *)data, 256);
i = 0;
}
}
// send the remaining i bytes
delay(100);
publishTelemetry((char *)data, i);
delay(20);
// Close the file
dataFile.close();