Resultados de
Hello ThingSpeak Community,
I have an energy meter sending data of energy consumed in 4 rooms in hexadecimal values to Sigfox and I was trying to decode the payload and route it to ThingSpeak.
All the datas are sent at the same time.
But ThingSpeak only receives 1 of them and plots them.
However, the rest 3 are missing. Is this because I am trying the free version ?
Would the payed version be capable of receiving all the 4 messages ?
I am using the free option with 4 channels available. I do not have any channels listed, but when I want to create a new channel it gives me an error massage to say that I have used up my 4 channels and need to purchase units to create additional channels.
To solve issues around the browsers blocking 3p cookies and having different behavior across different browsers, the ThingSpeak website is now served from https://thingspeak.mathworks.com. There are no changes required from devices or users. Just log in and use the service as you always did.
I am creating an ESP32 device which will upload data to thingspeak channel and I want the data to be displayed on my website after login. I have succesfully completed the first part of uploading the data to thingspeak. Any suggestions with second part will be very much appreciated.
I have a LORA node up-linking data to a Thingspeak channel via The Things Network (TTN). Sometimes it stops sending data and I reboot it by logging into my console on TTN and sending a re-boot down-link message to the node. Is there any way I can transmit a downlink message to the node direct from Thinkspeak?
Hi guys
This is regarding my shared ThingSpeak channel. Previously it was showing the widgets side by side but in recent days it's showing widget under widget.
Why is that? Please help. 

