ThingSpeak

ThingSpeak

Public Channel

abc abc in MATLAB Answers
Last activity on 23 Jan 2024

my Associated License: 41138944 not be Dynamic upload Interva why
Jaume Nin in Discussions
Last activity on 20 Jan 2024

Buenas noches. Tengo una estación meteorológica contruida con Arduino, desde hace 4 años y funcionando perfectamente, y veo los datos mediante ThingSpeak. El problema es el que se ve en la imagen: La méteo, gestionada por una placa Arduino Wemos D1 Mini Pro, una placa solar, una batería y un sensor BME280, funciona cada hora. És decir, está hivernando y cada hora, durante un breve lapso de tiempo, despierta y emite los datos. ThingSpeak los envía a mi ordenador. El problema es que durante 4 años, ha estado enviando, cada hora, una sola lectura de los datos, però ahora envía dos o tres datos con minutos de diferencia, con lo que la lectura y procesamiento de estos datos, se ha vuelto inestable. No se si es debido a una reinstalación del sistema operativo, debido a un problema que he tenido con el SO, o a qué, pero quisiera volver a ver los datos de forma única, un solo dato cada hora. He sustituido la placa Arduino por otra, pero el problema persiste sin solucionarse, con lo que deduzco que posoblemente deba atribuirse al programa ThingSpeak. Sería posible solucionar este problema? Hay alguna manera de acceder a modificar, específicamente, esta configuración para volver a mostrar únicamente una lectura por hora? Gracias por la atención y la ayuda Salu2 cordiales Problema con los gráficos de ThingSpeak We have had some recent issues with the plot settings due to an upgrade. Your charts may have been set to average data in an unexpected way. Can you export the recent data from ThingSpeak and insure that the data is coming in a the frequency you expect? You can use the Read Data API or the export data tab of the channel view. You can see the export data API syntax on the API keys tabl of your channel, on the right hand side. If the data is fine, then we will have a fix out for the plot settings soon. You could also use a custom visualization to display the data as expected in the meantime. Gracias por la atención y la ayuda, Christopher, de momento vaoy haciendo buceando en los datos. Esperaré un tiempo a ver si podeis solucionar el problema. Si de aquí unos días no se soluciona, ya volveré a ponerme en contacto con vosotros a ver cómo va el tema. Gracias de nuevo. Saludos cordiales
Germán Chuquimia in MATLAB Answers
Last activity on 19 Jan 2024

Hola buenos dias, cuento con una licencia de thingspeak, mi consulta es la siguiente, como puedo visualizar cada imagen almacenada que toma el esp32cam cuando envia al canal de imagen. revise en preguntas frecuentes el cual dice lo siguiente: 31. ¿Cuántas imágenes puedo enviar a ThingSpeak? Las imágenes enviadas a ThingSpeak se almacenan en su MATLAB Drive. Consulte las preguntas frecuentes de MATLAB Drive para conocer el espacio total permitido en su MATLAB Drive. Una vez que haya excedido el espacio permitido en MATLAB Drive, deberá eliminar algunas imágenes para liberar espacio y almacenar más imágenes. Resulta que revise, y no se hallaba en los archivos de matlab drive las imagenes recopiladas, pero aun asi me sigue consumiendo almacenamientos dentro de Matlab drive, como "others app", y es de mi interes recopilar las imagenes para tener registro diario.
JOSE JAVIER Anaya Velayos in MATLAB Answers
Last activity on 18 Jan 2024

Hola, Tengo 2 arduinos MKR1000, el 1 y 2. El MKR1000 1 envía datos en un canal y 4 campos y me funciona bien. Entonces configuro el otro MKR1000 2 en el mismo canal pero en 4 campos diferentes y entonces éste último me deja de funcionar, sólo recibo 2 mensajes. Y cuando vuelvo a poner el MkR1000 1 ya sólo recibo también 2 mensajes.Thingspeak bloquea alguna MAC por algún motivo? Muchas gracias. Un saludo, Sofía
Iva Jerabkova in MATLAB Answers
Last activity on 18 Jan 2024

