メインコンテンツ

結果:

I am trying to extract the value of a couple of variables from a very basic web page. Although I can see the variable's values changing when I Inspect the page in Chrome Browser and Xcopy, I only get the variable name, not its value, when I select the option to "send your ThingHTTP request and view the response using the following URL:" Can anybody point this rookie in the right direction please?

Dhuwaragish Ravichandrakumar
Dhuwaragish Ravichandrakumar
最後のアクティビティ: 2022 年 4 月 8 日

Hi all, I currently have a forecasting of a variable based on the data that I collected. But is there a way to calculate what is the accuracy for the forecast? Thanks.

Hans Scharler
Hans Scharler
最後のアクティビティ: 2022 年 4 月 6 日

Hi everyone. I updated my IoT Debugger project on GitHub. You can use the debugger to view channel data from ThingSpeak.

Jun Jie Oh
Jun Jie Oh
最後のアクティビティ: 2022 年 4 月 4 日

Currently i am using lora from my end node to my dragino gateway and from my gateway, i push the sensor data up to thingspeak. i want to check that when my temperature graph hits above 30 it will send down a 1 or a command to my gateway and my gateway will transmit it to my end node to take action. i research and saw that react is one of the solution for on top but i do not know which action and how to use that specific action for this scenario.

Walter Diego Spaltro
Walter Diego Spaltro
最後のアクティビティ: 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

Beng Choon Chua
Beng Choon Chua
最後のアクティビティ: 2022 年 3 月 29 日

I have a google gauge that shows my PM2.5 sensor values but I would like to make 3 gauges appear side by side that show the value of different sensors. How can I do that? Thanks

Duke Dong
Duke Dong
最後のアクティビティ: 2022 年 3 月 29 日

Hello everyone, I am new to ThingSpeak and ESP32, I would like to send IMU sensor acceleration data from my ESP32 to ThingSpeak so that I can use this data for further analysis. I have tried the example code provided in this link: Bulk-Update and this works perfectly fine for me with the default update interval and post interval. I also attached the code here.

#include <Wire.h>
#include <Arduino.h>
#include <Adafruit_MCP4725.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
#include <WiFi.h>
#include "ThingSpeak.h"
// Define multiplexer address
#define TCAADDR 0x70
// Define imu and dac objects
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28);
char jsonBuffer[500] = "[";
char ssid[] = "my ssid";
char pass[] = "my password";
WiFiClient client;
char server[] = "api.thingspeak.com";
unsigned long lastConnectionTime = 0;
unsigned long lastUpdateTime = 0;
const unsigned long postingInterval = 15L * 1000L;
const unsigned long updateInterval = 3L * 100L;
// To choose the multiplexer specific channel (between 0 and 7)
void tcaselect(uint8_t i){
  if (i > 7) return;
Wire.beginTransmission(TCAADDR);
Wire.write(1 << i);
Wire.endTransmission();
}
    void setup() {
      // put your setup code here, to run once:
  Wire.begin();
  Serial.begin(9600);
  while(!Serial);
  delay(1000);
  Serial.println("Serial communication set up");
// set up bno055
tcaselect(2);
if (!bno.begin()){
  Serial.println("Failed to connect to BNO055");
  while (1);
}
while(WiFi.status() != WL_CONNECTED){
  Serial.print("Attempting to connect to wifi");
  WiFi.begin(ssid, pass);
  delay(5000);
}
Serial.println("Connected to WiFi");
printWiFiStatus();
}
void loop() {
  // put your main code here, to run repeatedly.
if (millis() - lastUpdateTime >= updateInterval){
  updatesJson(jsonBuffer);
}
}
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,",");
tcaselect(2);
sensors_event_t orientationData , angVelocityData , linearAccelData, magnetometerData, accelerometerData, gravityData;
bno.getEvent(&orientationData, Adafruit_BNO055::VECTOR_EULER);
bno.getEvent(&angVelocityData, Adafruit_BNO055::VECTOR_GYROSCOPE);
bno.getEvent(&linearAccelData, Adafruit_BNO055::VECTOR_LINEARACCEL);
float rssi = linearAccelData.acceleration.x; 
strcat(jsonBuffer, "\"field1\":");
lengthT = String(rssi).length();
String(rssi).toCharArray(temp,lengthT+1);
strcat(jsonBuffer,temp);
strcat(jsonBuffer,"},");
// If posting interval time has reached 15s, 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\":\"59IISQVOXV5GGH0D\",\"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/1683708/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 (Arduino ESP8266)");
  client.println("Connection: close");
  client.println("Content-Type: application/json");
  client.println("Content-Length: "+data_length);
  client.println();
  client.println(data);
}
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
}
void printWiFiStatus() {
  // Print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
// Print your device IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// Print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
}