%%
clear
clc
close all
% TODO - Replace the [] with channel ID to write data to:
writeChannelID = 'your channel ID'; %channel ID
% TODO - Enter the Write API Key between the '' below:
writeAPIKey = 'your write API Key'; %write API Key
% url for POST request
url = 'https://aemo.com.au/';
webText = webread(url);
filteredData(4) = urlfilter(url,'<div class="summary-row-value">');
display(filteredData(4), 'AEMO');
thingSpeakWrite(writeChannelID, filteredData(4), 'WriteKey', writeAPIKey);
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
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);
}
}
}
Hi! Actually I'm trying to store data from 5 sensors on the ThingSpeak cloud. I was able to do it 2-3 days back, but right now I'm trying to do the same for last 2-3 hours and it's just not happening. There's nothing wrong with the code because it's getting compiled properly. I'm using
ThingSpeak.writeFields(2261556,"xxxxxxxxxxxxxxxx");
I tried printing its value after storing in a temporary variable........The value comes out to be -301. Is there any fix for this? I need it urgently for a project.
I hope to receive some help soon. Thanks!
% Sample data from channels
channel1Data = 2226948; % Your data for channel 1
% Threshold values for each alert level
threshold1 = 100;
threshold2 = 200;
threshold3 = 300;
% Initialize alert level to 0 (no alert)
alertLevel = 0;
% Check thresholds and determine alert level
if channel1Data >= threshold1 && channel1Data <= threshold2
alertLevel = 1; % Yellow Alert
elseif channel1Data >= threshold2 && channel1Data <= threshold3
alertLevel = 2; % Orange Alert
elseif channel1Data >= threshold3
alertLevel = 3; % Red Alert
end
% Define alert message based on alert level
if alertLevel == 1
alertMessage = 'Threshold exceeded for channel 1!';
elseif alertLevel == 2
alertMessage = 'Threshold exceeded for channel 2!';
elseif alertLevel == 3
alertMessage = 'Threshold exceeded for channel 3!';
else
alertMessage = 'No alert for channel 1.';
end
% Call SMS integration function with the alert message
sendMessage('+639319217695', alertMessage);
function sendMessage(number, message)
% Replace with your SMS service API endpoint and API key
apiUrl = 'https://api.semaphore.co/api/v4/messages';
apiKey = '-----';
% Compose the message payload
payload = struct('apikey', apiKey, 'number', number, 'message', message);
try
% Send the SMS using the SMS service API
response = webwrite(apiUrl, payload);
% Process the response as needed
disp('SMS sent successfully');
catch
disp('Error sending SMS');
end
end
After signing in pop up showing succesfully signed in ,but its getting signed out automatically
plz help me and comment if you are facing same problem
Hello. I want to send the data that I have collected from the sensors and that is displayed on ThingSpeak to a databse in Firebase. How can I do it? I know I can use the REST API but where should I code the fetch? Thanks.
I am sending my sensor readings to thingspeak channel using raspberrry pi board but i dont know how can we send some instruction back to the raspberry pi board to control an LED or Motor or some other things. Can anyone provide some information about this?
I want to import data from a .cvs with the requested format but constantly the same error comes out : "The uploaded file was not imported because it is missing timestamps."
My data is in this format:
created_at,field1,field2,field3
1600064881,50.818,0,0
Could someone help me fix it?
Thank you
Hi, I want to collect the simulation data by using NASA HL-20 model, then the data will transmit to ThingSpeak. However, I don't have the block for ThingSpeak Channel at the Simulink Library Browser. Is it because the block has its own version of simulink (meaning I have to update my version) or is there any else that I don't know? Besides, can you suggest which methods are suitable for me to successfully transfer the simulation data to ThingSpeak?
Hi there, I am trying to reach out to anyone who has successfully completed the project of building a weather station using an Arduino MKRFOX1200 board, a dht11 sensor across the Sigfox and Thingspeak networks. I’ve been attempting to build the weather station over the SigFox and things.io network for over a year now but I was unsuccessful. I then found this tutorial on how to build this using Thingspeak: https://create.arduino.cc/projecthub/masteruan/arduino-mkr-fox-1200-sigfox-meteo-station-423609 . I have now been attempting to build it using this network but am still unsuccessful.
My SigFox and arduino is working. I made the arduino code convert temperature to Celsius (rather than Kelvin which is what the tutorial does). However, I am unable to access the location of the device on Thingspeak (my SigFox atlas is activated) and I am getting humidity values of approximately -30k. Please may someone assist me or give me a detailed approach on how to fix these issues. My goal is to have my thingspeak like this: https://thingspeak.com/channels/227248. I have followed the tutorial and projecthub but I cannot figure out why I am obtaining a confusing humidity reading. Please please may someone help.
Thank you so much for your time.
I would like to have a widget to control a pump connected to Thingspeak via Talkback. I have also established a connection with thingspeak where I publish my sensor data to the channel and can visualize the data through the various widgets. But I cant find a widget or method to control the pump from a graphical perspective on the channel (like a switch or button interface where clicking them would turn the pump on or off). Thingsboard seems to have the feature, not sure of thingspeak. If anyone knows a way please do comment out. Have a great day!
I wanted to ask that can we send bulk data through ThingSpeak ESP32 library using:
POST /channels/266256/bulk_update.csv HTTP/1.1
Host: api.thingspeak.com
Content-Type: application/x-www-form-urlencoded
time_format: relative
I saw it on mathswork "Bulk-Write CSV Data" (link: https://www.mathworks.com/help/thingspeak/bulkwritecsvdata.html)
Does ThingSpeak library supports the capability to send bulk csv data, any guidance?
Thanks and looking forward for your positive reply
I have an ESP32 that has 5 values (solarW, batteryV, pumpW, pumpRPM and pumpLPM) that I'm writing to 5 fields on a Thingspeak channel.
if ((millis() - fifteenTstart) > 15000){
Serial.println("Updating Thingspeak....");
ThingSpeak.setField(1, solarW);
ThingSpeak.setField(2, batteryV);
ThingSpeak.setField(3, pumpW);
ThingSpeak.setField(4, pumpRPM);
ThingSpeak.setField(5, pumpLPM);
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));
}
}
It works fine when there's a good connection to the internet and Thingspeak, but there's a 10 second or so delay when Thingspeak is unavailable (WiFi, internet or website non-connectivity).
I would like the code to recognise that there's no ThingSpeak connection musch faster (1 second or less woud be good, but I'll take two!).
Or, if it's possible to just send the data out without the code waiting for a confirmation back (I only need the data to go OUT from the ESP32 to Thingspeak, nothing needs to come back).
The reason for doing this is there's other code on the ESP32 that I need to get back to, having a 10 second delay in the middle of the code ain't good for the pump safety reaction code.