Main Content

Results for

i am trying to decode the below sketch to integrate TTNv3 to thingspeak.

can someone help me with this issue

#include <lmic.h>
#include <dht.h>
#include <hal/hal.h>
#include <SPI.h>
dht DHT;
#define DHT11_PIN 5
#define PIN_A A0
float temperature,humidity;      
float tem,hum;
unsigned int count = 1;        //For times count
String datastring1="";        
String datastring2="";        
String datastring3="";
static uint8_t mydata[11] = {0x01,0x67,0x00,0x00,0x02,0x68,0x00,0x03,0x65,0x00,0x00};
/* LoRaWAN NwkSKey, network session key
   This is the default Semtech key, which is used by the prototype TTN
   network initially.
   ttn*/
static const PROGMEM u1_t NWKSKEY[16] = { 0x72, 0x13, 0xF8, 0xF0, 0x9A, 0x3C, 0xF9, 0xE5, 0xE6, 0x01, 0xDA,0xAC, 0x32, 0xBA, 0x37 };
/* LoRaWAN AppSKey, application session key
   This is the default Semtech key, which is used by the prototype TTN
   network initially.
   ttn*/
static const u1_t PROGMEM APPSKEY[16] = { 0x2F, 0xF5, 0xF4, 0x08, 0x4E, 0x37, 0x20, 0x02, 0xBA, 0x2B, 0xED,  0x40, 0x24, 0xA2, 0x945 };
/*
 LoRaWAN end-device address (DevAddr)
 See http://thethingsnetwork.org/wiki/AddressSpace
 ttn*/
static const u4_t DEVADDR = 0x260D0CA5;
/* These callbacks are only used in over-the-air activation, so they are
  left empty here (we cannot leave them out completely unless
   DISABLE_JOIN is set in config.h, otherwise the linker will complain).*/
void os_getArtEui (u1_t* buf) { }
void os_getDevEui (u1_t* buf) { }
void os_getDevKey (u1_t* buf) { }
static osjob_t initjob,sendjob,blinkjob;
/* Schedule TX every this many seconds (might become longer due to duty
 cycle limitations).*/
const unsigned TX_INTERVAL = 10;
// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 9,
    .dio = {2, 6, 7},
};
void do_send(osjob_t* j){
    // Check if there is not a current TX/RX job running
    if (LMIC.opmode & OP_TXRXPEND) {
        Serial.println("OP_TXRXPEND, not sending");
    } else {
          dhtTem();
          light();
          // Prepare upstream data transmission at the next possible time.
          //  LMIC_setTxData2(1,datasend,sizeof(datasend)-1,0);
          LMIC_setTxData2(1, mydata, sizeof(mydata), 0);
          Serial.println("Packet queued");
          Serial.print("LMIC.freq:");
          Serial.println(LMIC.freq);
          Serial.println("Receive data:");
      } 
      // Next TX is scheduled after TX_COMPLETE event.
  }
