Can't get thingSpeak to display data

71 vues (au cours des 30 derniers jours)
Larry McIntyre
Larry McIntyre le 22 Jan 2021
Modifié(e) : Eseme Kluivert le 24 Juin 2022
Data is being sent by a webhook from a Particle Photon. I know the data is being received by thingSpeak because I see the entries number is being incremented when new data arrives.
Here is my setup page.
Can anyone help? Thank you. Larry
  7 commentaires
Christopher Stapels
Christopher Stapels le 21 Juin 2022
Can you start a new thread or question? If we answer your question on this thread it will confuse others who came here to solve the same problem the original poster had. In your new post, just show the thingspeak relevant parts of the code to make it easier for people to help. Also describe what you have tried and what you are seeing.
Make sure to redact your API keys, those are like poasswords.
Eseme Kluivert
Eseme Kluivert le 24 Juin 2022
Modifié(e) : Eseme Kluivert le 24 Juin 2022
I am using an esp-01S Wi-Fi module to send temperature and heartbeat information to the thingspeak app using the AT comand from the arduino my code runs well and it establishes a connection on the serial monitor but i am unable to view the data on the thingspeak app Here is my thingspeak command
void setup() { lcd.begin(16, 2); pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat! pinMode(fadePin,OUTPUT); // pin that will fade to your heartbeat! Serial.begin(115200); // we agree to talk fast! interruptSetup(); // sets up to read Pulse Sensor signal every 2mS
// IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE LESS THAN THE BOARD VOLTAGE,
// UN-COMMENT THE NEXT LINE AND APPLY THAT VOLTAGE TO THE A-REF PIN
// analogReference(EXTERNAL);
lcd.clear(); lcd.setCursor(0,0); lcd.print(" Patient Health"); lcd.setCursor(0,1); lcd.print(" Monitoring "); delay(4000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Initializing...."); delay(5000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Getting Data...."); ser.begin(9600); ser.println("AT"); delay(1000); ser.println("AT+GMR"); delay(1000); ser.println("AT+CWMODE=3"); delay(1000); ser.println("AT+RST"); delay(5000); ser.println("AT+CIPMUX=1"); delay(1000);
String cmd="AT+CWJAP=\"Alexahome\",\"98765432\""; ser.println(cmd); delay(1000); ser.println("AT+CIFSR"); delay(1000); }
void esp_8266() { // TCP connection AT+CIPSTART=4,"TCP","184.106.153.149",80 String cmd = "AT+CIPSTART=4,\"TCP\",\""; cmd += "184.106.153.149"; // api.thingspeak.com cmd += "\",80"; ser.println(cmd); Serial.println(cmd); if(ser.find("Error")) { Serial.println("AT+CIPSTART error"); return; } String getStr = "GET /update?api_key="; getStr += apiKey; getStr +="&field1="; getStr +=String(temp); getStr +="&field2="; getStr +=String(pulse); getStr += "\r\n\r\n"; // send data length cmd = "AT+CIPSEND=4,"; cmd += String(getStr.length()); ser.println(cmd); Serial.println(cmd); delay(1000); ser.print(getStr); Serial.println(getStr); //thingspeak needs 15 sec delay between updates delay(3000); }
Also i tried using the examples on thingspeak to upload a value in the channel but the serial monitor kept showing
Error "wifi shield not present"

Connectez-vous pour commenter.

Réponse acceptée

Christopher Stapels
Christopher Stapels le 25 Jan 2021
You are sending the string value "ctcurrent" to ThingSpeak, in your querry string parameters (not the value of the variable). You do have it as a parameter in the JSON, but I suspect the syntax is wrong. I would not send it in the JSON. Also, you have your write api key as a parameter in the webhook.
It is possible to use webhooks, and its nice to be able to abstract parameters so you can reuse a webhook for multiple processes. But it can be a bit tricky. I would really reccomend theThingSpeak library I mentioned above. It does all the work for you and doesn't need a webhook.
If you are really stuck on using the webhook, I'd find and example and carefully copy what you see.
Also, did you export only field 1? Do you have field 2 enabled in your channel view? If you exported the whole feed but only had channel 1 enabled, you might see something like what you show above. I was expecting to see the string "interval" based on what you shared.
  1 commentaire
Larry McIntyre
Larry McIntyre le 26 Jan 2021
The TCPClient is working for me. I agree it is much easier than setting up a webhook. Thanks again for the help.

Connectez-vous pour commenter.

Plus de réponses (0)

Communautés

Plus de réponses dans  ThingSpeak Community

Catégories

En savoir plus sur Write Data to Channel dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by