Gert in Discussions
上次活动时间: 2024-10-4

Hi, My data send to thingspeak is not received/updated for the last 6 hours on the charts and dials. All worked well till about 6 hour ago. I am using Node-red and the API Url: https://thingspeak.com Any help please? Greetings Gert Data send to thingspeak not received/updated for the last 6 hours Try changing the API url in your nodeRED code to https://api.thingspeak.com. Thank you so much Vinod, the webb adress you sugested works well. My problem is solved. Have a blessed day. Greetings Gert data
Edward in MATLAB Answers
上次活动时间: 2024-7-3

I am sending data from sensors on a XIAO esp32 S3 - there are 6 fields of data - I have timed to send every 5 minutes. When I initiate the code it sends 2 or 3 sets, but then I get an error message saying 'Error sending data to ThingSpeak' - and it doesnt send any more data unless I reset the esp , yet the data is being collected as shown on the serial monitor. I have played around witht the time intervals but no joy. Is it a function of thinkspeak or should I investigate the code?
Graham in Discussions
上次活动时间: 2024-1-10

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
Roxy in MATLAB Answers
上次活动时间: 2023-5-7

I am trying to collect battery voltage data from arduino parts and upload it from arduino into my Thingspeak channel. So far, I have troubleshot the hardware/wiring aspect, and that doesn't seem to be the issue. At this point, I am assuming the issue is with the code or the Thingspeak channel. Since my arduino board (elegoo arduino Uno R3) is hooked up to my computer using a USB cord, I tried using an HTTP GET request in order to send the information to the Thingspeak channel. I am under a time crunch and am unable to access any kind of Wifi or Ethernet shield, so that is why I am using the USB cord. I could be completely wrong in using the HTTP GET request --I am quite the novice here! Here is the code so far: #include <SoftwareSerial.h> SoftwareSerial Serial1(2, 3); // RX, TX // Define variables float voltage; unsigned long previousMillis = 0; const long interval = 60000; // Upload interval (in milliseconds) String apiKey = "P5LPXSRJT0G4K7VA"; String field = "field1"; String server = "api.thingspeak.com"; String channelID = "2131761"; void setup() { Serial.begin(9600); Serial1.begin(9600); } void loop() { // Read voltage from sensor voltage = analogRead(A0) * 0.0049; // convert analog reading to voltage (0-5V) voltage = voltage * 5.17; // adjust the voltage to reflect the actual voltage // Print voltage to serial monitor Serial.print("Voltage: "); Serial.print(voltage); Serial.println(" V"); // Get current timestamp unsigned long currentMillis = millis(); // Check it's time to upload to ThingSpeak if (currentMillis - previousMillis >= interval) { // Update timestamp previousMillis = currentMillis; // Construct HTTP GET request String getRequest = "GET /update?api_key="; getRequest += apiKey; getRequest += "&"; getRequest += field; getRequest += "="; getRequest += String(voltage); getRequest += "&"; getRequest += "field2=Times"; getRequest += " HTTP/1.1\r\n"; getRequest += "Host: "; getRequest += server; getRequest += "\r\n"; getRequest += "Connection: close\r\n\r\n"; getRequest += "X-THINGSPEAK-CLIENT: arduino\r\n"; getRequest += "Content-Type: application/x-www-form-urlencoded\r\n"; getRequest += "Content-Length: "; getRequest += String(voltage); getRequest += "\r\n"; getRequest += "Host: api.thingspeak.com\r\n"; getRequest += "User-Agent: Arduino/1.0.0\r\n"; getRequest += "\r\n"; getRequest += "\r\n"; getRequest += channelID; // Send HTTP GET request to ThingSpeak via serial communication Serial1.println(getRequest); // Print response from ThingSpeak to serial monitor while (Serial1.available()) { Serial.write(Serial1.read()); } Serial.println(); } delay(1000); } Again, I really have no clue what I am doing here, so I am not surprised if what I have is entirely wrong. Any feedback is greatly appreciated!
Frederic Lhoest in Discussions
上次活动时间: 2022-11-18

Dear Community, I'm now on ThingSpeak for nearly 4 weeks and I'm struggling to compute some MATLAB data. Mostly because I don't know the syntax. I have a hourly graph of solar production in kW, I'm taking a sample every 20 seconds, and I would like to aggregate the data on a daily basis in kWh. I guess I need to select the last 7 days of data using some thingsread function, add the data into an array and compute the daily data into an average/sum ... As you can see, I mostly got the mechanics but I'm struggling to create the car ;) Is there anyone kind enough to assist me ? Thansk a lot ! How to compute and aggregate energy production Here it is in two glorious lines. Ive done it using the traffic monitor channel, since it posts data every 15 seconds, you can't read 7 days in one try. myData=thingSpeakRead(38629,'numdays',2,'outputformat','timetable'); newData=retime(myData,'hourly','sum'); Wow .... Ok let me try on my side and I'll let you know what I came up with ! Ok, so I gave it a try but without luck : Here is the code section : %% Read Data %% [data, time] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumDays', 2, 'ReadKey', readAPIKey); newData=retime(data,'hourly','sum'); %% Visualize Data %% plot(time, newData); title("Last 2 days Aggregation"); xlabel("Time"); ylabel("Production (Wh)"); I'm having this error : Incorrect number or types of inputs or outputs for function 'retime'. Error in aggregate (line 21) newData=retime(data,'hourly','sum'); In case of you wonder, Line 21 is where retime is used. Look at what else is different about the code I gave you, especially in the first line. I understood, I'm using an array with 2 dimensions ? right ? I'm sorry I'm discovering this language... Sure, welcome to MATLAB. Also look the the name, value pairs I used at the end to get a timetable output. The retime function needs a timetable to act on. You can see those requirements in the doc. MATLAB has famously good doc. I'm sorry but I'm still not able to do anything :-/ Please show me what you tried and what result you are getting. Here is some updated code. myData=thingSpeakRead(readChannelID,'numdays',2,'outputformat','timetable'... ,'ReadKey', readAPIKey); newData=retime(myData,'hourly','sum'); %% Visualize Data %% plot(newData.Timestamps, newData.(1)); title("Hourly Aggregation"); xlabel("Time"); ylabel("Production (Wh)"); Hi Christopher, Thanks a lot. I know what's hapening ... Matlab is too powerful ;) So, I have the data plot now, how can I geet a full week ? I can seemax 3 days. I know you're stating above I cannot see 7 days in one try, can you elaborate on that ? Since we are aggregating data now, we should have less data in one go ? Can you try the MATLAB onramp? Its really helpful to get going. If you still have troubles after that, consider starting a new thread on MATLAB answers. matlab aggregating data solar production formula help
Frederic Lhoest in Discussions
上次活动时间: 2022-10-12