However, when I tried to change the update interval to 0.3s (30Hz), the following error massage was given in the Arduino monitor: Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Could someone please help me with this issue. If anything else is needed, I will update immediately.

Many thanks

I want to scale A and B (shown in a picture below) from a known dimension (base of tail light) from an image of an assembled car. The purpose is to get factory dimensions prior to welding my car together because I replaced both quarters, trunk pan, and trunk drop-offs. I replaced the frame rails. I made tubular ones in an effort to make them stronger. The installation of the tail panel will tie everything together. I want to make sure it's right.

IOT4ALL
IOT4ALL
最後のアクティビティ: 2022 年 3 月 21 日

Hello!

I`ve got problems with reading last input of a channel field using AT commands, here follows the sketch I'm currently using:

/* String tx_data_r = "GET https://api.thingspeak.com/channels/CHANNEL/fields/4/last.txt?api_key=API_READ_KEY&results=1"; */

String tx_data_r = "GET https://api.thingspeak.com/channels/";
tx_data_r += "CHANNEL";                                                                         
tx_data_r += "/";
tx_data_r += "fields";                                                                    
tx_data_r += "/4/";                                                                            
tx_data_r += "last.txt?api_key=";
tx_data_r += "API_READ_KEY";                                                                 
tx_data_r += "&results=1";                                                                   
tx_data_r += "\r\n";
Serial.print("AT+CIPSEND=");                                                                                                                                              
delay(1000);
Serial.println(tx_data_r.length());                                                                                                                                    
delay(1000);
Serial.println(tx_data_r);
delay(1000);
 This piece of code doesn`t return a valid response, however if I copy/paste
 https://api.thingspeak.com/channels/CHANNEL/fields/4/last.txt?api_key=API_READ_KEY&results=1"
 using a browser I get the right data.
 One more thing, if instead of using a microcontroller I use an USB serial PC interface program  directly connected to 
 my RF module, with                                                                      
 GET https://api.thingspeak.com/channels/CHANNEL/fields/4/last.txt?api_key=API_READ_KEY&results=1
 along with other commands I get the right data too!
 Can anybody tell me what's going on?
 There are no problems with any read related commands.
 If a working sketch is available it will be most welcome!
 Tks in advance for any help! 
mohamad hesham jenbaz
mohamad hesham jenbaz
最後のアクティビティ: 2022 年 3 月 17 日

Hello guys:

I am having a problem with something I'm doing, I don't know whether it is something related to thingspeak or to my program. I am using Curl library in c to make Get requests to send data to my channel, those data are are measurments of my Analog Discovery 2 device and they are instantaneous, (using the AD2 SDK library which was uploaded recently, and in it they use thingspeak to send the measurments too) . However, the updating to my channel is happenning very slowly (every new sample update happens each 15 seconds). What do you think is causing the problem? is the updating to the channels is usually slow and you can't do thing kind of fast uploading? or is it something that my code fails to communicate with the channel properly. I attached a photo to my program which shows the status of the Curl Get requests (which demonstrates the connectivity problem). Appreciating any help.

Suraj Kumar
Suraj Kumar
最後のアクティビティ: 2023 年 1 月 5 日

I have submitted a problem in cody some days back. Now it is not showing in my profile. Initially it was accepted and some people submitted the solutions also, however It has been removed after that, are there some guidelines which I am not following?
Alberto Maccioni
Alberto Maccioni
最後のアクティビティ: 2022 年 3 月 14 日

