Ready private Chanel/field

Beata-Anita Gerger on 25 Mar 2024
Latest activity Reply by Christopher Stapels on 8 Apr 2024

Englisch Translate Französisch Deutsch Deutsch Russisch PONS Deepl übersetzer Spanisch Deutsch DeepL kostenlos Deutsch Englisch hallo, ich bitte um Hilfe! Seit Jahren habe ich Konto auf Thingspeak, den ich für meinen Zweck nicht richtig nutzen kann. Ich kann "Upoad to meine private Chanel", aber das lesen funktioniert nicht, weder in ArdunioIDE, noch Ardunio iot kann ich die gesendete Daten (Temperatur) von einem anderen Board lesen, es ist egal, ob ESP8266, ESP32, MKR, oder UnoWifi Rev2. Nichts! Die Beispiele im Bibliotek sind eine Katastrophe, "wetter-chanel" und diese funktionieren auch nicht. Auch nicht die von GitHub. Es sollte aber einfach sein, denn auf meiner Seite sehe ich ja "GET"+ url. inkl json+result.

Wo gibt es eine richtige sketch für "read private chanel/field" , welche funktioniert? Man braucht nicht die Wifi-Enstellungen, sondern den code für die Abfrage, "Serial.print"(value)"

Bitte um Hilfe, danke schön.

hello, I ask for help! I've had an account on Thingspeak for years, but I can't use it properly for my purpose. I can "Upoad to my private Chanel", but reading doesn't work, neither in ArdunioIDE nor Ardunio iot can I read the sent data (temperature) from another board, it doesn't matter whether ESP8266, ESP32, MKR, or UnoWifi Rev2. Nothing! The examples in the library are a disaster, "weather-chanel" and they don't work either. Not even the one from GitHub. But it should be easy, because on my site I see “GET”+ url. including json+result.

Where is there a proper sketch for "read private chanel/field" that works? You don't need the WiFi settings, but the code for the query, "Serial.print"(value)"

Please help, thank you very much.

Christopher Stapels
Christopher Stapels on 25 Mar 2024 (Edited on 25 Mar 2024)
Nice of you to include the translation! (my German is pretty bad)
I'm sure we can get you on ThingSpeak!
Ok, Step 1. Can you post to your channel using the web browser address bar and the syntax on the api keys tab of your channel?
Once youve got that, proceed carefully to step 2- ( I suggest ESP32.) Make sure the device can sucessfully connect to the local wifi.
If you use the examples in the ThingSpeak library, you will see "Connected." on the serial monitor when connected.
Step 3. Send a constant value to ThingSpeak. Any number, for example '11.375' I suggest. Use the library example. If that fails, and you are still stuck, post what happened here and we can get you back on track.
Happy ThingSpeaking!!
Beata-Anita Gerger
Beata-Anita Gerger on 27 Mar 2024 (Edited on 27 Mar 2024)

Hallo! Ich hoffe die Übersetzung funktioniert auch bei dir.

Ich glaube, trotz Übersetzung hast du mich nicht verstanden!!!

PROBLEM: ArduinoIDE (web oder lokal, Form ist egal, beide schlecht) Bibliothek -> Thingspeak -> read Field = Sketch ist katastrophe und funktioniert nicht! Außer Daten-Eingabe "ssid" und "pass" funktioniert hier nichts, vor allem nicht für private Chanel, welche die meisten Nutzer verwenden.

Ich habe geforscht und herausbekommen, dass die Anfrage von Thingspeak, also "read Data from Thingspeak" erfolgt als "getstream".

Dieser Weg funktioniert zwar, aber der Json zeigt in einem String alles über den fraglichen "field", was mich an einem Display nicht interessiert, wie "created","Name"... Ich brauche nur den Wert, den ich an Display anzeigen kann.

Also noch Mal:

Board Nr1: ESP32 oder MKR WIFI1010 oder NODEMCU mit DHT11/DS18b/ SoilMonsture/ Relay -> ArduinoiotCloud-> Thingspeak, "send Value". Das funktioniert.

Board Nr.2/3/4/5/6/7/8 ESP32.... "read from Thingspeak" mein privates Chanel xxx field 4 Temperature ---> to Board "Serial.print(Value from DHT11)" funktioniert nicht.

