receive and export data at the same time
조회 수: 4 (최근 30일)
이전 댓글 표시
I have two different data that I need to get from the internet and send to the internet. When I use Thingspeak, it only performs the function of one of them (the one that is written first in the code). I cannot make two operations on the same code. Is there a way to do this?( I am using arduino UNO)
댓글 수: 2
채택된 답변
Christopher Stapels
2024년 1월 19일
I think your questions are fundamentally programming questions, they dont have much to do with ThingSpeak exactly. I reccomend you start over with your code, have it do one simple thing at a time, and make sure you understand what it is doing and why. If you want to practice with ThingSpeak, you can use the API syntax from the API keys tab of your channel view to change the data in your channel and to read it back. Then once you can make a function in your code that does that predictably, then you can add the second function and build up from there. Also I still wonder what action the ThingHTTP is doing for you. I guess you said at the top that it is fetching some other data form the internet. You can probably use a different route to do that more efficiently, perhaps using MATLAB code and TimeControl.
댓글 수: 2
Rene Chan
2024년 1월 23일
I think you closed the connection in the first function with:
esp.println("AT+CIPCLOSE");
추가 답변 (1개)
Christopher Stapels
2024년 1월 18일
이동: Christopher Stapels
2024년 1월 18일
You should be able to complete both operationg in the same code. I have succeeded in both of these in the same code before (though not with AT commands)
There are functions to interact with ThingSpeak by writing AT commands in the ThingSpeak library. That might help you somewhat.
You have provided the functions, but you arent showing how you are calling the functions, so I'm not sure how they are triggered.
Also, I dont know what your ThingHTTP does. If it writes to the same channel as the first function, it would be denied if they are too close in time.
I think there are very many parts to your question. I would reccommend simplyfying your process and testing just one thing at a time.
커뮤니티
더 많은 답변 보기: ThingSpeak 커뮤니티
참고 항목
카테고리
Help Center 및 File Exchange에서 Read Data from Channel에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

