Julian in Discussions
최근 활동: 2024년 11월 18일

Hello, I am wondering why I have over 12000 messages (writes)per day to a channel which I only update all 8 fields every 20 minutes. Or are these statistic timely delayed? Since testing I might have more writes, but now with my ready weather station only every 20 minutes my data will be updated. Wetterbox Channel ID: 2391212 Access: Public Can you explain this to me? Thank you for your help. Regards, Julian Too many messages per day, free account If I read your channel, I see 71 messages from today, and 87 messages from yesterday. howMany=size(thingSpeakRead(2391212 ,"numdays",1, "outputformat","timetable"),1) howManyTwoDay=size(thingSpeakRead(2391212 ,"numdays",2, "outputformat","timetable"),1) howManyTwoDay-howMany=howManyYesterday The total number of messages in your channel right now is about 12,000. I read 8000 of them, the first date in the last 8000 readings is Feb 27 2024. By any chance, are you exporting the data in the channel, clearning your channel and re-importing the data into your channel? Once you update a channel, you use a message. Clearing the channel and reimporting the data just results in double the usage. If you do the clear & re-import "n" times, you are just using "n" times more messages. Thanks for this explanation. True during my testing phase I needed clear and upload data again. This makes sense. Good to know, i'll need to test messages channel update free account
Fox Devices in Discussions
최근 활동: 2024년 9월 19일

I'm almost embarressed enough to not ask this. :) I assumed sorting the "Updated" column in the "My Channels" view would sort my channels based on when data was last written to (last updated to) the channel However, I have channels that have received date in August and yet the date/time stamp in the Uodated column displays a June date and therefore they sort in the wrong order. Does "update" mean something other than a data update, such as a settings update? If so, if there a way to sort the channels by the more recent data update? meaning of "Updated" column in "My Channels" view In the channels list page, the updated at is when the channels' settings were last updated. I can see the confusion and we'll look to clarify this in an upcoming release. Thanks Vinod. It would be great if we could sort by data activity (most recent data update). For commercial ThingSpeak user with many devices/customers, it would provide a quick indicator where teh activity is among users/channels. New release deployed today. Updated at is now latest of when the channel or its settings were updated. update
Sergio R in MATLAB Answers
최근 활동: 2024년 8월 7일