Der Zweck von "Cloud-Daten" ist nicht "Visualisierung", ich will nicht im Zimmer überall ein Telefon/Tablet aufhängen, dafür habe ich schöne Displays von Nextion (7 Zoll)

Mein Vorhaben war von Anfang an (seit 5 Jahren) Daten sammeln vom Garten/Balkon/Terrasse/Pool, und diese Daten an andere Boards weitergeben... (Im Haus drinnen)

"If temperatur Pool x Relay an Arduino iot Cloud High/Low"

"Alexa, ist der Relay an?" "Alexa, schalte den Relay bei Sonnenuntergang für 10 Minuten an" (wenn Soil zu viel, wird Befehl von Arduino iot Cloud gestoppt)

Das Problem mit iot ist, dass keine vollwertig ist, bei jedem Form fehlt was.

Alexa bekommt keinen "Trigger" von iotCloud, jedoch Value, Temperatur/ boolen kann ich abfragen...

Ich will die Daten in Thingspeak nicht tgl.am Telefon betrachten, sondern benötige die Werte/Value zu Automation.

Christopher Stapels
Christopher Stapels on 27 Mar 2024
Im willing to work with you but I suggest we focus on one problem: there is too much here to parse. Then you can start a new post with the next problem.
I suggest we focus here: Board No.2/3/4/5/6/7/8 ESP32.... "read from Thingspeak" my private Chanel xxx field 4 Temperature ---> to Board "Serial.print(Value from DHT11)" works not.
Are you trying to read an existing value in a private ThingSpeak channel and display it on the serial monitor?
If so, since you already know how to write to a channel, make sure you can write to a channel from the esp32 (as you do with the Adruino), and then we will step through the read process. Read is somehwat easier than write, so I have confidence we can get there.
Beata-Anita Gerger
Beata-Anita Gerger on 27 Mar 2024

String(payload)= { "created: bla-bla" "Name: bla-bla" "Value: 26,45876" }

I neeed "Value,2"= outtemp

Christopher Stapels
Christopher Stapels on 27 Mar 2024
Yes, what you are asking for should be fairly straightforward.
Are you using an example from the ThingSpeak library? Look in the read data from channel section.
What have you tried? Are you able to read the value in your web browser using the syntax shown on the API keys tab of your channel?
Beata-Anita Gerger
Beata-Anita Gerger on 28 Mar 2024 (Edited on 28 Mar 2024)

no. I don't use Libarys anymore. Neither for OWM, not for Thingspeak and not for Nextion because it doesn't work. This sketch (help "Chatgpt") works in the serial monitor on the PC. I see data, "created", "name", and the last value. what actually interests me (what actually interests me)

I don't know who created the Libary's, but they are so stupidly made that you can't even tell which "ID" to use and where. "Weather Chanel /public Chanel"????? No idea what that is. After entering it for private use, the sketch doesn't even go through. Not even when I try with Blanco ESP32, without iotCloud, without OWM, and without the Nextion display. The example sketch is terribly bad!