Hello, I see a difference in the number of elements returned by: https://api.thingspeak.com/channels/1389063/status.json?offset=0&results=2500&api_key=XXXXXXXXXXXXXX and https://api.thingspeak.com/channels/1389063/feeds.json?offset=0&results=2500&status=true&api_key=XXXXXXXX The first returns only 271 elements, the second 2500 as requested. Why is that?

Antonello Zito
Antonello Zito
最後のアクティビティ: 2025 年 1 月 13 日

This is not a question, but a point of discussion for the entire community. I am aware that every 1/2 months this theme comes out, but until this is not fixed it is totally necessary that this comes, indeed, out. And I said "fix" because Mathworks has to understand that a dark theme is not only a visual/aesthetic matter, it is a substantial part of the game. Most of the OS, GUIs, programs are actually in dark mode, and a vast majority of the users makes indeed use of a global dark mode. How much one does like it is personal, but the benefits to power savings and eye health is instead a fact. Mathworks being ignoring this for years is nothing but ridiculous. Of course it is not an easy task, but every minute of committment for it is worthy. And nope, Schemer is not helpful because it does not provide a real fix to this question.
I feel free to suggest something similar to the Spyder's dark theme, which came out like 2 years ago if I remember correctly.
Of course, my point is not being disrespectful (I am instead very respectful to the huge efforts of Mathworks for making this wonderful program run). But, form a user's point of view, the fact that not a single word has so far come out from Mathworks about a dark theme (meaning that for sure we will not see it in a timing of months) requires us to put a strong pressure on this.
Mathworks, please: it's time for a dark theme.
Raymond Norton
Raymond Norton
最後のアクティビティ: 2022 年 3 月 10 日

I am working with an Arduino nodemcu board and a Tmp36 sensor. My channel updates fine if I use my browser with the following: https://api.thingspeak.com/update?api_key=xxxxxxxxx&field1=71, but does not update with the following sketch, although the serial monitor shows the commands are executed:

//Source code to the Temperature Sensor and ThingSPeak Server Blog
String ssid     = "XXX";  // SSID to connect to
String password = "XXX"; // Our virtual wifi has no password (so dont do your banking stuff on this network)
String host     = "api.thingspeak.com"; // Open Weather Map API
const int httpPort   = 443;
String uri     = "/update?api_key=XXXX&field1=";
int setupESP8266(void) {
  // Start our ESP8266 Serial Communication
  Serial.begin(115200);   // Serial connection over USB to computer
  Serial.println("AT");   // Serial connection on Tx / Rx port to ESP8266
  delay(10);        // Wait a little for the ESP to respond
  if (!Serial.find("OK")) return 1;
    // Connect to 123D Circuits Simulator Wifi
    Serial.println("AT+CWJAP=\"" + ssid + "\",\"" + password + "\"");
    delay(10);        // Wait a little for the ESP to respond
    if (!Serial.find("OK")) return 2;
    // Open TCP connection to the host:
    Serial.println("AT+CIPSTART=\"TCP\",\"" + host + "\"," + httpPort);
    delay(50);        // Wait a little for the ESP to respond
    if (!Serial.find("OK")) return 3;
    return 0;
  }
void anydata(void) {
    int temp = map(analogRead(A0),20,358,-40,125);
    // Construct our HTTP call
    String httpPacket = "GET " + uri + String(temp) + " HTTP/1.1\r\nHost: " + host + "\r\n\r\n";
    int length = httpPacket.length();
    // Send our message length
    Serial.print("AT+CIPSEND=");
    Serial.println(length);
    delay(10); // Wait a little for the ESP to respond if (!Serial.find(">")) return -1;
    // Send our http request
    Serial.print(httpPacket);
    delay(1000); // Wait a little for the ESP to respond
    if (!Serial.find("SEND OK\r\n")) return;
}
void setup() {
    setupESP8266();
}
void loop() {
   anydata();
    delay(10000);
  }
Sai Teja Kavuri
Sai Teja Kavuri
最後のアクティビティ: 2022 年 3 月 13 日

