Pete Shepherd in Discussions
上次活动时间: 2022-8-18

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). Need faster Thingspeak connection timeout in ESP32 code MQTT is more of a fire and forget routine that you can use with ThingSpeak, though you may still have some connection delay. Our REST interface requires your client to wait for the response from the server. If you disconnect before the response with the REST interface, your data wont be posted. I've also been able to get paralell processes running on an ESP32, here is one tutorial I've used. Thanks Christopher. Looks like the parallel prcoessing route will be a good solution. I didn't know the ESP32 had dual core processing, definitely worth learning about! Multi threading is fun, but it does add some serious complexity to debugging. I would still recomend MQTT for this purpose and do the multi threads for learning sake. Good luck either way. thingspeak esp32 updating speed delay faster code connection
Pablo Untroib in MATLAB Answers
上次活动时间: 2020-1-13

My channel is at: https://thingspeak.com/channels/957733 Its an arduino fridge controller. It has three fields, temperature, humidity and mode. The fridge is used for charcuterie, so I have different modes for the different stages of the process. I have set 6 diferent values for the mode field, from 1 to 6. I change the visualization title using this code: modo = thingSpeakRead(957733,'Fields',[3]); if modo == 1 title('Heladera en modo Fermentado'); elseif modo == 2 title('Heladera en modo Estacionado'); elseif modo == 3 title('Heladera en modo Madurado'); elseif modo == 4 title('Heladera en modo Heladera'); elseif modo == 5 title('Heladera en modo Cava'); elseif modo == 6 title('Heladera en modo Manual'); end Is it possible to trigger an update when the mode changes? at the moment the only way the visualization title changes is when I refresh the browser page, it doesn't update like the plot does. Thanks

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.