Christopher Stapels
Christopher Stapels on 28 Mar 2024
I urge you to use care when calling a library "stupid". You might find yourself talking to someone who contributed code to one of those libraries, or knows well the authors.
There are many thousands of devices using the thingSpeak library, perhaps many tens of thousands.I think you should give it another try.
I'm going to put the read field example form the ESP32 part of the library here. Take the parts that you find difficult, and share those parts in your resposne, and we can step through them. Since you say you want to read a private field, Ive commented out the public channel read part. Keep in mind you will also need the secrets.ino file with your network and channel information to make this code work.
#include <WiFi.h>
#include "secrets.h"
#include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password
int keyIndex = 0; // your network key Index number (needed only for WEP)
WiFiClient client;
// Weather station channel details
unsigned long weatherStationChannelNumber = SECRET_CH_ID_WEATHER_STATION;
unsigned int temperatureFieldNumber = 4;
// Counting channel details
unsigned long counterChannelNumber = SECRET_CH_ID_COUNTER;
const char * myCounterReadAPIKey = SECRET_READ_APIKEY_COUNTER;
unsigned int counterFieldNumber = 1;
void setup() {
Serial.begin(115200); //Initialize serial
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo native USB port only
}
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client); // Initialize ThingSpeak
}
void loop() {
int statusCode = 0;
// Connect or reconnect to WiFi
if(WiFi.status() != WL_CONNECTED){
Serial.print("Attempting to connect to SSID: ");
Serial.println(SECRET_SSID);
while(WiFi.status() != WL_CONNECTED){
WiFi.begin(ssid, pass); // Connect to WPA/WPA2 network. Change this line if using open or WEP network
Serial.print(".");
delay(5000);
}
Serial.println("\nConnected");
}
// Read in field 4 of the public channel recording the temperature
// float temperatureInF = ThingSpeak.readFloatField(weatherStationChannelNumber, temperatureFieldNumber);
// Check the status of the read operation to see if it was successful
// statusCode = ThingSpeak.getLastReadStatus();
// if(statusCode == 200){
// Serial.println("Temperature at MathWorks HQ: " + String(temperatureInF) + " deg F");
// }
// else{
// Serial.println("Problem reading channel. HTTP error code " + String(statusCode));
// }
// delay(15000); // No need to read the temperature too often.
// Read in field 1 of the private channel which is a counter
long count = ThingSpeak.readLongField(counterChannelNumber, counterFieldNumber, myCounterReadAPIKey);
// Check the status of the read operation to see if it was successful
statusCode = ThingSpeak.getLastReadStatus();
if(statusCode == 200){
Serial.println("Counter: " + String(count));
}
else{
Serial.println("Problem reading channel. HTTP error code " + String(statusCode));
}
delay(15000); // No need to read the counter too often.
}
Beata-Anita Gerger
Beata-Anita Gerger on 29 Mar 2024

I think I'd be better off forgetting about Thingspeak and trying something to make openweather work in IotCloud. I have a few board selections... The transfer of values works within Arduno IotCloud (Board A = temperature outside, Board B = temperature inside, Board C = Weather Forecast (where I only get Temp_min, Temp_max, Weather_ID)

Beata-Anita Gerger
Beata-Anita Gerger on 29 Mar 2024 (Edited on 29 Mar 2024)

For Thingspeak Upload "#include thingspeak.h"

In void Setup: "thingspeak.begin()"

But!!!!!

Hey you wrote "WiFi Connection"????

Thus i don't neked!!!! And "WiFi" is included in the arduino iotcloud Thingspeak read: No!!!!!! Without "thingspeak.h" Just "#include HTTPClient.h"

Libary For read Not Funktion from Thingspeak.h

have you ever tried this stupid code?????

you copied the same nonsense that is in the IDE!?!!

Go to Thingspeak.

Under menu "Chanel->Apikey" it doesn't just mean "readApikey", but also the query code "GET http......"

That will get you there, but this nonsense from IDE definitely won't.

I still need to figure out how to use Json to decompose the result

I don't want it in the serial monitor, but on the display. so not "serial.println"

Christopher Stapels
Christopher Stapels on 29 Mar 2024
Good luck in your project.
Beata-Anita Gerger
Beata-Anita Gerger on 6 Apr 2024 (Edited on 6 Apr 2024)

Hallo, auch mit diesem Arduino-IDE-Beispiel kann ich, wie erwähnt, nichts anfangen, aber ich habe einen „GET-Abfrage“ gefunden, danach die Werte ohne sonstige „Zugabe“, (wie „id, „Erstelldatum“, „letzter Eintrag") kann auf dem Display gedruckt werden.

Ich frage mich nur, wenn eine „GET-Abfrage“ in paar Zeilen ohne Verwendung „Thingspeak-Bibliothek“ geschrieben werden kann, warum ändert man diese nutzlose Beispiele in IDE nicht, welche sowieso nicht funktioniert, der Sketch geht nicht mal bei „kompilieren“ durch?!?

Ich bin kein Programmierer, ich habe nicht mal Englisch gelernt, deshalb schätze ich jeden, der etwas zur Stande bringt, aber die Beispiele von Thingspeak in der IDE (2.3) sind nur Müll. Für das Lesen und auch für das Schreiben.

Christopher Stapels
Christopher Stapels on 8 Apr 2024
Thank you for your feedback.. Many tens of thousands of users have sucesfully used the library to make many billions of posts. ThingSpeak is well known for its ease of use even among users who have little or no experience with coding. If you are able to find a platform that you find easier, please let us know about it.

Tags

No tags entered yet.