主要内容

搜索

Hi!
I'm having trouble sending data to a channel using MQTT. I'm using a program that was working perfectly until just a few days ago, but after making some minor changes yesterday, it stopped working. I’ve also tested it manually using the MQTTX client. If I send data using CURL and GET, it works fine.
It’s a bit strange...
Thankfully,
Ernesto.
Marco
Marco
上次活动时间: 2024-5-13

I isolated a var that I'm interested in, and I want to connect Node-RED to thingspeak to show the values on the graph. The problem is the node "mqttout": I connected it to the server mqtt3.thingspeak.com and the port 1883, and with the device with right username and password. It shows "connected", but the graph is still the same, I can not upload the varabiles.
Buongiorno, non mi è possibile connetermi al canale di thingspeak che ho creato, per passare i dati tramite MQTT. Il codice segue la libreria PubSubClient su arduino ide, l'errore restituito dal serial monitor dell'ide é: -4 : MQTT_CONNECTION_TIMEOUT - the server didn't respond within the keepalive time.
Allego il codice per eventuali verifiche:
Grazie per a disponibilità
#include "PubSubClient.h"
#include <ESP8266WiFi.h>
#include "secrets.h"
bool DEBUG = false; // true=serial message of debug enabled
char* server = "mqtt.thingspeak.com";
WiFiClient wifiClient;
PubSubClient client(server, 1883, wifiClient);
String payload;
// BME280 Setting
#include <Wire.h>
#include <Adafruit_BME280.h>
//#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme; // I2C
bool BMEStatus;
ADC_MODE(ADC_VCC); // Set ADC for read Vcc
// Update time in seconds. Min with Thingspeak is ~20 seconds
const int UPDATE_INTERVAL_SECONDS = 3600; //il clock interno ha un errore del 5% questo valore va tarato sperimentalmente
//const int UPDATE_INTERVAL_SECONDS = 60; // caricamento ogni minuto solo per test
void setup()
{
// Connect BME280 GND TO pin14 OR board's GND
pinMode(14, OUTPUT);
digitalWrite(14, LOW);
Serial.begin(115200);
delay(10);
// BME280 Initialise I2C communication as MASTER
Wire.begin(13, 12); //Wire.begin([SDA], [SCL])
BMEStatus = bme.begin();
if (!BMEStatus)
{
if (DEBUG) { Serial.println("Could not find BME280!"); }
//while (1);
}
// Weather monitoring See chapter 3.5 Recommended modes of operation
bme.setSampling(Adafruit_BME280::MODE_FORCED,
Adafruit_BME280::SAMPLING_X1, // temperature
Adafruit_BME280::SAMPLING_X1, // pressure
Adafruit_BME280::SAMPLING_X1, // humidity
Adafruit_BME280::FILTER_OFF );
// read values from the sensor
float temperature, humidity, pressure;
if (BMEStatus)
{
temperature = bme.readTemperature();
humidity = bme.readHumidity();
pressure = bme.readPressure() / 100.0F;
}
else
{
if (DEBUG) Serial.println("Could not find BME280!");
temperature=0;
humidity=0;
pressure=0;
}
float voltage = ESP.getVcc();
voltage = voltage/1024.0; //volt
if (DEBUG)
{
Serial.println("T= " + String(temperature) + "°C H= " + String(humidity) + "% P=" + String(pressure) + "hPa V=" + voltage + "V");
}
// Construct MQTT payload
payload="field1=";
payload+=temperature;
payload+="&field2=";
payload+=humidity;
payload+="&field3=";
payload+=pressure;
payload+="&field4=";
payload+=voltage;
payload+="&status=MQTTPUBLISH";
//Connect to Wifi
if (DEBUG)
{
Serial.println();
Serial.print("\nConnecting to WiFi SSID ");
Serial.print(SECRET_SSID);
}
WiFi.begin(SECRET_SSID, SECRET_PASS);
int timeOut=10; // Time out to connect is 10 seconds
while ((WiFi.status() != WL_CONNECTED) && timeOut>0)
{
delay(1000);
if (DEBUG) { Serial.print("."); }
timeOut--;
}
if (timeOut==0) //No WiFi!
{
if (DEBUG) Serial.println("\nTimeOut Connection, go to sleep!\n\n");
ESP.deepSleep(1E6 * UPDATE_INTERVAL_SECONDS);
}
if (DEBUG) // Yes WiFi
{
Serial.print("\nWiFi connected with IP address: ");
Serial.println(WiFi.localIP());
}
// Reconnect if MQTT client is not connected.
if (!client.connected())
{
reconnect();
}
mqttpublish();
delay(200); // Waiting for transmission to complete!!! (ci vuole)
WiFi.disconnect( true );
delay( 1 );
if (DEBUG) { Serial.println("Go to sleep!\n\n"); }
// Sleep ESP and disable wifi at wakeup
ESP.deepSleep( 1E6 * UPDATE_INTERVAL_SECONDS, WAKE_RF_DISABLED );
}
void loop()
{
//there's nothing to do
}
void mqttpublish()
{
// read values from the sensor
float temperature, humidity, pressure;
if (DEBUG)
{
Serial.print("Sending payload: ");
Serial.println(payload);
}
// Create a topic string and publish data to ThingSpeak channel feed.
String topicString ="channels/" + String( channelID ) + "/publish/"+String(writeAPIKey);
unsigned int length=topicString.length();
char topicBuffer[length];
topicString.toCharArray(topicBuffer,length+1);
if (client.publish(topicBuffer, (char*) payload.c_str()))
{
if (DEBUG) Serial.println("Publish ok");
}
else
{
if (DEBUG) Serial.println("Publish failed");
}
}
void reconnect()
{
String clientName="MY-ESP";
// Loop until we're reconnected
while (!client.connected())
{
if (DEBUG) Serial.println("Attempting MQTT connection...");
// Try to connect to the MQTT broker
if (client.connect((char*) clientName.c_str()))
{
if (DEBUG) Serial.println("Connected");
}
else
{
if (DEBUG)
{
Serial.print("failed, try again");
// Print to know why the connection failed.
// See http://pubsubclient.knolleary.net/api.html#state for the failure code explanation.
Serial.print(client.state());
Serial.println(" try again in 2 seconds");
}
delay(2000);
}
}
}
Not able to display password by copying to clipboard or by clicking the unhide icon - have tried multiple computers.
Anyone else had this problem with mqtt?
can't connect using the following setting in MQTT explorer
should i modify thiem or it's a must to use MQTTX
please advice
The ThingSpeak certificate was updated recently. If you are using secure communication for your devices, you may need to update the certificate or certificate fingerprint on your devices.
Hi Everyone,
I'm a novice when it comes to programming and i'm trying to figure out why my weather data is not loading into my channel. I've had the code working previously before thingspeak went from MQTT to MQTT3. I'm having issues around the publish.single().
import subprocess
import paho.mqtt.publish as publish
import psutil
import string
import json
from statistics import median
from pms5003 import PMS5003
#weather_iot
import requests
import time
from datetime import datetime
from csv import writer
import math
import paho.mqtt.publish as publish
#Thingspeak channel and MQQT protocol
mqtt_client_ID = "detail removed"
mqtt_username = "detail removed"
mqtt_password = "detail removed"
channelID = "detail removed"
apiKey = "detail removed"
topic = "channels/" + channelID + "/publish/"
mqttHost = "mqtt3.thingspeak.com"
tTransport = "websockets"
useSSLWebsockets = False
tTLS = None
tPort = 80
def csv():
List=[now, Temperature1, IAQ1, Pressure1, Humidity1, PM1_0, PM2_5, PM10]
with open('Weather.csv', 'a') as f_object:
writer_object = writer(f_object)
writer_object.writerow(List)
f_object.close()
return
#PM sensor configuration
pms5003 = PMS5003(
device='/dev/ttyAMA0',
baudrate=9600,
pin_enable=22,
pin_reset=27
)
#Open C File
proc = subprocess.Popen(['./bsec_bme680'], stdout=subprocess.PIPE)
listIAQ_Accuracy = [ ]
listPressure = [ ]
listGas = [ ]
listTemperature = [ ]
listIAQ = [ ]
listHumidity = [ ]
listStatus = [ ]
for line in iter(proc.stdout.readline, ''):
lineJSON = json.loads(line.decode("utf-8")) # process line-by-line
lineDict = dict(lineJSON)
listIAQ_Accuracy.append(int(lineDict['IAQ_Accuracy']))
listPressure.append(float(lineDict['Pressure']))
listGas.append(int(lineDict['Gas']))
listTemperature.append(float(lineDict['Temperature']))
listIAQ.append(float(lineDict['IAQ']))
listHumidity.append(float(lineDict['Humidity']))
listStatus.append(int(lineDict['Status']))
if len(listIAQ_Accuracy) == 20:
#generate the median for each value
IAQ_Accuracy = median(listIAQ_Accuracy)
Pressure = median(listPressure)
Gas = median(listGas)
Temperature = median(listTemperature)
IAQ = median(listIAQ)
Humidity = median(listHumidity)
Status = median(listStatus)
#clear lists
listIAQ_Accuracy.clear()
listPressure.clear()
listGas.clear()
listTemperature.clear()
listIAQ.clear()
listHumidity.clear()
listStatus.clear()
#Temperature Offset
Temperature = Temperature + 2
IAQ1 = round(IAQ,1)
Temperature1 = round(Temperature, 1)
Humidity1 = round(Humidity, 1)
Pressure1 = round(Pressure, 1)
data = pms5003.read()
if Humidity1 < 80:
CF = 1
else:
CF = (Humidity1/100)*1.3
PM1_0 = format(data.pm_ug_per_m3(1.0))
PM2_5 = format(data.pm_ug_per_m3(2.5))
PM10 = format(data.pm_ug_per_m3(10))
PM1_0 = round(int(PM1_0) / CF,)
PM2_5 = round((int(PM2_5)/CF/25) * 100,)
PM10 = round((int(PM10)/CF/50) * 100,)
now = datetime.now()
tPayload = "field1=" + str(Temperature1)+ "&field2=" + str(IAQ1)+ "&field3=" + str(Pressure1)+ "&field4=" + str(Humidity1)+ "&field5=" + str(PM1_0)+ "&field6=" + str(PM2_5)+ "&field7=" + str(PM10)
try:
print ("[INFO] Data prepared to be uploaded")
publish.single(topic, payload=tPayload, hostname=mqttHost, transport=tTransport, port=tPort, tls=tTLS, client_id=mqtt_client_ID, auth={'username':mqtt_username,'password':mqtt_password})
print ("[INFO] Data sent for 7 fields: ", Temperature1, IAQ1, Pressure1, Humidity1, PM1_0, PM2_5, PM10)
except (KeyboardInterrupt):
break
except:
print ("[INFO] Failure in sending data")
csv()
Hey, so I have a simple air quality measurement IoT system but the values are not arriving in my ThingSpeak channel. I use basic tutorials for it and tried some kind of variation but the code is so simple, I don't see any problem code-wise. Maybe someone here can help me?
I am working with a Raspberry Pi 3 and the following code for a SDS011 sensor:
import time
from datetime import datetime
import paho.mqtt.publish as publish
import paho.mqtt.client as mqtt
import psutil
from sds011 import *
import aqi
sensor = SDS011("/dev/ttyUSB0", use_query_mode=True)
def get_data(n=3):
sensor.sleep(sleep=False)
pmt_2_5 = 0
pmt_10 = 0
time.sleep(10)
for i in range (n):
x = sensor.query()
pmt_2_5 = pmt_2_5 + x[0]
pmt_10 = pmt_10 + x[1]
time.sleep(2)
pmt_2_5 = round(pmt_2_5/n, 1)
pmt_10 = round(pmt_10/n, 1)
sensor.sleep(sleep=True)
time.sleep(2)
return pmt_2_5, pmt_10
def conv_aqi(pmt_2_5, pmt_10):
aqi_2_5 = aqi.to_iaqi(aqi.POLLUTANT_PM25, str(pmt_2_5))
aqi_10 = aqi.to_iaqi(aqi.POLLUTANT_PM10, str(pmt_10))
return aqi_2_5, aqi_10
def save_log():
with open("/YOUR PATH/air_quality.csv", "a") as log:
dt = datetime.now()
log.write("{},{},{},{},{}\n".format(dt, pmt_2_5, aqi_2_5, pmt_10, aqi_10))
log.close()
channelID = "YOUR CHANNEL ID"
apiKey = "YOUR WRITE KEY"
clientID = "YOUR CLIENT ID"
tUsername = "YOUR USERNAME"
tPassword = "YOUR PASSWORD"
topic = "channels/" + channelID + "/publish/" + apiKey
mqttHost = "mqtt3.thingspeak.com"
tTransport = "tcp"
tPort = 1883
tTLS = None
tProtocol = mqtt.MQTTv311
while True:
pmt_2_5, pmt_10 = get_data()
aqi_2_5, aqi_10 = conv_aqi(pmt_2_5, pmt_10)
print ("AQI2.5 =", aqi_2_5," AQI10 =", aqi_10)
tPayload = "field1=" + str(pmt_2_5)+ "&field2=" + str(aqi_2_5)+ "&field3=" + str(pmt_10)+ "&field4=" + str(aqi_10)
try:
publish.single(topic, payload=tPayload, hostname=mqttHost, port=tPort, client_id=clientID, auth={'username':tUsername, 'password':tPassword}, tls=tTLS, transport=tTransport, protocol=tProtocol)
print ("[INFO] Published data")
save_log()
time.sleep(60)
except Exception as e:
print ("[INFO] Failure in sending data")
print (e)
time.sleep(60)