void onEvent (ev_t ev) {
    Serial.print(os_getTime());
    Serial.print(": ");
    Serial.println(ev);
    switch(ev) {
        case EV_SCAN_TIMEOUT:
            Serial.println(F("EV_SCAN_TIMEOUT"));
            break;
        case EV_BEACON_FOUND:
            Serial.println(F("EV_BEACON_FOUND"));
            break;
        case EV_BEACON_MISSED:
            Serial.println(F("EV_BEACON_MISSED"));
            break;
        case EV_BEACON_TRACKED:
            Serial.println(F("EV_BEACON_TRACKED"));
            break;
        case EV_JOINING:
            Serial.println(F("EV_JOINING"));
            break;
        case EV_JOINED:
            Serial.println(F("EV_JOINED"));
            break;
        case EV_RFU1:
            Serial.println(F("EV_RFU1"));
            break;
        case EV_JOIN_FAILED:
            Serial.println(F("EV_JOIN_FAILED"));
            break;
        case EV_REJOIN_FAILED:
            Serial.println(F("EV_REJOIN_FAILED"));
            break;
        case EV_TXCOMPLETE:
            Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));
            if(LMIC.dataLen) {
                // data received in rx slot after tx
                Serial.print(F("Data Received: "));
                Serial.write(LMIC.frame+LMIC.dataBeg, LMIC.dataLen);
                Serial.println();
            }
            // Schedule next transmission
            os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
            break;
        case EV_LOST_TSYNC:
            Serial.println(F("EV_LOST_TSYNC"));
            break;
        case EV_RESET:
            Serial.println(F("EV_RESET"));
            break;
        case EV_RXCOMPLETE:
            // data received in ping slot
            Serial.println(F("EV_RXCOMPLETE"));
            break;
        case EV_LINK_DEAD:
            Serial.println(F("EV_LINK_DEAD"));
            break;
        case EV_LINK_ALIVE:
            Serial.println(F("EV_LINK_ALIVE"));
            break;
         default:
            Serial.println(F("Unknown event"));
            break;
    }
}
void setup() {
     // initialize digital pin  as an output.
      Serial.begin(9600);
      while(!Serial);
      Serial.println("Connect to TTN and Send data to mydevice(Use DHT11 Sensor):");
      #ifdef VCC_ENABLE
      // For Pinoccio Scout boards
      pinMode(VCC_ENABLE, OUTPUT);
      digitalWrite(VCC_ENABLE, HIGH);
      delay(1000);
      #endif
      // LMIC init
      os_init();
      // Reset the MAC state. Session and pending data transfers will be discarded.
      LMIC_reset();
      /*LMIC_setClockError(MAX_CLOCK_ERROR * 1/100);
       Set static session parameters. Instead of dynamically establishing a session
       by joining the network, precomputed session parameters are be provided.*/
      #ifdef PROGMEM
      /* On AVR, these values are stored in flash and only copied to RAM
         once. Copy them to a temporary buffer here, LMIC_setSession will
         copy them into a buffer of its own again.*/
      uint8_t appskey[sizeof(APPSKEY)];
      uint8_t nwkskey[sizeof(NWKSKEY)];
      memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
      memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
      LMIC_setSession (0x1, DEVADDR, nwkskey, appskey);
      #else
      // If not running an AVR with PROGMEM, just use the arrays directly 
      LMIC_setSession (0x1, DEVADDR, NWKSKEY, APPSKEY);
      #endif
       for (int channel=0; channel<8; ++channel) {
      LMIC_disableChannel(channel);
    }
    for (int channel=16; channel<72; ++channel) {
       LMIC_disableChannel(channel);
    }
      // Disable link check validation
      LMIC_setLinkCheckMode(0);
      // TTN uses SF9 for its RX2 window.
      LMIC.dn2Dr = DR_SF9;
      // Set data rate and transmit power (note: txpow seems to be ignored by the library)
      LMIC_setDrTxpow(DR_SF7,14);
      // Start job
      do_send(&sendjob);
  }
  void dhtTem()
  {
         int16_t tem1;
         temperature = DHT.read11(DHT11_PIN);    //Temperature detection
         tem = DHT.temperature*1.0;      
        float humidity = DHT.read11(DHT11_PIN);
        float hum = DHT.humidity* 1.0;
        Serial.print(F("###########    "));
         Serial.print(F("NO."));
         Serial.print(count);
         Serial.println(F("    ###########"));
         Serial.println(F("The temperautre and humidity :"));
         Serial.print(F("["));
         Serial.print(tem);
         Serial.print(F("℃"));
         Serial.print(F(","));
         Serial.print(hum);
         Serial.print(F("%"));
         Serial.print(F("]"));
         Serial.println("");
         count++;
         tem1=(tem*10);
         mydata[2] = tem1>>8;
         mydata[3]= tem1;
         mydata[6] = hum * 2;
}
void light(){
      int16_t lux;
      int val,val1;
      val=analogRead(PIN_A);
     // Serial.print(F("a:"));
      //Serial.println(val);
      delay(500);
      val1=val*1.0;
      lux=val1;
      mydata[9]=lux>>8;
      mydata[10]=lux;
       //Serial.print(lux);
}
void loop() {
    os_runloop_once();
}

Hi there,

I have tried to get the data on thingspeak via integrating it on the things Network. but the GPS data I am receiving on the thingspeak is delayed by 2 mins.

