Main Content

Results for

Hi

I am a total newb.

I recently created a Channel and two data Fields with their associated charts.

I was then experimenting; playing around with the timescale setting re one of the charts. I selected a range of options and then wondered some, so looked into the function re the options. I now that worked out and wish to simply return to the plotting of all points as they are delivered up from my data source.

However; I can toggle between timescale numbers - however, I cannot revert to no timescale - in other words; to plot every point on the chart.

Please help me return my chart to how it was by default re timescale.

Dear Sir, I have configure the thing-speak account for our monitoring system.But I have two issue regarding this as shown below; 1.whatever the field i have configure in the channel number 1,2...8,with respective tag, same tag is not reflected on graph.i just shown to you for your reference in the attachments. 2 whatever the excel file is generating based on input data it takes 7 minutes of delay.after live capturing. can you please resolve this issue for me

wael elsisi
wael elsisi
Last activity on 23 Mar 2021

I am working on a project using Sigfox How to write code to read and Analyze Data in Apps MATLAB Analysis ? I have created fields: Temperature (float) , Humidity(float) , and Moisture(string) . Would you mind helping me?

Hi all,
I hope everyone is doing well and keeping safe. I was wondering, are there any Cody challenges for Simulink these days?
I saw a post from 2015 (https://blogs.mathworks.com/simulink/2015/08/07/modeling-and-simulation-challenge-in-cody/) and it seems there was a Simulink or "Modeling and Simulation Challenge" problem group, but I couldn't find this group anymore. Perhaps I missing something?
Thank you beforehand.
Tungky

>>

Good evening everyone. I have doubts in the display of graphics. The vertical axis means meant and if collected from my sensor. How often are they being plotted. I modified the code to "tempF = thingSpeakRead (readChannelID, 'Fields', TemperatureFieldID, ... 'NumMinutes', 20 * 60, 'ReadKey', readAPIKey); In this case, it would be samples from the last 20 hours. So what does each value displayed on the vertical axis mean?

% Read temperature for the last 10 hours from a ThingSpeak channel and % visualize temperature variations using the MATLAB HISTOGRAM function.

% Channel 12397 contains data from the MathWorks Weather Station, located % in Natick, Massachusetts. The data is collected once every minute. Field % 4 contains temperature data. % Channel ID to read data from readChannelID = 1265072;

% Temperature Field ID TemperatureFieldID = 1;

% Channel Read API Key % If your channel is private, then enter the read API % Key between the '' below: readAPIKey = 'HGPTIKZABQ4DUC8J';

% Get temperature data from field 4 for the last 10 hours = 10 x 60 % minutes. Learn more about the THINGSPEAKREAD function by going to % the Documentation tab on the right side pane of this page.

tempF = thingSpeakRead(readChannelID,'Fields',TemperatureFieldID,... 'NumMinutes',20*60, 'ReadKey',readAPIKey);

histogram(tempF); xlabel('Temperature em ºC'); ylabel('Amostras coletadas'); title('Variação de temperatura');

Hello! I am working on a project to monitor agricultural variables. The sample rate is 20 minutes, but I need to transmit the data every 2 hours to the server to save power. To send the data I use the SIM800 module. How can I do it?

Hi guys,

I'm using Thingspeak to log data for my small weather station project. The data then gets sent to an Airtable using React and ThingHTTP. When I check the exported CSV from Thingspeak I can see the data being logged at regular intervals — every 5 minutes, 3 seconds in. However, something happens with React/ThingHTTP, because the Airtable log doesn't match. Every hour or so, the entry will have an added minute (13:01, 17:01, etc). Why does this happen? React is programmed to use ThingHTTP whenever Field1 is different from 0.

I'm currently taking a MATLAB app programming class, and for our final project we need to store some user modified variables to the cloud, so it can be read by other users when they open the app. I was thinking about using Thingspeak to store the variable (2x10000 table) but thingspeak requires a timestamp for all inputs of data as a 2D array/table. And if I tried to store it as two separate 1D arrays, it would store each value to each field, instead of as a separate fields. Any way to make this simpler? Maybe there's a better IoT solution out there for this process?

I wanted to use MQTT to publish data to my ThingSpeak client. However, on one of the forums it said, "The MQTT broker does not presently parse JSON".

Hello. I am working on a project to monitor agricultural variables. The module that I designed transmits the data by GSM, with the SIM800 module every 30 minutes takes a sample. My problem is the following, I need to transmit the stored data every 2 hours every 30 minutes, but I don't know how to do that. In the line of code "GET / update? Api_key = EXNLVJJTBY17SM8V & field1 = ........", you can add the time of each sample. This would save energy by sending 4 data every 2 hours

if true
 altSerial.println("AT+CIPSHUT");delay(4000);
altSerial.println("AT+CIPSTATUS");
delay(5000);
   altSerial.println("AT+CIPMUX=0");
   delay(5000);
     altSerial.println("AT+CSTT=igprs.claro.com.ar");delay(2000);
     altSerial.println("AT+CIICR");delay(5000);
     altSerial.println("AT+CIFSR");delay(5000);
     //altSerial.println("AT+CIPSPRT=0");delay(4000);
     altSerial.println("AT+CIPSTART=\"TCP\",\"184.106.153.149\",\"80\"");delay(3000);
    //String mensaje
     String S_Bateria =String(Bateria,2);
     String Humedad_1 = String(S_Humedad_1,2);
     String Humedad_2 = String(S_Humedad_2,2);
     String fila = String("&field2=");
     String fila1 = String("&field3=");
     String stringUno= String("GET /update?api_key=EXNLVJJTBY17SM8U&field1=");
     String URL =String(stringUno + Humedad_1 + fila + Humedad_2 + fila1 + S_Bateria);
     int Largo=URL.length();
     Largo= Largo+3;
     String Memoria= String (String("AT+CIPSEND=")+String(Largo));
     altSerial.println(Memoria);delay(2000);
     altSerial.println(URL);altSerial.println("");
     //altSerial.println((char)26);puerto();delay(4000);
      delay(15000);
      altSerial.println("AT+CIPSHUT");delay(4000);
  end

Hi i want to ask is there any way that we can add more field in our channel? because by default the field is only eight and i need to use more field

Hi, I am sending data from my device to the thingspeak server using HTTP and I'm trying to attach a timestamp with my uploads. I am using the created_at field in the request to set the time zone. A sample request looks like this

http://api.thingspeak.com/update?api_key=xxxyyyzzz&field1=3407.866699&field2=0.000000&field3=0.000000&field4=0.000000&field5=0.000000&field6=0.000000&field7=0.000000&field8=0.000000&created_at=2021-02-17T15:34:00+05:30

I live in India and my timezone offset is 5 hours 30 min. When I specify it like as shown above, I can see in the private view of my channel that it is adding 5 hours 30 min to the given time zone. So this time stamp becomes 21:04. How do I fix this? Am I making some mistake in my time zone offset in created_at? Or is there some time zone setting that is not set properly in my channel?

Thanks, Ashwin N

I followed the instructions here: Bulk-Update Using an Arduino or an ESP8266

And came up the following code for GSM module:

      const char apn[] = "www";
      const char gprsUser[] = "";
      const char gprsPass[] = "";
      const char simPIN[] = "";
      const char server[] = "api.thinkspeak.com";
      const int port = 80;
      char jsonBuffer[500] = "["; // Initialize the jsonBuffer to hold data
      // TTGO T-Call pins
      #define MODEM_RST            5
      #define MODEM_PWKEY          4
      #define MODEM_POWER_ON       23
      #define MODEM_TX             27
      #define MODEM_RX             26
      #define SerialMon Serial
      #define SerialAT Serial1
      #define TIMEOUT  5000 
      // Configure TinyGSM library
      #define TINY_GSM_MODEM_SIM800      // Modem is SIM800
      #define TINY_GSM_RX_BUFFER   1024  // Set RX buffer to 1Kb
      #include <TinyGsmClient.h>
      #ifdef DUMP_AT_COMMANDS
        #include <StreamDebugger.h>
        StreamDebugger debugger(SerialAT, SerialMon);
        TinyGsm modem(debugger);
      #else
        TinyGsm modem(SerialAT);
      #endif
      TinyGsmClient client(modem);
      #define IP5306_ADDR          0x75
      #define IP5306_REG_SYS_CTL0  0x00
      /* Collect data once every 15 seconds and post data to ThingSpeak channel once every 2 minutes */
      unsigned long lastConnectionTime = 0; // Track the last connection time
      unsigned long lastUpdateTime = 0; // Track the last update time
      const unsigned long postingInterval = 60L * 1000L; // Post data every 2 minutes
      const unsigned long updateInterval = 15L * 1000L; // Update once every 15 seconds
      void setup() {
        SerialMon.begin(115200);
        // Set modem reset, enable, power pins
        pinMode(MODEM_PWKEY, OUTPUT);
        pinMode(MODEM_RST, OUTPUT);
        pinMode(MODEM_POWER_ON, OUTPUT);
        digitalWrite(MODEM_PWKEY, LOW);
        digitalWrite(MODEM_RST, HIGH);
        digitalWrite(MODEM_POWER_ON, HIGH);
        // Set GSM module baud rate and UART pins
        SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
        delay(3000);
        SerialMon.println("Initializing modem...");
        modem.init();
        // Configure the wake up source as timer wake up  
        SerialMon.print("Connecting to APN: ");
        SerialMon.print(apn);
        if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {
          SerialMon.println(" fail");
        }
        else {
          SerialMon.println(" OK");
          SerialMon.print("Connecting to ");
          SerialMon.print(server);
          if (!client.connect(server, port)) {
            SerialMon.println(" Fail");
          }
          else {
            SerialMon.println(" OK");
          }
        }
      }
      void loop() {
        // If update time has reached 1 second, then update the jsonBuffer
        if (millis() - lastUpdateTime >=  updateInterval) {
          updatesJson(jsonBuffer);
        }
      }
      // Updates the josnBuffer with data
      void updatesJson(char* jsonBuffer){
        /* JSON format for updates paramter in the API
         *  This examples uses the relative timestamp as it uses the "delta_t". You can also provide the absolute timestamp using the "created_at" parameter
         *  instead of "delta_t".
         *   "[{\"delta_t\":0,\"field1\":-70},{\"delta_t\":3,\"field1\":-66}]"
         */
        // Format the jsonBuffer as noted above
        strcat(jsonBuffer,"{\"delta_t\":");
        unsigned long deltaT = (millis() - lastUpdateTime)/1000;
        size_t lengthT = String(deltaT).length();
        char temp[4];
        String(deltaT).toCharArray(temp,lengthT+1);
        strcat(jsonBuffer,temp);
        strcat(jsonBuffer,",");
        int h = hallRead(); 
        strcat(jsonBuffer, "\"field1\":");
        lengthT = String(h).length();
        String(h).toCharArray(temp,lengthT+1);
        strcat(jsonBuffer,temp);
        strcat(jsonBuffer,"},");
        // If posting interval time has reached 2 minutes, update the ThingSpeak channel with your data
        if (millis() - lastConnectionTime >=  postingInterval) {
              size_t len = strlen(jsonBuffer);
              jsonBuffer[len-1] = ']';
              httpRequest(jsonBuffer);
        }
        lastUpdateTime = millis(); // Update the last update time
      }
      // Updates the ThingSpeakchannel with data
      void httpRequest(char* jsonBuffer) {
        /* JSON format for data buffer in the API
         *  This examples uses the relative timestamp as it uses the "delta_t". You can also provide the absolute timestamp using the "created_at" parameter
         *  instead of "delta_t".
         *   "{\"write_api_key\":\"YOUR-CHANNEL-WRITEAPIKEY\",\"updates\":[{\"delta_t\":0,\"field1\":-60},{\"delta_t\":15,\"field1\":200},{\"delta_t\":15,\"field1\":-66}]
         */
        // Format the data buffer as noted above
        char data[500] = "{\"write_api_key\":\"XXXXXXXXXXXXXXXX\",\"updates\":"; // Replace YOUR-CHANNEL-WRITEAPIKEY with your ThingSpeak channel write API key
        strcat(data,jsonBuffer);
        strcat(data,"}");
        // Close any connection before sending a new request
        client.stop();
        String data_length = String(strlen(data)+1); //Compute the data buffer length
        Serial.println(data);
        // POST data to ThingSpeak
        if (client.connect(server, 80)) {
          client.println("POST /channels/1300373/bulk_update.json HTTP/1.1"); // Replace YOUR-CHANNEL-ID with your ThingSpeak channel ID
          client.println("Host: api.thingspeak.com");
          client.println("User-Agent: mw.doc.bulk-update (ESP8266)");
          client.println("Connection: close");
          client.println("Content-Type: application/json");
          client.println("Content-Length: "+data_length);
          client.println();
          client.println(data);
          String answer=getResponse();
          Serial.println( answer );
        }
        else {
          Serial.println("Failure: Failed to connect to ThingSpeak");
        }
        delay(250); //Wait to receive the response
        client.parseFloat();
        String resp = String(client.parseInt());
        Serial.println("Response code:"+resp); // Print the response code. 202 indicates that the server has accepted the response
        jsonBuffer[0] = '['; //Reinitialize the jsonBuffer for next batch of data
        jsonBuffer[1] = '\0';
        lastConnectionTime = millis(); //Update the last conenction time
      }
      String getResponse(){
        String response;
        long startTime = millis();
        delay( 200 );
        while ( client.available() < 1 && (( millis() - startTime ) < TIMEOUT ) ){
              delay( 5 );
        }
        if( client.available() > 0 ){ // Get response from server.
           char charIn;
           do {
               charIn = client.read(); // Read a char from the buffer.
               response += charIn;     // Append the char to the string response.
              } while ( client.available() > 0 );
          }
        client.stop();
        return response;
      }

The Response code I was getting initially was "0" Upon consulting the forum I added a new function to get response and here is the message it produced:

HTTP/1.1 405 Not Allowed
Server: nginx
Date: Wed, 17 Feb 2021 06:27:54 GMT
Content-Type: text/html
Content-Length: 8911
Connection: close
ETag: "5e5304fb-22cf"
X-DIS-Request-ID: 82c8c8535e18295aaeec025d18d14375
Set-Cookie: dis-remote-addr=1.39.31.10
Set-Cookie: dis-timestamp=2021-02-16T22:27:54-08:00
Set-Cookie: dis-request-id=82c8c8535e18295aaeec025d18d14375
X-Frame-Options: sameorigin

Please help me understand this error and rectify the code. P.S. I was able to run the code using WiFi module of the ESP32, so is this something to do with 256 limit? If so, how do I rectify it?

After I give the commands I get a response like this

AT+CIPSTART="TCP","api.thingspeak.com","80" OK

CONNECT OK AT+CIPSEND > GET https://api.thingspeak.com/update?api_key=Q03CA55P7NVGA8S8&field1=23 SEND OK

CLOSED

But the field charts are not updated in the website. And the data widget shows "no data available to show". And the number of entries remains 0. kindly help me out why I didn't get the values.

I have an Esp8266 weather station and I want the graphs in thingspeak to display customary units instead of metric. How do I do it?

Hello,

I would like to share a channel with some users, but when I do it, they can see the channel in "Channels share with me" but when they open the channel the can not see the data inside. There is a message saying: You don't have permission to view that channel! Do you know why is that? Thank you.

Hi there, my PI submitted some (3) wrong values to my channel. I didn't find am opportunity to remove them. Can anoyone help or give me a hint? Those 3 wrong values are killing my statistic and let the chart look very wrog due to those peaks Thanx to you

ok I want to extract all those rows in a table where one column has strings in which it shall contain the word "change" specifically after the word "terms" . text is : May not be redeemed for cash or combined with any other offer or coupon. Not valid on clearance (merchandise ending in .98). May not be applied to taxes, previous purchases, or the purchase of gift cards. Non-transferable. Terms are subject to change at any time. Product styles are subject to availability. See store associate for details.

Hello, I am interested in creating an IoT academic project, but I have encountered two difficulties: 1- It is necessary that in the ThingSpeak interface you can see a live camera. I have not found documentation or any information on how to do it. Yes, I know that you can import data from other websites (copy XPath), but I have not achieved it with traffic cameras from local websites. 2- I also need to act remotely on actuators, is this possible in ThingSpeak?

I would appreciate an honest answer, since in case of not being able to implement these solutions, I will have to find another platform or method to carry out this. Regards!