Dear ThingSpeak, I would like to have more details about the free edition in terms of data retention. I already know how many data I can send on a yearly basis. But how long my data will remain in the platform ? Thanks. Data retention duration on ThingSpeak See the Licensing FAQ, item 24. Here is what is presently says: Free users are limited to 10 million messages (3+ years at minimum update interval) Paid users are limited to 100 million messages per unit (3+ years at minimum update interval) If storage is exceeded, your channels may no longer be able to receive data Long term archiving of data for paid customers is available. Email thingspeak-sales@mathworks.com for options. According the the current policy, free users can store up to 10 million messages before we will delete your data, assuming your account is active. You can also download your channel data at any time using the read data API, in MATLAB (ThingSpeakRead) or the web interface for channel data export. Thanks Christopher, this is all the info I needed ! licensing data retention
Adeola in MATLAB Answers
上次活动时间: 2022-5-4

Can I send data to ThingSpeak without WiFi? What other options are available in place of WiFi, please?
Vlad Breaban in Discussions
上次活动时间: 2022-4-29

Hello, I need an endpoint to retrive my file with data from my channel. Do you think is this possible? Notice that i do not want to press export data button, i want an endpoint to use in a personal project. Thank you. API to retrive file which contains data from my channel Found the answer here: https://www.mathworks.com/help/thingspeak/read-data-from-channel.html api data. file download
Walter Diego Spaltro in Discussions
上次活动时间: 2022-3-31