is there any way I can code to send JSON file straight on thingspeak from the sensor or the gateway?

Following is the ardiuno sketch

#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include <SoftwareSerial.h>
#include <TinyGPS.h>
TinyGPS gps;
SoftwareSerial ss(3, 4); // Arduino RX, TX to conenct to GPS module.
static void smartdelay(unsigned long ms);
unsigned int count = 1;        //For times count
String datastring1="";        
String datastring2="";        
String datastring3="";
uint8_t datasend[20];     //Used to store GPS data for uploading
char gps_lon[20]={"\0"};  //Storage GPS info
char gps_lat[20]={"\0"}; //Storage latitude
char gps_alt[20]={"\0"}; //Storage altitude
float flat, flon,falt;
static uint8_t mydata[] = "Hello, world!";      //For test using.
/* LoRaWAN NwkSKey, network session key
   This is the default Semtech key, which is used by the prototype TTN
   network initially.
   ttn*/
static const PROGMEM u1_t NWKSKEY[16] =  { 0xE4, 0x2A, 0x93, 0x96, 0xF7, 0xC9, 0x65, 0x9E, 0xF8, 0x90, 0xC6, 0xA0, 0x1A, 0x88, 0xF7, 0x47 };
/* LoRaWAN AppSKey, application session key
   This is the default Semtech key, which is used by the prototype TTN
   network initially.
   ttn*/
static const u1_t PROGMEM APPSKEY[16] = { 0x75, 0x43, 0x26, 0xA1, 0x82, 0x79, 0x7F, 0xCF, 0x3C, 0x1D, 0xBF, 0xF9, 0xBF, 0xCB, 0xC6, 0xD9 };
/*
 LoRaWAN end-device address (DevAddr)
 See http://thethingsnetwork.org/wiki/AddressSpace
 ttn*/
static const u4_t DEVADDR = 0x260111D1;
/* These callbacks are only used in over-the-air activation, so they are
  left empty here (we cannot leave them out completely unless
   DISABLE_JOIN is set in config.h, otherwise the linker will complain).*/
void os_getArtEui (u1_t* buf) { }
void os_getDevEui (u1_t* buf) { }
void os_getDevKey (u1_t* buf) { }
static osjob_t initjob,sendjob,blinkjob;
/* Schedule TX every this many seconds (might become longer due to duty
 cycle limitations).*/
const unsigned TX_INTERVAL = 20;
// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 9,
    .dio = {2, 6, 7},
};
void do_send(osjob_t* j){
    // Check if there is not a current TX/RX job running
    if (LMIC.opmode & OP_TXRXPEND) {
        Serial.println("OP_TXRXPEND, not sending");
    } else {
        GPSRead();
        GPSWrite();
          // Prepare upstream data transmission at the next possible time.
            LMIC_setTxData2(1,datasend,sizeof(datasend)-1,0);
          //LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);
          Serial.println("Packet queued");
          Serial.print("LMIC.freq:");
          Serial.println(LMIC.freq);
          Serial.println("");
          Serial.println("");
          Serial.println("Receive data:");
      } 
      // Next TX is scheduled after TX_COMPLETE event.
  }
