Cant view my data on thingspeak app

6 ビュー (過去 30 日間)
Eseme Kluivert
Eseme Kluivert 2022 年 6 月 24 日
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\ end";
// 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"
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 27 日
Please format your code.
Remove the currently posted version of the code here. Then, in the editor, click on the ">" button in the "CODE" toolstrip immediately above the editor entry window. That will create a code entry region. Paste the formatted code into there.

サインインしてコメントする。

回答 (1 件)

Vinod
Vinod 2022 年 6 月 27 日
I recommend starting with the example here as a starting point for your code. The ThingSpeak library on Github is to help users get started and I would strongly recommend using that when possible.
  2 件のコメント
Eseme Kluivert
Eseme Kluivert 2022 年 7 月 1 日
I have tried the examples the serial monitor keeps indicating that the wifi shield is not present
Christopher Stapels
Christopher Stapels 2022 年 7 月 6 日
I think that means you are using the wrong code. You can select the esp8266 via AT commands examples in the library.

サインインしてコメントする。

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeRead Data from Channel についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by