Hi all, don't upload data to Thingspeak (sorry my english) I'm build this counter geiger <https://www.electronics-lab.com/project/new-improved-geiger-counter-now-wifi/> but not upload data, only appear this to my channel: 29T23:17:58Z","entry_id":112,"field1":null},{"created_at":"2022-03-29T23:22:58Z","entry_id":113,"field1":null},{"created_at":"2022-03-29T23:27:58Z","entry_id":114,"field1":null},{"created_at":"2022-03-29T23:32:58Z","entry_id":115,"field1":null},{"created_at":"2022-03-30T18:43:09Z","entry_id":116,"field1":null},{"created_at":"2022-03-30T19:00:19Z","entry_id":117,"field1":null},{"created_at":"2022-03-30T19:05:19Z","entry_id":118,"field1":null},{"created_at":"2022-03-30T19:10:19Z","entry_id":119,"field1":null}]} The code I'm use is there <https://www.electronics-lab.com/project/new-improved-geiger-counter-now-wifi/> sorry it does not allow me to upload it because it is long Don't upload data to Thingspeak That's a neat demo, thanks for sharing, I think Ill make one! Are you sure there is data coming from the detector? Can you see data on the serial monitor? Try hardcoding a number in your code instead of using a variable. If the hard coded number works, then the problem is the data in your variable. Also, I cant really see in the code where it handles the POST to ThingSpeak. Can you show that part of the code? (just the HTTP post part, and possible where the data is formed) ok found the code <https://github.com/pra22/GC-20/blob/master/src/main.cpp here> . In the section below, replace all the variables with string numbers, for example: String(averageCount) --> "22.34" and so on. Then watch your ThingSpeak channel and see if those numbers show up. that will help isolate the problem. if (deviceMode) // deviceMode is 1 when in monitoring station mode. Uploads CPM to thingspeak every 5 minutes { currentUploadTime = millis(); if ((currentUploadTime - previousUploadTime) > 300000) { previousUploadTime = currentUploadTime; if (client.connect(server, 80)) { String postStr = channelAPIkey; postStr += "&field2="; postStr += String(averageCount); postStr += "\r\n\r\n"; char temp[50] = "X-THINGSPEAKAPIKEY:"; strcat(temp, channelAPIkey); strcat(temp, "\n"); client.print("POST /update HTTP/1.1\n"); client.print("Host: api.thingspeak.com\n"); client.print("Connection: close\n"); client.print(temp); client.print("Content-Type: application/x-www-form-urlencoded\n"); client.print("Content-Length: "); client.print(postStr.length()); client.print("\n\n"); client.print(postStr); Serial.println(postStr); } client.stop(); } Did you export only field 1 above by the way? The code that I found writes to field 2. Make sure field 2 is enabled. Hi Christopher, thanks for your answer, I solved it with your answer of activating "field2", and now it works fine, but it restarts after I turn it off and I have to reprogram it to make it work again. Tell me what is the problem? Thanks a lot!!! geiger upload data
Shafae Ali in MATLAB Answers
上次活动时间: 2021-11-15

I am collecting data with a sensor and uploading it every 15 seconds to ThingSpeak. The data records in the graph over time. If I record a week of data, will I be able to export all of it or is there a limit where old data is deleted?
MathWorks Support Team in MATLAB Answers
上次活动时间: 2021-8-26

How do I view the "Data Export" button in the privately shared channel in ThingSpeak? This button is available for Public Channels i.e., channels shared with "Share channel view with everyone" option. But the button is not available for privately shared channel i.e., "Share channel view only with the following users" option. How can I save the feed as a CSV for privately shared channel? kA00Z000000oTKvSAM 000092334
Sebastian Mondi in Discussions
上次活动时间: 2021-5-28

Hello everyone. Yesterday i started my project and now im trying to export data files (CSV) but it is empty. It cointains just the headers and last read (i think). Anyone knows what is happening? Example CSV exported created_at,entry_id,field1,field2,field3,latitude,longitude,elevation,status 2021-05-26 19:39:23 -03,1,25.00,"43.00 ",,,,, 2021-05-26 19:39:39 -03,2,24.80,40.00" Export data CSV - empty file Have you waited until the file has completed download before opening up the CSV-file? Yes, many times Maybe try a different browser to download the file? If you still see the problem, can you attach your downloaded CSV-file? I tried the download on multiple channels and I see a CSV-file with data. I've tryed with Chrome and Edge, same problem. There is attached the file downloaded. Thank you!! That file seems to have 1156 records as I see it. The data seems to be one minute apart, from 5/26 to 5/27. export csv data report
Stefanie Kölbl in MATLAB Answers
上次活动时间: 2021-4-2