void onEvent (ev_t ev) {
    Serial.print(os_getTime());
    Serial.print(": ");
    Serial.println(ev);
    switch(ev) {
        case EV_SCAN_TIMEOUT:
            Serial.println("EV_SCAN_TIMEOUT");
            break;
        case EV_BEACON_FOUND:
            Serial.println("EV_BEACON_FOUND");
            break;
        case EV_BEACON_MISSED:
            Serial.println("EV_BEACON_MISSED");
            break;
        case EV_BEACON_TRACKED:
            Serial.println("EV_BEACON_TRACKED");
            break;
        case EV_JOINING:
            Serial.println("EV_JOINING");
            break;
        case EV_JOINED:
            Serial.println("EV_JOINED");
            break;
        case EV_RFU1:
            Serial.println("EV_RFU1");
            break;
        case EV_JOIN_FAILED:
            Serial.println("EV_JOIN_FAILED");
            break;
        case EV_REJOIN_FAILED:
            Serial.println("EV_REJOIN_FAILED");
            break;
        case EV_TXCOMPLETE:
            Serial.println("EV_TXCOMPLETE (includes waiting for RX windows)");
            if(LMIC.dataLen) {
                // data received in rx slot after tx
                Serial.print("Data Received: ");
                Serial.write(LMIC.frame+LMIC.dataBeg, LMIC.dataLen);
                Serial.println();
            }
            // Schedule next transmission
            os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
            break;
        case EV_LOST_TSYNC:
            Serial.println("EV_LOST_TSYNC");
            break;
        case EV_RESET:
            Serial.println("EV_RESET");
            break;
        case EV_RXCOMPLETE:
            // data received in ping slot
            Serial.println("EV_RXCOMPLETE");
            break;
        case EV_LINK_DEAD:
            Serial.println("EV_LINK_DEAD");
            break;
        case EV_LINK_ALIVE:
            Serial.println("EV_LINK_ALIVE");
            break;
         default:
            Serial.println("Unknown event");
            break;
    }
}
void setup() {
     // initialize digital pin  as an output.
      Serial.begin(9600);
       ss.begin(9600);  
      while(!Serial);
      Serial.println("LoRa GPS Example---- ");
      Serial.println("Connect to TTN");
      #ifdef VCC_ENABLE
      // For Pinoccio Scout boards
      pinMode(VCC_ENABLE, OUTPUT);
      digitalWrite(VCC_ENABLE, HIGH);
      delay(1000);
      #endif
      // LMIC init
      os_init();
      // Reset the MAC state. Session and pending data transfers will be discarded.
      LMIC_reset();
      /*LMIC_setClockError(MAX_CLOCK_ERROR * 1/100);
       Set static session parameters. Instead of dynamically establishing a session
       by joining the network, precomputed session parameters are be provided.*/
      #ifdef PROGMEM
      /* On AVR, these values are stored in flash and only copied to RAM
         once. Copy them to a temporary buffer here, LMIC_setSession will
         copy them into a buffer of its own again.*/
      uint8_t appskey[sizeof(APPSKEY)];
      uint8_t nwkskey[sizeof(NWKSKEY)];
      memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
      memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
      LMIC_setSession (0x1, DEVADDR, nwkskey, appskey);
      #else
      // If not running an AVR with PROGMEM, just use the arrays directly 
      LMIC_setSession (0x1, DEVADDR, NWKSKEY, APPSKEY);
      #endif
      // Disable link check validation
      LMIC_setLinkCheckMode(0);
      // TTN uses SF9 for its RX2 window.
      LMIC.dn2Dr = DR_SF9;
      // Set data rate and transmit power (note: txpow seems to be ignored by the library)
      LMIC_setDrTxpow(DR_SF7,14);
      // Start job
      do_send(&sendjob);
  }
void GPSRead()
{
  unsigned long age;
  gps.f_get_position(&flat, &flon, &age);
  falt=gps.f_altitude();  //get altitude    
  flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6;   
  flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6;//save six decimal places 
  falt == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : falt, 2;//save two decimal places
}
void GPSWrite()
{
  /*Convert GPS data to format*/
  datastring1 +=dtostrf(flat, 0, 4, gps_lat);   
  datastring2 +=dtostrf(flon, 0, 4, gps_lon);
  //datastring3 +=dtostrf(falt, 0, 2, gps_alt);
    if(flon!=1000.000000)
    {  
    strcat(gps_lon,",");
    strcat(gps_lon,gps_lat); 
    //strcat(gps_lon,","); 
    //strcat(gps_lon,gps_alt);
      int i = 0;
    for(i = 0; i < 2; i++)
    {
        //datasend.toFloat();
        atof(gps_lon);
       //Serial.println((char*)datasend);
      Serial.println("Testing converted data:");
      Serial.println(gps_lon);
      // atof(gps_alt);
      // Serial.print(gps_alt);
    }
    strcpy(datasend,gps_lon); //the format of datasend is longtitude,latitude,altitude
    Serial.print("###########    ");
    Serial.print("NO.");
    Serial.print(count);
    Serial.println("    ###########");
    Serial.println("The longtitude and latitude are:");
    Serial.print("[");
    Serial.print((char*)datasend);
    Serial.print("]");
    Serial.print("");
    /*
    for(int k = 0; k < 20;k++)
    {
    Serial.print("[");
    Serial.print(datasend[k], HEX);
    Serial.print("]");
    }
    Serial.println("");
    Serial.println("");*/
    count++;
    }
    int32_t lng = flat * 10000;
    int32_t lat = flon * 10000;
    datasend[0] = lat;
    datasend[1] = lat >> 8;
    datasend[2] = lat >> 16;
    datasend[3] = lng;
    datasend[4] = lng >> 8;
    datasend[5] = lng >> 16;
    smartdelay(1000);
  }