hello, i have done my iot project using thingspeak as the monitoring source and its working well and good.But now i need get text message to a mobile when the field value gets reached to given threshold value and i have to get a alert text message.Is there any way to resolve my problem from thigspeak data to alert text message.

Thankyou.

Abbas Atefi
Abbas Atefi
最後のアクティビティ: 2022 年 3 月 11 日

Hi,

I am using Ublox SARA-R410M to send (cellular) data to ThingSpeak cloud. I found in the Ublox manual that AT+UHTTPC (POST data command) can do the job. The link below is the location which my data will be saved on ThingSpeak (field1):

"https://api.thingspeak.com/update?api_key=WRITE_API_KEY&field1="

Note that the "WRITE_API_KEY" is 16 characters (combination of letters and numbers).

AT command: AT+UHTTPC=<profile_id>,5, path,<filename>,<data>,<HTTP_content_type>

Based on the information above, which items should I use for path and filename? And how can I use this command in Arduino code?

I appreciate any help in advance.

Abbas

Tran Tran
Tran Tran
最後のアクティビティ: 2022 年 3 月 2 日

Hi everyone
I am a new of this community and I very interested in this forum and Matlab.I am trying to submit a soultion but as tiltle my code has a built-in function so the test systerm dont reconisie it.It run completely ok on my computer.
This is problem
This is my solution
function [boOut] = BoIfPointInPoly(PolyMatrix,p_test)
%Summary of this function goes here
%{
if we draw a line from test point to a central point of a side of The polygon
then we extend that line to the furthest point of the polygon ensure that
line go through all side of Polygon in 1 direction.I call that line is line_test
Next find number of intersert of line test and all sides w polyxpoly
function
num interset point is odd mean p_test inside
num interset point is even mean p_test outside
this solution go from the concept that if a line go in from a side it has go out
from other side.So if it go in but not go out that mean it start from
inside.
%}
% Detailed explanation goes here
%line from p test throuh central of a side to furthest point of polygon
%find vector
V = ((PolyMatrix(1,:) + PolyMatrix(2,:)) /2) - p_test ;
%draw that vector to furtest point
pend = p_test + V * max(PolyMatrix(:));
%with multi of V and biggest element I assume that line will go all out the
%polygon which ensure out logic will right
line_test = [p_test ; pend];
disp('Our line test\n');
disp(line_test);
%find interst point
p_inter = polyxpoly(PolyMatrix(:,1),PolyMatrix(:,2),line_test(:,1),line_test(:,2));
%find number of interset (row)
[numIntere,trash] = size(p_inter);
disp('Number of interest point:');
disp(numIntere);
%determine in or out
if (rem(numIntere,2) == 0)
boOut = 0;
else
boOut = 1;
end
end
Can anyone has solution.

Hi,

I am using a Sparkfun LTE Shield with a SARA-R410M-02B-01 cellular module, an Arduino UNO, and an AT&T simcard to send data to ThingSpeak. I used "AT+UDNSRN" on Arduino code (below) to find IP address of "api.thingspeak.com". I found two different IPs using this command: "3.224.210.136","3.213.58.187" (also, nslookup command on CMD Windows gives me these IPs). Moreover, I found that some websites report "184.106.153.149" as ThingSpeak's IP. I used the "AT+USOCO" on Arduino code (below) for TCP connection using these three IPs:

Example of the Arduino codes:

lteSerial.println("AT+UDNSRN=0,\"api.thingspeak.com\""); //Find IP address
lteSerial.println("AT+USOCO=0,\"184.106.153.149\",\"80\""); //TCP Connection to ThingSpeak using IP address 

But I got this error (for "AT+USOCO" command):

+CME ERROR: Operation not allowed

Any idea regarding which IP address should I use for "api.thingspeak.com"?

I appreciate any help in advance.

Abbas

Louis Nox
Louis Nox
最後のアクティビティ: 2022 年 3 月 5 日

I visualise my data with ThingSpeak (data from The Thing Network) and I would like to have something like a button to send a command (downlink). I can send downlink with the thing network but I would like : The thing speak (for interface) -> the thing network (for lora gateway management) -> my device I see talkback and some example with wifi node but it is not my case... Thank you for your reply