Hey there, I have to collect some Data out of a chart. The problem is, that the data is just shown in a straight line because something in the x-Axis changed. Is there a possibility to show just a part of a chart, so it shows the Data of just one day?
Sreerag Haridas EM in Discussions
上次活动时间: 2021-3-17

Can't get the last data from a particular channel. is there any way to help me out Can't get the last data from a particular channel Can you provide some more details? What have you tried, and what was the result? Have a look in the help documentation, there is a section on how to R <https://www.mathworks.com/help/thingspeak/read-data-from-channel.html Read Data> data
Lemuel Aldwin Garcia in Discussions
上次活动时间: 2021-2-3

Hi, I would like to export data from my channel. My channel receives data every 15 minutes but I would like to export the data similar to what I can see when I change the chart/field's timescale to 60 minutes. Thanks! How to export a time-scaled data You can use the API to export data on a 60 minute timescale. Have a look at the query string parameters in the <https://www.mathworks.com/help/thingspeak/readdata.html read data> call, for example sum, timescale, and average. You can use json, xml, or csv data formats for the exported data. data export channel timescale
MATTHEW SKVASIK in MATLAB Answers
上次活动时间: 2020-12-29

Hello everyone, I am a relative noob at working with my ESP8266 module to send data to Thinkspeak. I am working on an IoT gardening project based off this project here at: https://electronics-project-hub.com/send-data-to-thingspeak-using-esp8266/?unapproved=2828&moderation-hash=c443edfb54a5ca6cbba3000d29eac3e9#comment-2828 I have tried many times to compile both components of this project. I am receiving data on serial monitor, and my ESP is connected to my wifi but on thingspeak only receiving a line of zeros. https://thingspeak.com/channels/1251273 Here are a few things I have checked: my TX/RX and they are OK, as they get moved in position between these two codes, my API key is correct, as far as I can tell. Does anyone have any recommendations they could make? I am stumped. I can post my code if that would be helpful. Many thanks!
Geoff Champion in MATLAB Answers
上次活动时间: 2020-8-14

I have a device outputting at approx. 5 second intervals but Thingspeak updates at 15 second intervals. What is happening to the lost messages please? Geoff
Marek Hamza in MATLAB Answers
上次活动时间: 2020-1-5

Hello! How do I pick up a data in the specific time period through all the days back? This is my code so far... % set time range from 8H to 12H of every day S = timerange('08:00:00','12:00:00'); % Read Temperature Data data = thingSpeakRead(readChannelID,'Fields',TemperatureFieldID, ... 'timerange',S, 'ReadKey',readAPIKey); % Calculate the maximum and minimum temperatures in the period [maxTempF] = max(data); [minTempF] = min(data); I would be so happy for any ideas :)
Andreas Schmitz in MATLAB Answers
上次活动时间: 2019-11-21

Hi, I'm trying to export my entire channel's feeds via the the Data Import/Export tab, but I get the HTTP time out error 504 after a while and the download does not start. The csv feed I want to download it's pretty big, I'm not sure if the size is related to the problem I'm having. Thank you in avdance! BR, Andreas
www in MATLAB Answers
上次活动时间: 2019-9-16

Hello, I want to run code with the data I get from a channel...How could I do it? Thanks.
MathWorks Support Team in MATLAB Answers
上次活动时间: 2019-4-25

I was sending messages to the ThingSpeak platform when I had a trial.  I didn&#39;t realize that I had reached the limit of messages I could send, and none of the messages were sent. Is this data stored somewhere? Can I get it back? kA00Z000001DfYYSA0 000113395
Pritesh Shah in MATLAB Answers
上次活动时间: 2016-5-26

Dear All, We are getting real-time data using TCP/IP protocol. We intend to use IOT(Internet of Things) to read data from our plants. (Thing speak). Any idea or suggestions are welcome. Thank you in advance.

关于 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.