static void smartdelay(unsigned long ms)
{
  unsigned long start = millis();
  do 
  {
    while (ss.available())
    {
      gps.encode(ss.read());
    }
  } while (millis() - start < ms);
}
void loop() {
    os_runloop_once();
}

EDIT

Thank you to everyone who replied to this post! We now have a proper survey with these questions and a few more. If you'd like to provide feedback, please complete the survey at the following link:

https://www.surveymonkey.com/r/GPJTV6C

---

Original Post

I'm a member of the ThingSpeak team. I'd like to learn more about how the ThingSpeak community accesses channel data. Your feedback can help us make ThingSpeak better!

(A) Which of these statements best describes when the data you are interested in typically occurs?

  1. the last X hours / minutes / seconds
  2. a specific time window, e.g. "Monday, October 4th, 2021 9:00AM to 10:00PM"
  3. the last N feeds
  4. all data in the channel

(B) What is a typical duration of time that you are interested in? (e.g. "3 hours", "a few minutes")

(C) How many data points do you typically expect to read?

Hello everyone! i want to send current sensor data using Arduino and nodeMCU to thingspeak. is there anyone who worked on something before. your responses will be highly appreciatable. thanks in advance

Hello,

I am sending mqtt values from esp8266 devices to different channels - e.g. https://thingspeak.com/channels/1182897

The values are sent correctly and also show up on the channel's page correctly and quickly in time.

But mqtt receivers are getting the data with a varying long delay. Often the delay is 1h, so I first thought, this could be a time zone problem. But that's not the case.

I tried two different mqtt clients: Both get the values at the same (late time): E.g. when I now get a value from channels/1182897/subscribe/fields/field3 and look into the history of values (using "Data Import/Export") then this value can be found 20 minutes up to 1 hour ago. This can also be confirmed when looking into the device's logs.

What could I do to be up-to-date with my values? Thank you very much. Dirk

I have a chart of data and need to eliminate the outliers which are making the chart look bad. Is there a configuration for this?

Hello, I try to publish to an already working channel. I have created an device and using the credentials shown in the image. I would like connect via TCP and port 1883 to mqtt3.thingspeak.com My Library always returns "Connection Refused - Bad Username or Password". This means it already has got a CONNACK reply. I have already successfully published an item to another server. So, the Lib basically works and I am using it correctly. I do not have mistyped the credentials. Could there be something on the Thingspeak side? Could you please help me with that? Thank you in advance.

Ali Rasouli
Ali Rasouli
Last activity on 25 Oct 2021

I currently have my ThingSpeak log temp, airflow velocity raw and airflow velocity filtered. The column names show as field1, field 2 and field 3. Is there a way for me to change field1 to temperature? Thanks

Hi,

I am experiencing trouble in sending the actual sensor values to Thingspeak. I use a code template that I downloaded from a github repository https://github.com/mathworks/thingspeak-arduino/tree/master/examples/ESP32/WriteMultipleFields. The main issue is that I don't know how to fill out the source code to get real sensor values instead of random values.

I am using a DHT sensor, from which I want to measure both the temperature and the humidity. Here is what it looks like in the serial monitor after uploading the code to the ESP32 dev board.

Here is my code that I amended from the source template, and uploaded to the ESP32 board.

