主要内容

搜索

I have an ESP32 that has 5 values (solarW, batteryV, pumpW, pumpRPM and pumpLPM) that I'm writing to 5 fields on a Thingspeak channel.
if ((millis() - fifteenTstart) > 15000){
Serial.println("Updating Thingspeak....");
ThingSpeak.setField(1, solarW);
ThingSpeak.setField(2, batteryV);
ThingSpeak.setField(3, pumpW);
ThingSpeak.setField(4, pumpRPM);
ThingSpeak.setField(5, pumpLPM);
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
}
It works fine when there's a good connection to the internet and Thingspeak, but there's a 10 second or so delay when Thingspeak is unavailable (WiFi, internet or website non-connectivity).
I would like the code to recognise that there's no ThingSpeak connection musch faster (1 second or less woud be good, but I'll take two!).
Or, if it's possible to just send the data out without the code waiting for a confirmation back (I only need the data to go OUT from the ESP32 to Thingspeak, nothing needs to come back).
The reason for doing this is there's other code on the ESP32 that I need to get back to, having a 10 second delay in the middle of the code ain't good for the pump safety reaction code.

Hello,

I am sending mqtt values from esp8266 devices to different channels - e.g. https://thingspeak.com/channels/1182897

The values are sent correctly and also show up on the channel's page correctly and quickly in time.

But mqtt receivers are getting the data with a varying long delay. Often the delay is 1h, so I first thought, this could be a time zone problem. But that's not the case.

I tried two different mqtt clients: Both get the values at the same (late time): E.g. when I now get a value from channels/1182897/subscribe/fields/field3 and look into the history of values (using "Data Import/Export") then this value can be found 20 minutes up to 1 hour ago. This can also be confirmed when looking into the device's logs.

What could I do to be up-to-date with my values? Thank you very much. Dirk