I am making a sample project from Arduino Project Hub - Plant Communicator On TS I receive data only 2 times after I upload the sketch. I want to upload data every minute, the first two minutes are successful, after that my Serial monitor shows "message sent to cloud" but nothing new shows up on TS. I also tried with another sketch that just generates numbers and uploads them on TS to make sure that there is nothing wrong with the sensors that I use in this project. With the sketch that generates random numbers and sends them to TS, I get the same outcome: data is uploaded first and second time, after that nothing. (Both sketches compiled without errors. Instead of using WiFi I tried to make a hotspot from my phone - doesn't help either.) Thanks for any help! #include "arduino_secrets.h" #include <WiFi101.h> #include<WiFiSSLClient.h> #include <RTCZero.h> #include "ThingSpeak.h" const char* ssid = SECRET_SSID; // your network SSID (name) const char* password = SECRET_PSWD; // your network password WiFiClient ThingSpeakClient; unsigned long myChannelNumber = 10; const char * myWriteAPIKey = SECRET_WRITE_API; RTCZero rtc; // create RTC object /* Change these values to set the current initial time */ const byte seconds = 0; const byte minutes = 28; const byte hours = 17; /* Change these values to set the current initial date */ const byte day = 4; const byte month = 12; const byte year = 17; int lightPin = A0; //the analog pin the light sensor is connected to int tempPin = A1; //the analog pin the TMP36's Vout (sense) pin is connected to int moisturePin= A2; // Set this threeshold accordingly to the resistance you used // The easiest way to calibrate this value is to test the sensor in both dry and wet earth int threeshold= 800; bool alert_already_sent=false; bool email_already_sent=true; bool already_sent_to_cloud=true; void setup() { Serial.begin(9600); while(!Serial); delay(2000); Serial.print("Connecting Wifi: "); Serial.println(ssid); while (WiFi.begin(ssid, password) != WL_CONNECTED) { Serial.print("."); delay(1500); } Serial.println(""); Serial.println("WiFi connected"); rtc.begin(); // initialize RTC 24H format rtc.setTime(hours, minutes, seconds); rtc.setDate(day, month, year); rtc.setAlarmTime(17, 30, 0); // Set the time for the Arduino to send the email ThingSpeak.begin(ThingSpeakClient); rtc.setAlarmTime(0, 0, 0); //in this way the request is sent every minute at 0 seconds rtc.enableAlarm(rtc.MATCH_SS); rtc.attachInterrupt(thingspeak_alarm); } void loop() { if(!already_sent_to_cloud){ ThingSpeak.setField(1,get_light()); ThingSpeak.setField(2,get_temperature()); ThingSpeak.setField(3,get_average_moisture()); ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); delay(1500); already_sent_to_cloud=true; delay(1500); Serial.println("message sent to cloud"); delay(1500); } } float get_temperature(){ int reading = analogRead(tempPin); float voltage = reading * 3.3; voltage /= 1024.0; // Print tempeature in Celsius float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset // Convert to Fahrenheit float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0; return temperatureC; } int get_average_moisture(){ // make an average of 10 values to be more accurate int tempValue=0; // variable to temporarly store moisture value for(int a=0; a<10; a++){ tempValue+=analogRead(moisturePin); delay(1000); } return tempValue/10; } int get_light(){ int light_value=analogRead(A0); return light_value; } void thingspeak_alarm(){ already_sent_to_cloud=false; }
Tanusree in MATLAB Answers
Last activity on 16 Jan 2024

I have a simulink model saved on my desktop MATLAB. Now I want to run this model through ThingSpeak insted of running from desktop MATLAB. Is it possible? Also how can I upload the simulink model on ThingSpeak cloud?
Austin Jacobs in MATLAB Answers
Last activity on 14 Jan 2024

I'm trying to recreate an HTTP POST in MATLAB analysis which is workign in Postman, so that I can use the data from the Huawei SolarFusion Northbound API in my project. The login endpoint I'm using requires consumers to inspect the headers in the response. It returns 17 headers, one of which is an xsrf-token with a correspoding value I need to extract. I tried using MATLAB webwrite function, the call is successful when I set weboptions as: options = weboptions('MediaType','application/json','RequestMethod','post','CertificateFilename', ''); ... S = webwrite(url, data, options); display (S,'look at this'); , but I couldn't find headers in the return object, S, the display output is: struct with fields: data: [] success: 1 failCode: 0 params: [1×1 struct] message: [] So I am attempting to use native HTTP send(request,uri,httpOptions) but am getting: ResponseMessage with properties: StatusLine: 'HTTP/1.1 500 Internal Server Error' StatusCode: InternalServerError Header: [1×17 matlab.net.http.HeaderField] Body: [1×1 matlab.net.http.MessageBody] Completed: 0 Great news that the headers are there, but I cannot make the call succeed. I am using HTTPOptions and this is tricky to figure out the equivalent settings to webwrite options. I believe HTTPOptions of ('Authenticate',false) is equivalent to weboptions of ('CertificateFilename', '') and this is a possible cause of the error. uri = url; httpOptions = matlab.net.http.HTTPOptions('Authenticate',false); [response,completedrequest,history] = send(request,uri,httpOptions); display(response, ' Response ');
Tanusree in MATLAB Answers
Last activity on 12 Jan 2024

Can we use Thingspeak as Digital Twin platform? What are the specifications related to semantic interoperability, security/privacy, event processing, cloud infrastructure, data analysis tools, visualization, user interfaces, open API, developer tools, architecture, components, and we service?
Frederic Lhoest in Discussions
Last activity on 11 Jan 2024

Dear Community, Since few weeks it looks like I have lost the ability to move cards order in the channel view. I used to be able to to so. I tried with different browser and even on mobile and it does not work anymore. Did missed something ? Is this feature been removed ? Thanks. Moving / Rearranging cards order same here... https://www.mathworks.com/matlabcentral/discussions/thingspeak/838555-changing-chart-type-from-line-to-any-other-doesn-t-produce-an-effect-anymore?s_tid=srchtitle I have been experiencing the same problem, i think it started almost a month ago Thanks @AIRFLUX. Ive been cross posting that one a lot. Appreciate the assist. Please feel free to chime in on any other discussions here - getting a little bigger crowd would be nice. channel ui cards moving
James in Discussions
Last activity on 10 Jan 2024

I cannot get any of my charts to be interactive using matlab. I need to be able to zoom into a chart and I cannot get any interactivity. In its purest from shouldnt this allow me to zoom into a chart? plot(time, data); % Enable zooming zoom on; (free account) Need help with zoom on Field Charts Field charts come automatically in the channel view. The code you provided is likely in a MATLAB visualization, but there is no interactivity in the ThingSeak environment for MATLAB plots. You can get the zoom ability using MATLAB Online, or MATLAB on your desktop.
Graham in Discussions
Last activity on 10 Jan 2024

I am trying t set up a cellular Particle Boron and Sensor to track my well water levels but the data is not showing up in Thingspeak. I have activated and flashed code to the device, created a Particle account, a Thingspeak account (and channel), and a Webhook. Things mostly work as they should and I can even see the data from the sensor in my Particle Console "Events", but nothing seems to arrive in the Thingspeak Channel. I am looking for technical advice. Graham No Data Arriving in Thingspeak Channel Am I supposed to do something with the Read or Write Channel feeds somewhere? It shows the data has arrived in Thingspeak but is not being plotted on the graph. I have inserted the Write API key in the Particle Console Integration, as well as Field1 as Water Depth. I think I am missing a step? Use the read data api to export the data and see the format you are getting. Generally when you see the last update increment but no data in the plots it means you have non numeric data coming in. If that fails, I would start with the write API and make sure you can manually update your channel vis web browser. You can get the write data syntax from the API keys tab of your channel view. Thank you for pointing me in the right direction. Non numeric data may be the problem as it is consistent with what I see in the events arriving in Thingspeak. I'm still not sure where to go from here. I am using a sensor to measure water levels. I have some coding and arduino experience but new to Particle and Thingspeak so struggling to tie them all together. The code was previously written and used with Particle and Thingspeak for rural well water level monitoring in eastern Canada so I'm not sure why it isn't working this time around? Here is the code that was provided with the device and I have successfully flashed to a Particle Boron: // Coded by J.Drage, 20-Feb-2022 STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY)); SYSTEM_THREAD(ENABLED); SystemSleepConfiguration config; //-------------------------------------------------------------------------- // Define Boron pins: //-------------------------------------------------------------------------- #define WLsensor_power D2 // Pin D2 powers the water level sensor on #define WLsensor_data D3 // Pin D3 is data output from the water level sensor //-------------------------------------------------------------------------- // Variables to be entered by user //-------------------------------------------------------------------------- int MeasureTime=86400000; // Time between water level measurements; entered by user (milliseconds) int ConnectTime=120000; // Time allowed for Particle Boron to connect to the cloud before going back to sleep; should not be less than 90000; entered by user (milliseconds) double Datum=3.0; // Datum elevation; typically top of well casing is used; entered by user (metres) double HangDown=0.5; // Distance from datum to sensor; entered by user (metres) //-------------------------------------------------------------------------- // Variables NOT entered by user //-------------------------------------------------------------------------- int MeasureTime2=(MeasureTime-60000); // Subtract 60000 milliseconds from MeasureTime to account for time needed to connect to the cloud; this keeps the measurement time to about the same time each day double WLSensorValue=0; // Reading from water level sensor (mm) double Depth=0; // Depth to water; measured by the sensor and then converted from mm to m (metres) double GWelevation=0; // Water table elevation; calculated by code (metres) void setup() { //-------------------------------------------------------------------------- // Configure pins on the Boron //-------------------------------------------------------------------------- pinMode(WLsensor_power, OUTPUT); pinMode(WLsensor_data, INPUT); Serial.begin(9600); PMIC().disableCharging(); config.mode(SystemSleepMode::ULTRA_LOW_POWER).duration(MeasureTime2); } void loop() { //-------------------------------------------------------------------------- // Check to see if Boron is connected to the cloud, if not then go to sleep to preserve the batteries //-------------------------------------------------------------------------- restart: if( !Particle.connected() ) { Particle.connect(); if ( !waitFor(Particle.connected, ConnectTime) ) { System.sleep(config); goto restart; } } //-------------------------------------------------------------------------- // Read the water level from the sensor //-------------------------------------------------------------------------- digitalWrite(WLsensor_power, HIGH); delay(1s); WLSensorValue = pulseIn(WLsensor_data, HIGH); digitalWrite(WLsensor_power, LOW); Depth = (WLSensorValue/1000); GWelevation = (Datum-HangDown-Depth); //-------------------------------------------------------------------------- // Check to see if the water depth is out of sensor range and if so, go to sleep without reporting the result; sensor range is 0.3-5m (5m model) or 0.5-10m (10m model) //-------------------------------------------------------------------------- if (Depth<0.31) { delay(2s); System.sleep(config); goto restart; } if (Depth>4.99) { delay(2s); System.sleep(config); goto restart; } //-------------------------------------------------------------------------- // Send the water level data to ThingSpeak.com //-------------------------------------------------------------------------- Particle.publish("Water Depth", String(GWelevation, 2), PRIVATE); delay(2s); System.sleep(config); goto restart; } Here are two examples from Data Import/Export. This is what is being recieved by Thingspeak. <feed> <created-at type="dateTime">2024-01-08T09:48:53Z</created-at> <entry-id type="integer">11</entry-id> <field1>Water Depth</field1> </feed> <feed> <created-at type="dateTime">2024-01-08T09:49:56Z</created-at> <entry-id type="integer">12</entry-id> <field1>Water Depth</field1> </feed> The field value there is "Water Depth" so that explains why ThingSpeak cannot plot it. You will need to send a number instead of the value label. Loooking at your code, it seems that the webhook may be defined incorrectly. I think this line sends data to particle, then particle scans the data and forwards it to the ThingSpeak API if it is written correctly. Particle.publish("Water Depth", String(GWelevation, 2), PRIVATE); I think your webhook is configured to write the first argument of data to the channel, when I think you will want to write the second argument (String(GWelevation,2) instead. thingspeak data
James in MATLAB Answers
Last activity on 10 Jan 2024

I have weather data that goes to an FTP site (only way to store it) I use Python to transfer from FTP to Thingspeak. If I upload all the data at once using import all my data comes into thingspeak. When I use Python I only get one maybe two records. Do I need to upload every minute? sample code (manual push) # Connect to FTP and download the file into memory try: ftp = ftplib.FTP(ftp_server) ftp.login(username, password) # Create an in-memory binary stream for the file memory_file = io.BytesIO() ftp.retrbinary('RETR ' + ftp_file_path, memory_file.write) ftp.quit() # Go to the start of the memory file memory_file.seek(0) # Read CSV file from memory data = pd.read_csv(memory_file) # Process and send each row of the CSV to ThingSpeak for index, row in data.iterrows(): payload = {'api_key': api_key} for i, value in enumerate(row): payload[f'field{i+1}'] = value response = requests.post(update_url, params=payload) if response.status_code == 200: print(f'Data sent successfully: {row}') else: print(f'Error sending data: {row}, Status Code: {response.status_code}') except ftplib.all_errors as e: print(f"FTP error: {e}") except Exception as e: print(f"An error occurred: {e}")
Alexander in Discussions
Last activity on 10 Jan 2024

Ich habe das Problem das ich immer nur 1 Tag aufzeichnen kann (siehe Anhang), obwohl ich den Parameter au 15 tage gestellt habe. Aufzeichnungsdauer Stromverbrauch You can read at most 8000 points in a single read. Have a look at the blue tip on theRead data API page. There are several ways to get around this. One is to write the average of your data for a time period to another channel and then plot the data in that derived channel. You can use the TimeControl app to do this automatically on a regular basis, ad call MATLAB analysis code you create to average and write the data. Another is to write a custom MATLAB visualization code to read the data in several reads and add it together into one series. You can use the MATLAB playground AI assistant to help you generate the code for the custom visualization. aufzeichnungsdauer
Antiath in Discussions
Last activity on 10 Jan 2024

Hello, it's been a couple weeks that the webrowser client seems to have issues for me. I can't move the chart with my mouse anymore. And the Average option doesn't do anything, it is always displaying all the datapoints. Same with the type of points, it is stuck on line type whatever I ask. Also it will not update the page automatically when new points are uploaded, I have to hit F5 to refresh myself. I can still control the number of days displayed though. I tried on brave, firefox and edge and it all behaves the same. Cannot move the charts, averaging is not working and no auto refresh Thank you for reporting this issue. We are aware of the problem and are working to fix this issue. I plan to report any change of status on this related thread. Thanks ! I have the same issue and this is really annoying. Looking forward for a fix
Andrea Viviana Trejo Mirón in Discussions
Last activity on 7 Jan 2024

Tengo semanas trabajando con la app y al subir informacion me aparece que la ultima entrada fue hace menos de un minuto pero las gráficas no se actualizan, ya intente abrir la app desde diferentes navegadores,y dispositivos, en modo incognito, desabilitar extenciones y no obtengo resultados. problemas de actualización This probably means you are updating the channel with data that is not plottable, such as string data. Export the recent data in you channel using the read data api or the export data tab of your channel ( or thingspeakread in matlab) and see what is there. problema de actualización
Ivan in MATLAB Answers
Last activity on 7 Jan 2024

Charts are not updated in real time.
Shreeya in MATLAB Answers
Last activity on 5 Jan 2024

```/* WriteSingleField Description: Writes a value to a channel on ThingSpeak every 20 seconds. Hardware: ESP32 based boards !!! IMPORTANT - Modify the secrets.h file for this project with your network connection and ThingSpeak channel details. !!! Note: - Requires installation of EPS32 core. See https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md for details. - Select the target hardware from the Tools->Board menu - This example is written for a network using WPA encryption. For WEP or WPA, change the WiFi.begin() call accordingly. ThingSpeak ( https://www.thingspeak.com ) is an analytic IoT platform service that allows you to aggregate, visualize, and analyze live data streams in the cloud. Visit https://www.thingspeak.com to sign up for a free account and create a channel. Documentation for the ThingSpeak Communication Library for Arduino is in the README.md folder where the library was installed. See https://www.mathworks.com/help/thingspeak/index.html for the full ThingSpeak documentation. For licensing information, see the accompanying license file. Copyright 2020, The MathWorks, Inc. */ #include <WiFi.h> #include "secrets.h" #include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros char ssid[] = SECRET_SSID; // your network SSID (name) char pass[] = SECRET_PASS; // your network password int keyIndex = 0; // your network key Index number (needed only for WEP) WiFiClient client; unsigned long myChannelNumber = SECRET_CH_ID; const char * myWriteAPIKey = SECRET_WRITE_APIKEY; // int number = 0; #define sensorPin 34 void setup() { Serial.begin(115200); //Initialize serial ThingSpeak.begin(client); // Initialize ThingSpeak pinMode(sensorPin, INPUT); delay(20000); } void loop() { // Connect or reconnect to WiFi if(WiFi.status() != WL_CONNECTED){ Serial.print("Attempting to connect to SSID: "); Serial.println(SECRET_SSID); while(WiFi.status() != WL_CONNECTED){ WiFi.begin(ssid, pass); // Connect to WPA/WPA2 network. Change this line if using open or WEP network Serial.print("."); delay(5000); } Serial.println("\nConnected."); } int smokeValue = analogRead(sensorPin); // Write to ThingSpeak. There are up to 8 fields in a channel, allowing you to store up to 8 different // pieces of information in a channel. Here, we write to field 1. Serial.println("Smoke value : "); Serial.println(smokeValue); if(smokeValue > 100) { int x = ThingSpeak.writeField(myChannelNumber, 1, smokeValue, myWriteAPIKey); if(x == 200){ Serial.println("Channel update successful, Code : " + String(x)); } else{ Serial.println("Problem updating channel. HTTP error code " + String(x)); } delay(20000); // 20 sec } // change the value // number++; // if(number > 99){ // number = 0; // } delay(2000);// Wait 2 seconds to update the channel again }``` I am getting error of 401 and all my data is correct. // Below is secret.h file // Use this file to store all of the private credentials // and connection details #define SECRET_SSID "Shreyas" // replace MySSID with your WiFi network name #define SECRET_PASS "sarkar2003" // replace MyPassword with your WiFi password #define SECRET_CH_ID 2369873 // replace 0000000 with your channel number #define SECRET_WRITE_APIKEY "QO2EB******TSA" // replace XYZ with your channel write API Key
Dimitris Lymperis in MATLAB Answers
Last activity on 5 Jan 2024

I am using the following commands in a script to retrieve the records from the last 5 minutes of two diffirent temperature sensors. Temp_1 = thingSpeakRead(readChannelID_1,'Fields',Temperature_1_FieldID,'NumMinutes',5,'ReadKey',readAPIKey_1,'OutputFormat','timetable') Temp_2 = thingSpeakRead(readChannelID_2,'Fields',Temperature_2_FieldID,'NumMinutes',5,'ReadKey',readAPIKey_2,'OutputFormat','timetable') Some times i get a good one timetable with double values (rarely) for temperature and some other time i get a cell array with the following format. Timestamps Temperature_2 ____________________ _____________ 17-Dec-2020 23:16:00 {'nan' } 17-Dec-2020 23:16:16 {'16.10000'} 17-Dec-2020 23:16:31 {'16.10000'} 17-Dec-2020 23:18:52 {'16.10000'} 17-Dec-2020 23:19:09 {'nan' } 17-Dec-2020 23:19:25 {'16.10000'} 17-Dec-2020 23:19:41 {'16.10000'} 17-Dec-2020 23:20:28 {'16.10000'} 17-Dec-2020 23:20:44 {'16.10000'} why does it happen and how can i get only the double values?
Francis Cote in MATLAB Answers
Last activity on 5 Jan 2024

Bonjour, J'essai d'utiliser un DHT11 et un capteur de sol.Seulement,le field1 et field2 s'affichent.Le capteur de solField3ne s'affiche pas. ///////////////////////////////// // Generated with a lot of love// // with TUNIOT FOR ESP8266 // // Website: Easycoding.tn // ///////////////////////////////// #include <ESP8266WiFi.h> #include "DHT.h" #include <ESP8266HTTPClient.h> WiFiClient client; DHT dht2(2,DHT11); String thingSpeakAddress= "http://api.thingspeak.com/update?"; String writeAPIKey; String tsfield1Name; String request_string; HTTPClient http; void setup() { Serial.begin(115200); WiFi.disconnect(); delay(3000); Serial.println("START"); WiFi.begin("xxxxxx","xxxxxx"); while ((!(WiFi.status() == WL_CONNECTED))){ delay(300); Serial.print(".."); } Serial.println("Connected"); Serial.println("Your IP is"); Serial.println((WiFi.localIP().toString())); } void loop() { if (client.connect("api.thingspeak.com",80)) { request_string = thingSpeakAddress; request_string += "key="; request_string += " 577YXKILO0SBRQFS"; request_string += "&field1="; request_string += (dht2.readTemperature( )); request_string += "&field2="; request_string += dht2.readHumidity( ); request_string += "&field3="; request_string += analogRead(A0); http.begin(request_string); http.GET(); http.end(); request_string=""; delay(15000); } Serial.println("Valeurs envoyees en principe"); Serial.println("Temperature"); Serial.println((dht2.readTemperature( ))); Serial.println("Humidity"); Serial.println((dht2.readHumidity( ))); Serial.println("Humidity Sol"); Serial.println(analogRead(A0)); delay(15000); }
Thomas in MATLAB Answers
Last activity on 5 Jan 2024

The problem occured only recently. It worked correctly until approx. 1 week ago.
Natalia in MATLAB Answers
Last activity on 4 Jan 2024

I´m creating an irrigation system, I collect data from a sensor with labview and I send it to a thingspeak channel. When I use thingspeak on my computer, the data I obtain is displayed perfectly in the field one chart. The same numbers should show on the gauge that I placed next to it but it doesn´t work at all even though it is configured to work with the field 1 data. Also, when I try to view the information on my Thingviewer app none of the widgets work. Does anyone know how I could fix this?
Aman Kumar in MATLAB Answers
Last activity on 3 Jan 2024

% Enter your MATLAB Code below % Enter your MATLAB Code below % Read Output Water Quantity over the past month from a ThingSpeak channel and write % the average to another ThingSpeak channel. % Channel 1035265 contains data from the MathWorks water supply station, located % in Natick, Massachusetts. The data is collected once every day. Field % 3 contains output liquid quantity data. % Channel ID to read data from readChannelID = 1035265; % Output Liquid Quantity Field ID outputliquidqantityFieldID = 3; % Channel Read API Key % If your channel is private, then enter the read API Key between the '' below: readAPIKey = ''; % Get Output Liquid Quantity data for the last 30 days from the MathWorks water supply % station channel. Learn more about the THINGSPEAKREAD function by going to % the Documentation tab on the right side pane of this page. meter_reading = thingSpeakRead(readChannelID,'Fields', outputliquidqantityFieldID,'NumDays',10,'ReadKey',readAPIKey); sum = sum(meter_reading) % Calculate the Cost Billing_cost = 5*(meter_reading/1000); display(Billing_cost,'Total Billing Cost (INR)'); % Start by setting the channel ID and Alert key. All alert key start with TAK. formatSpec = "The Water consumption bill is: %d,%d"; A1 = 5*(meter_reading/1000); A2 = meter_reading apiKey = 'TAK14ZOZGAXZQMR05'; alertURL = "https://api.thingspeak.com/alerts/send"; options = weboptions("HeaderFields", ["ThingSpeak-Alerts-API-Key", apiKey ]); alertBody = sprintf(formatSpec,A1,A2) alertSubject = sprintf(" Water consumption exceeded 100 l!"); if meter_reading >= 100 webwrite(alertURL, "body", alertBody, "subject", alertSubject, options); end
Andrew in Discussions
Last activity on 3 Jan 2024

I get the following error message when using a DELETE command. Using: DELETE https://api.thingspeak.com/channels/2392108/feeds.json api_key=KJ7FFW9XSA48ZOJQ I am using the correct api_key and channel ID Error Response: { "status": "401", "error": { "error_code": "error_auth_required", "message": "Authorization Required", "details": "Please provide proper authentication details." } } I just cannot find out what I'm doing wrong. I've used Postman and Curl apps. Can anyone help? andrew.harris@harristribe.co.uk Problem clear field data I suspect you are using the channel API key, but delete operations require the User API key. See the Clear Channel API page for details, especially the note in the body parameters section. Ive redacted your API key for security though. Thank you for your prompt response Christopher but I am aware of thet issue. This is the command as defined on the ThingSpeak webpage DELETE https://api.thingspeak.com/channels/CHANNEL_ID/feeds.json api_key=xxxxxxxxxxxxxxxx Here is the API key from the My Profile Page API Keys User API Key xxxxxxxxxxxxxxxx Alerts API Key <no API key> and here are my read and write keys Write API Key Key xxxxxxxxxxxxxxxx Read API Keys Key xxxxxxxxxxxxxxxx I know I must have missed something obvious but I cannot spot it after trying all day :-( Trust you can show me the error of my ways. Thank you Andrew FYI I have no problem issuing the two commands below with Curl of Postman: curl -v --request GET https://api.thingspeak.com/channels.json?api_key=xxxxxxxxxxxxxxxx curl -v --request GET https://api.thingspeak.com/channels.json?api_key=xxxxxxxxxxxxxxxx Just tried it from Postmand and it works, now I'm confused, Checked and all the data has been cleared. Thank you so much for your help. Thanks for the clarification. Can you try this format with the '?' ? DELETE https://api.thingspeak.com/channels/2392108/feeds.json?api_key=xxxxxxxxxxxxxxxx delete clear thingspeak field
Thomas in Discussions
Last activity on 2 Jan 2024

Ich erinnere mich, dass die Visualisierungsfenster verschoben werden konnten. Das geht nicht mehr? Wer kennt den Trick? Anordnen der Visualisierungen eines Kanals Thank you for reporting, this is presently a bug. The topic title is different, but I think the casue is similar in this other post. Ill plan to post there when I have more information: https://www.mathworks.com/matlabcentral/discussions/thingspeak/838555-changing-chart-type-from-line-to-any-other-doesn-t-produce-an-effect-anymore?s_tid=srchtitle visualisierungsfenster anordn
happybono in Discussions
Last activity on 28 Dec 2023

TimeControl Ran, but it didn't appiied it to channel. And I would like to MathWorks to fix (modify) my chart to right time and value and investigate this problem. TimeControl Ran, but it didn't applied it to the channel The pink nature of the time contol generally indicates that there is an error with the code that is triggered by your time control. Have a look at the code and check for errors. If you have a paid commercial or academic license, you are entitled to MathWorks customer support. Thanks for your reply, @Christopher Stapels Yeah, it didn't ran today either for some reason. Also, I am not talking about the pink colored one. I am talking about the calculate and display the average data (weekly). And its now Saturday, 12 / 16 / 2023. 5:51 PM (KST +09:00) and the time control obviously didn't ran correctly in the right time, and it didn't displayed plot / recorded the value in the average collection channel (1184617). There is a definitely an issue with the thingspeak since 2 weeks ago, as it worked properly before the last week. the run times may be in GMT. What does it say for 'run at' now that the day had passed entirely? Yep it just didn't ran properly obviously, as now its updated to "run at" 23-DEC-2023, but "last ran" date and time still says 02-DEC-2023 9:01 am The time control seems to have missed both the 9th and the 16th, based on what you show above. If you are editing the time control in between running, it may be rescheduling for the following week without running. @Christopher Stapels Recently, There seems several issues are appearing that across the ThingSpeak website broadly. Yeah, I edited the time control in between running as it didn't ran as scheduled timeframe on 9th.and its now working properly since 26th.(confirmed) Now I am aware about the another issue that I cannot rearrange the chart widgets on my channel (all charts / plugins / visualisations widgets are fixed and not rearrangeble by drag and drop permanently.) Please report those issues to the MathWorks development team, if you can contact them. Thanks, we are aware of the re arrange issue and it is being worked on. Unfortunately the holiday season may deter progress somewhat. The chart options are also affected on the web page, see this post for workaround. Im glad to hear your time control is running now. Be aware that it may redet the predicted run time each time you edit the TimeControl.

About 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.