#include "DHT.h"
#include <WiFi.h>
#include "ThingSpeak.h"
// The wire is in pin 14 as required by the DHT-sensor, so it is written here:
#define DHTPIN 14    
// We use a DHT11-sensor
#define DHTTYPE DHT110
const char* ssid = "Koti_9BE9";   // your network SSID (name) 
const char* password = "XXXXXXX";   // your network password
WiFiClient  client;
// We write one (1) as the channel number. Assumably in that order in which they are in the MyChannels-page. 
unsigned long myChannelNumber = 1;
const char * myWriteAPIKey = "NW34MMOB5J1NGRL2";
// Timer variables
unsigned long lastTime = 0;
unsigned long timerDelay = 10000; // This specifies what kind of delay we want between measurements. DHT11
// The fastest measurement interval of DHT sensors is 2000 ms (2 seconds).
// An object from where values are brought from the DHT library
DHT dht(DHTPIN, DHTTYPE);
// Initialize our values. Writing down the values that need to be measured from DHT-sensors: 
// humidity h, temperature t, and temperature in fahrenheit-scale f
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);
String myStatus = "";
void setup() {
  Serial.begin(115200);
  Serial.println(F("DHT11 test!"));
    dht.begin();
    WiFi.mode(WIFI_STA);   
   ThingSpeak.begin(client);
  }
void loop() {
    delay(20000);
    float h = dht.readHumidity();
    float t = dht.readTemperature();
    float f = dht.readTemperature(true);
    if (isnan(h) || isnan(t) || isnan(f)) {
      Serial.println(F("Failed to read from DHT sensor!"));
      return;
    }
    if(WiFi.status() != WL_CONNECTED){      
      Serial.print("Attempting to connect");
      while(WiFi.status() != WL_CONNECTED){
        WiFi.begin(ssid, password); 
        delay(5000);     
      } 
      Serial.println("\nConnected.");
    }
    float hif = dht.computeHeatIndex(f, h);
    float hic = dht.computeHeatIndex(t, h, false);
    Serial.print(F("Humidity: "));
    Serial.print(h);
    Serial.print(F("%  Temperature: "));
    Serial.print(t);
    Serial.print(F("°C "));
    Serial.print(f);
    Serial.print(F("°F  Heat index: "));
    Serial.print(hic);
    Serial.print(F("°C "));
    Serial.print(hif);
    Serial.println(F("°F"));
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
if(x == 200){
  Serial.println("Channel update successful.");
}
else{
  Serial.println("Problem updating channel. HTTP error code " + String(x));
}
}

Many thanks for any advice.

Lauri

i have url that contains value for reading data, how can i send data to field from url that i have?

I have a project that collects data from a CO2 sensor and stored it in these ints:

    CO2PPM = (int)data[2] * 256 + (int)data[3];
    temperature = (int)data[4] - 40;  

which are defined as ints. Then just before the http request, they are processed like this:

       static char outstr3[15];
       static char outstr4[15];
       String dataString3 = dtostrf(CO2PPM, 8, 2, outstr3);
       String dataString4 = dtostrf(temperature, 8, 2, outstr4);

and finally used in the GET request:

          wifly.println("GET /update?api_key=apikey&field1="dataString4"&field2="+dataString3+" HTTP/1.1");

which fails to successfully register the data into TS. However if I hardcode it like this:

          wifly.println("GET /update?api_key=apikey&field1=23.45&field2=67.89 HTTP/1.1");

it works, the data is registered.

Any idea how to fix this issue?

I already solved some problems in Cody, why does he not increase my points or allow me to earn badges?

Greetings!

So, I'm working on a project that needs to send collected data using a SIM808 over GPRS to ThingSpeak to multiple fields. The upload interval is 2 minutes with samples taken every 10 seconds and each batch of samples includes 19 bytes of data (12 sets of 19 bytes equal 228B for each bulk data pack that has to be sent and the memory can be flushed). It's worth mentioning that I'm using an Arduino Pro Mini (ATmega328P).

I've looked at the bulk data upload example, and I'm having some trouble adapting it to the SIM808. I am also not sure how to send multiple fields using the bulk method. Unfortunately, I don't have much time to tinker with the code as the whole project had to be done in 2 days and I've only got one day to finish. I'd appreciate any help regarding this as I'm on a very tight schedule.

