Andreas in Discussions
上次活动时间: 2023-12-9

Hallo, ich Neuling hier, und habe das Beispiel WriteMultipleFields benutzt um die Funktionsweise zu verstehen. So weit so gut, hat auch alles grklappt. Jetzt nach 2 Tagen bekomme ich immer eine Fehlermeldung. Problem updating channel. HTTP error code -401 abwechselnd mit Channel update successful. Es ist immernoch die gleiche Software, Board ist WiFi LoRa 32 V3. Rückmeldung vom ESP Hat sich erledigt, habe den Fehler gefunden. Hatte die Updatetime auf 10 Sek. gestellt um nicht solange warten zu müssen, das scheint dem Server aber nicht zugefallen. Danke und schönen Abend noch fehlermeldung status
Spacerlabs Team in Discussions
上次活动时间: 2022-4-14

Hi, I am a newcomer to ThingSpeak, and have created a channel for my soil-moisture sensor. I have checked "show status" of my channel. 'Channel Status Updates' widget appears, but no data are displayed. It is not responding. The widget is always blank despite new sensor data every hour. I would like to display default status messages. Why doesn't it work and what should I do ? I have searched all documentation but find no help there. br SpacerLabs Team Channel Status Updates not responding When you write tot he channel;, you need to set a status message. In the <https://www.mathworks.com/help/thingspeak/writedata.html write data> REST API you add &status=YOUR_STATUS. For the <https://github.com/mathworks/thingspeak-arduino ThingSpeak library> , use ThingSpeak.setStatus(myStatus); Hi Christopher, Thanks for replying. I have followed the link you gave to ThingSpeak library. After some trial and error and guesswork, my code is: String myStatus = "New data'; ThingSpeak.setStatus(myStatus); int setStatus = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); which successfully displays the text 'New data' in the 'Channel Status Updates' widget. Although I am happy with the result, I had to guess the syntax of the third line. So is there a better way using a different syntax ? br SpacerLabs Team Glad to hear you got it working. I can imagine your confusion about the syntax coming at it just from the desire to write status only. You can set multiple fields to write simultaneously with that pattern. For example ThingSpeak.setFields(1)=value1; ThingSpeak.setFields(2)=value2; ThingSpeak.setStatus(myStatus); //then ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); See the write multiple fields example in the <https://github.com/mathworks/thingspeak-arduino library> , and you will get the right syntax for ThingSpeak.writeFields. status
Danielle Honigstein in MATLAB Answers
上次活动时间: 2021-5-5

Hi all, I read the data from my channel using thingSpeakRead, but the status of the channel doesn't seem to be available. How do I read that from Matlab (not using REST or MQTT)? EDIT: Code I am using: lastData = thingSpeakRead(channelID,'OutputFormat','TimeTable','ReadKey','MY_READ_KEY') What is printed out: lastData = 1×5 timetable Timestamps AppName Action Address Version Extra ______________ ______________ _________ _________ _________ ____________ 04-May-2021 14:09:25 {'Data1'} {'Data2'} {'Data3'} 3.2 {'Data4'} I would have expected a column of "Status", as my channel has the status enabled. It is not one of the fields, it was from enabling "Show Status" in the channel settings. Thanks, Danielle

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.