Data not shown correctly

조회 수: 2 (최근 30일)
Fiorenzo Daniele Giust
Fiorenzo Daniele Giust 2023년 5월 19일
편집: Christopher Stapels 2023년 5월 19일
When I read the data on the chart, each data are written on the same X axis (no trend shown)
The data are written every 2 minutes through an application running ESP8266.
This is part of the code written with Arduino IDE
rssi = WiFi.RSSI();
valPinAcqua = analogRead(PinAcqua);
valAcqua = map(valPinAcqua, 1024, 256, 0, 100); //converto il valore analogico in percentuale
checkCom = checkCom * (-1);
// Construct API request postStr
String postStr = writeAPIKey;
postStr +="&field1=";
postStr += String(valPinAcqua);
postStr +="&field2=";
postStr += String(valAcqua);
postStr +="&field3=";
postStr += String(rssi);
postStr +="&field4=";
postStr += String(checkCom);
postStr += "\r\n\r\n";
clientTHS.println("POST /update HTTP/1.1");
clientTHS.println("Host: api.thingspeak.com");
clientTHS.println("User-Agent: ESP8266 (nothans)/1.0");
clientTHS.println("Connection: close");
clientTHS.println("X-THINGSPEAKAPIKEY: " + writeAPIKey);
clientTHS.println("Content-Type: application/x-www-form-urlencoded");
clientTHS.println("Content-Length: " + String(postStr.length()));
clientTHS.println("");
clientTHS.print(postStr);
}
clientTHS.stop();
Thanks
Fiorenzo
  댓글 수: 1
Christopher Stapels
Christopher Stapels 2023년 5월 19일
편집: Christopher Stapels 2023년 5월 19일
we strongly recomend using the ThingSpeak library for communication. Im not totally clear about your issue. Can you describe more what you are seeing, or show a screen shot, or share your channel ID if it is public?

댓글을 달려면 로그인하십시오.

답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

태그

Community Treasure Hunt

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

Start Hunting!