Thanks in advance!

We've started a new video series on how and why to use ThingSpeak. IoT from Data to Action . Most of you pros here at the forum probably already know this stuff, but there's some great overview material in these videos if you are interested. Two of four planned movies are posted, Ill let you know again when the others come out too. -Christopher

Hello! I have been working on an app for viewing thingspeak numerical data as graphs and I'm planning to publish it on playstore soon. If anybody is interested to test the beta version I would appreciate it. Here is the link https://play.google.com/apps/testing/com.mlundell.theThingV

ThankYou !

Magnus

I have both of my account profile and channel export time zones set to "(GMT+8000)Beijing". The datetime from the exported feeds.csv looks like:

'2021-09-06 11:16:28 CST'

I want to import data, but MATLAB do not directly understand its datetime format. I assume "CST" to be "China Standard Time", but when I try to convert it to datetime, MATLAB throws an error:

 >> datetime(s,'InputFormat',"yyyy-MM-dd HH:mm:ss z","TimeZone","Asia/Shanghai","Locale","zh_CN")
 Error using datetime (line 651)
 Unable to convert '2021-09-06 11:16:28 JST' to datetime using the format 'yyyy-MM-dd HH:mm:ss z' and locale 'zh_CN'.

However if I change the "Locale" to US instead:

>>datetime(s,'InputFormat',"yyyy-MM-dd HH:mm:ss z","TimeZone","Asia/Shanghai","Locale","en_US")
ans = 
    datetime
07-Sep-2021 01:16:28

There is no error, but the time is wrong and is 14 hours ahead. So I guess that MATLAB sees this "CST" as "Central Standard Time".

My point is:

  1. It's pretty strange that the datetime exported by ThingSpeak could not be directly understood by MATLAB. MATLAB is supposed to work with ThingSpeak data seamlessly, but now I have to find a detour to import ThingSpeak data to MATLAB.
  2. It seems that the datetime function needs improvement to understand this "CST" timezone, or that ThingSpeak could improve its datetime output format.

I'm not a programmer but I'm loving Thingspeak!

by way of background: i have been having mysterious PM 2.5 spikes on my PurpleAir several times a day (usually from ~12 ug/m3 to 100 ug/m3!!). i recently figured out what is causing it: i live by a charcoal burger place that sends smoke throughout my neighborhood when they relight their grill at peak hours. it is what it is unfortunately, until these restaurants get properly regulated.

that being said, i like to work in my yard, and id love to be able to just put on an N95 when a charcoal smoke event is happening. so i'm trying to use thingspeak to build a little notification system for me.

the PurpleAir Thingspeak channels are private (by default I believe), so I'm using a Matlab analysis to copy the raw data from the PurpleAir Thingspeak channel over to a channel I can administer.

next i set up TimeControls to run the data update Matlab analysis at 5 minute intervals, and staggered them apart from each other (the channel seems to be updating just about every minute now).

next i set up a React that, upon data insertion of a PM 2.5 value above 35 mg/um3, triggers a ThingHTTP which sends a request to Pushover's API --> so I get text messages and Chrome notifications when there are air events.

this seems to be working great so far -- the air in LA right now is pretty good, so it just captures the transient charcoal smoke events and notifies me of them.

but my concern is --> the air in LA can often get worse for extended periods. Some days, the average will be 40 ug/m3. so when those days inevitably come, will my system just be constantly chirping at me all day about the air values?

if so, is there anything i can do about this? is there a way to tell react to notify me, but then only retest again after an hour, for instance?

thanks for your help, thingspeak community!

Hi everyone,

I need your help. As of 10-4-2021 the option of &headers=false stopped working?

It worked beautifully for about 2 years (circa early 2020) and suddenly on 10-4 the headers are being returned despite this option in the URL (no testing with Chrome isn't a credible test, it internally suppresses them regardless)

Need your help, if there's a way to suppress headers and just return the value of interest as it worked prior to Monday 10-4-2021

Thank you Boyan

How do I code my arduino sketch in order to get the HTTP response from an arduino post?