Hello, in a ThingSpeak channel, I am reading every one second the information of two current signals (I have the licensed application). I currently have a MATLAB Analysis routine that adds those two signals and writes, on the same channel, the result of that sum. In the routine I can check that effectively if the sum of the two channels is being done. I do that now with a good result but my problem is that the channel is not updated except when I run MATLAB Analysis. How can I make the channel automatically update every second? ------------------------------------------------------------------------------- This is my routine: readChannelID = 123; readAPIKey = 'XXX'; writeChannelID = 123; writeAPIKey = 'YYY'; %%%%%%%%%%%%%%%%%%%%%% CALCULO DE CORRIENTE %%%%%%%%%%%%%%%%%%%%%% [Cte1, timeStamp] = thingSpeakRead(readChannelID,'Fields',1,'numPoints', 2, 'ReadKey', readAPIKey); anyMissingValues = sum(isnan(Cte1)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(Cte1),2)); cleanCte1 = Cte1(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanCte1 = Cte1; cleanTimeStamps = timeStamp; end [Cte2, timeStamp] = thingSpeakRead(readChannelID,'Fields',4,'numPoints', 2, 'ReadKey', readAPIKey); anyMissingValues = sum(isnan(Cte2)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(Cte2),2)); cleanCte2 = Cte2(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanCte2 = Cte2; cleanTimeStamps = timeStamp; end Corriente = round([cleanCte1 + cleanCte2],1); display (Corriente, 'Corriente') %%%%%%%%%%%%%%%%%%%%%% VOLTAJE %%%%%%%%%%%%%%%%%%%%%% [Voltaje, timeStamp] = thingSpeakRead(readChannelID,'Fields',2,'numPoints', 2, 'ReadKey', readAPIKey); anyMissingValues = sum(isnan(Voltaje)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(Voltaje),2)); cleanVoltaje = Voltaje(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanVoltaje = Voltaje; cleanTimeStamps = timeStamp; end display (cleanVoltaje, 'Voltaje') %%%%%%%%%%%%%%%%%%%%%% CALCULO DE POTENCIA %%%%%%%%%%%%%%%%%%%%%% Potencia = round([Corriente * cleanVoltaje],0) %%%%%%%%%%%%%%%%%%%%%% CALCULO DE ENERGIA %%%%%%%%%%%%%%%%%%%%%% [Energia1, timeStamp] = thingSpeakRead(readChannelID,'Fields',3,'numPoints', 2, 'ReadKey', readAPIKey); anyMissingValues = sum(isnan(Energia1)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(Energia1),2)); cleanEnergia1 = Energia1(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanEnergia1 = Energia1; cleanTimeStamps = timeStamp; end [Energia2, timeStamp] = thingSpeakRead(readChannelID,'Fields',5,'numPoints', 2, 'ReadKey', readAPIKey); anyMissingValues = sum(isnan(Energia2)); if sum(anyMissingValues) > 0 missingValueIndex = find(~sum(isnan(Energia2),2)); cleanEnergia2 = Energia2(missingValueIndex, :); cleanTimeStamps = timeStamp(missingValueIndex); else cleanEnergia2 = Energia2; cleanTimeStamps = timeStamp; end Energia = [cleanEnergia1 + cleanEnergia2]; display (Energia, 'Energia') %%%%%%%%%%%%%%%%% Write the results in fields 6, 7 and 8 of the same channel %%%%%%%%%%%%%%%%%%%% thingSpeakWrite(writeChannelID, 'Fields', [6,7,8], 'Values',... [Corriente, Potencia, Energia],'WriteKey',writeAPIKey); OUTPUT: Corriente = 3.4000 Voltaje = 116 Potencia = 394 Energia = 0.0040
Andrew Clark in Discussions
최근 활동: 2023년 11월 2일

Is there a way to get a handle or link to the database each time I do a WRITE or group of WRITEs? I need to access the set of records that comprises a user session, which could be many WRITEs. My impression is that Thingspeak appears as a continuous stream with no way to mark a set of WRITEs as a group or session. Methods I have tried like retrieval (READs) using timestamps and other after-the-fact queries are not very accurate or user friendly. Thanks. How can I track writes or updates to my channel You might consider using the MATLAB datastore type. Also you could set a note in an unused field or in the status and then query for that note or character or session ID. write update record level
Subtil Songeur in MATLAB Answers
최근 활동: 2021년 12월 1일

I get the data from my 2x dth11 (2x temp and 2x humidity) sensor and no error with this code, but thingspeak receved no data and i get only one loop. Any one see what wrong? #include <Ethernet.h> #include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros #include "DHT.h" #define DHT1PIN 10 // what pin we're connected to #define DHT2PIN 9 // Uncomment whatever type you're using! #define DHT1TYPE DHT11 // DHT 11 #define DHT2TYPE DHT11 // DHT 11 DHT dht1(DHT1PIN, DHT1TYPE); DHT dht2(DHT2PIN, DHT2TYPE); byte mac[] = { 0xDE, 0xAD, 0xBE, 0xXX, 0xXX, 0xXX }; // Set the static IP address to use if the DHCP fails to assign IPAddress ip(192, 168, X, XXX); IPAddress myDns(192, 168, X, X); EthernetClient client; unsigned long myChannelNumber = XXXXXX; const char * myWriteAPIKey = "XXXXXXXXXXXXXXX"; // Initialize our values int number1 = 0; int number2 = random(0,100); int number3 = random(0,100); int number4 = random(0,100); void setup() { Ethernet.init(10); // Most Arduino Ethernet hardware Serial.begin(115200); //Initialize serial while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo native USB port only } // start the Ethernet connection: Serial.println("Initialize Ethernet with DHCP:"); if (Ethernet.begin(mac) == 0) { Serial.println("Failed to configure Ethernet using DHCP"); // Check for Ethernet hardware present if (Ethernet.hardwareStatus() == EthernetNoHardware) { Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :("); while (true) { delay(1); // do nothing, no point running without Ethernet hardware } } if (Ethernet.linkStatus() == LinkOFF) { Serial.println("Ethernet cable is not connected."); } // try to congifure using IP address instead of DHCP: Ethernet.begin(mac, ip, myDns); } else { Serial.print(" DHCP assigned IP "); Serial.println(Ethernet.localIP()); } // give the Ethernet shield a second to initialize: delay(1000); ThingSpeak.begin(client); // Initialize ThingSpeak Serial.println("DHT11 Fonctionnel"); dht1.begin(); dht2.begin(); } void loop() { // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) float t1 = dht1.readTemperature(); float h1 = dht1.readHumidity(); float t2 = dht2.readTemperature(); float h2 = dht2.readHumidity(); // check if returns are valid, if they are NaN (not a number) then something went wrong! if (isnan(t1) || isnan(h1)) { Serial.println("Failed to read from DHT #1"); } else { Serial.print("Temperature entrée: "); Serial.print(t1); Serial.print(" *C "); Serial.print(" Humidity entrée: "); Serial.print(h1); Serial.println(" %\t"); } if (isnan(t2) || isnan(h2)) { Serial.println("Failed to read from DHT #2"); } else { Serial.print("Temperature sortie: "); Serial.print(t2); Serial.print(" *C "); Serial.print(" Humidity sortie: "); Serial.print(h2); Serial.println(" %\t"); } // set the fields with the values ThingSpeak.setField(1, dht1.readTemperature()); delay(10000); ThingSpeak.setField(2, dht1.readHumidity()); delay(10000); ThingSpeak.setField(3, dht2.readTemperature()); delay(10000); ThingSpeak.setField(4, dht2.readHumidity()); delay(10000); // write to the ThingSpeak channel // write to the ThingSpeak channel int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); if(x == 200){ Serial.println("Mise a jour du Canal."); } else{ Serial.println("Problem updating channel. HTTP error code " + String(x)); } // change the values number1++; if(number1 > 99){ number1 = 0; } number2 = random(0,100); number3 = random(0,100); number4 = random(0,100); delay(20000);// Wait 20 seconds to update the channel again }
theo koster in MATLAB Answers
최근 활동: 2021년 2월 17일

Using google app script I want to post measurements from my home domotics to a thingspeak channel. The chart has several charts. I am using the following code POST https://api.thingspeak.com/update.json api_key=XXXXXXXXXXXXXXXX field1=73 and after a few seconds POST https://api.thingspeak.com/update.json api_key=XXXXXXXXXXXXXXXX field2=100. In the channel it only updates the chart for field1. When I introduce a sleep of 15 seconds between the 2 posts, it will show both charts (field1 and field2). It seems not possible to send both posts with short intermediant times to update the both charts. Or should I use another way to achieve almost simultaneous updates of multiple charts ?

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.