Hi, this is my first question here... hope not to bother you all. Is it possible to stop a sensor from collecting data by using ThingSpeak/MQTT broker/MQTT protocol? How? I'm working with a MAX30102 for oxigen and bpm detection and I need to stop the sensor from ThingSpeak or at least this is what I was asked to do. At the moment I can't figure out how to do this except by using the APIkey and the HTTP protocol but my task was to only use MQTT protocol. Hope someone can help me finding a new point of view about this topic/problem.

EDIT: I solved the problem. I used another client, MQTTx to be precise, in order to send messages in a field of control. So, at the beginning I had just two fields (BPM and SpO2), then I added a third field of control. The board WeMos, connected to the sensor MH-ET LIVE MAX30102 was used to process the sensor's data and send them to Thingspeak every 15 seconds wherease the client desktop MQTTx was also connected to ThingSpeak's broker and enbled for both publish and subscribe and I used it to send messages of ON and OFF, literally, as payload for the control field. This messages were passed to the callBack function and the payload was checked in order to change the state of my code, nested in a switch system. Thamk's for the help to you all :) If you're interested to the code and the settings just let me know.

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();
}

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'd appreciate comment on whether I understand the limitations with MQTT and low power. Using deep sleep the ESP12 consumes microamps and my sensor is insignificant. The big drain on the battery is WiFi. Sending an MQTT message is taking around 10ms which seems at first sight promising. Unfortunately it looks to me like deep sleep ends the connection, and reconnection takes 4 or more seconds. I'd thought that deep sleep, static IP, and MQTT were the way to get very low power consumption but it looks to me like they don't solve the problem.

Hi, i wonder if any one experiencing the same, but in my thing sepak profiel i can only see : 1- User API Key 2- Alert API Key

but no MQTT API key? not sure why Thank you

Hello, since today 14:00 CEST (UTC+2) (= 12:00 UTC = 4 hours ago) none of my thinkspeak clients running on Arduinos using PubSubClient are able to connect to mqtt.thingspeak.com. Until then, they have been running happily for months.

I tried to send some data manually but didn't succeed:

mosquitto_pub -d -h mqtt.thingspeak.com -u TESTTerrasseWemos -p 1883 -P xxxx -t "channels/cccc/publish/yyyy" -m "field1=10&field2=60" ; echo $?
Client mosq-xxxxxxx sending CONNECT
Error: Unknown error.
19

The exact errors differ from try to try. But I don't know if my call is definitely correct.

Any help or information what might have changed at mqtt.thingspeak.com?

Thank you very much.

Hello community, I am trying to subscribe using the MQTT protocol.

The problem occurs when I try to request the subscribe, I send the subscribe and my connection with the server is closed.