Hello Everyone, I'm running an IoT project at my university using a free . Basically, my system uploads the sensor data to 4 different fields of a ThingSpeak channel and I'm reading from or writing to the channel through Simulink. I have a few questions regarding this topic: I'm trying to upload to the server every 3 seconds (which seemed to be providing the best results so far). Since the channel only accepts data transmit every 15 seconds, what is the optimized upload interval rate to match the interval rate of the channel? Because otherwise I have realized that my interval rate can go up to 1min sometimes for some reason. Is reading from/writing to the channel through simulink while the system is uploading data to the channel slow down th whole process? What is your overall suggestion in this case? I'm excited to hear your suggestions and experiences! Regards, Ege Does reading data from Simulink, slow down my server upload? I would prefer if you can stop trying to update every 3 seconds. This can result in a lot of wasted server time for us. Though your model may be putting other delays in there, Im not sure how to profile your model to be sure. Maybe Ill ask my Simulink firends about model profiling. I do recall having a similar issue with some Simulink models that I had made, Like this solar tracker. I recall there are settings in the model to change the timing to be closer to real time.. But I cannot report the details here off the top of my head. If you figure it out, please let us know here. For #2 are you asking if adding ThingSpeak can impede your model performance? Hi @Christopher Stapels, I solved the issue, thanks for your quick response! Also, reading the data from simulink doesn't seem to be effecting the performance of the channel now so far. The main issue was how i create the http request, in the new version I used your ESP32 library and now I'm able to update every 15.5 seconds. Here are the old and new versions: Old version: void loop() { unsigned long currentMillis = millis(); unsigned long interval = currentMillis - previousMillis; if (interval > UPLOAD_RATE) { // Create HTTP request String http_str = "GET /update?api_key=" + Apikey + "&field1=" + String(messageData1) + "&field2=" + String(messageData2) + "&field3=" + String(messageData3) + " HTTP/1.1\r\n"; http_str += "Host: " + server + "\r\n"; http_str += "Connection: close\r\n\r\n"; if(WiFi.status() != WL_CONNECTED) { Serial.print("Wifi connection failed. Attempting to reconnect..."); connectToWiFi(); delay(5000); } else { Serial.println("Connected to WiFi\n"); // Connect to the ThingSpeak server connectToThingSpeak(); // Make the HTTP request client.print(http_str); client.stop(); previousMillis = currentMillis; // Update the last time the action was performed } } delay(100); } void connectToThingSpeak() { if (client.connect(server.c_str(), 80)) { Serial.println("Connected to ThingSpeak server"); } else { Serial.println("Connection to ThingSpeak server failed"); } } New version: void loop() { unsigned long currentMillis = millis(); unsigned long interval = currentMillis - previousMillis; if (interval > UPLOAD_RATE) { ThingSpeak.setField(1,messageData1); ThingSpeak.setField(2,messageData2); ThingSpeak.setField(3,messageData3); ThingSpeak.setField(4,trialMessage); ThingSpeak.writeFields(CHANNELID,APIKEY); Serial.println("Data uploaded to the ThingSpeak server."); previousMillis = currentMillis; // Update the last time the action was performed } delay(100); } simulink interval read write iot