Problem geting ThingHTTP to send sms from Twilio

1 次查看(过去 30 天)
I hate to ask but I have been struggling with this and just can't get it working.
I set up a Twilio trial account and tested it sending an SMS to my cell phone.
I set up a Thingspeak REACT to respond to data in one of my channels and then use ThingHTTP to write data to another channel.
The part I can't get working is for a REACT to use ThingHTTP to get Twilio to send an SMS to my cell. I have read several tutorials and watched videos but just can't get there.
The ThingHTTP screen has the following:
API Key XXXYYYYZZZZ // there is a long key that thingspeak generates - as far as I know I don't use this anywhere
URL https://api/twilio.com/2014-04-01/Accounts/xxxxmynumberyyyy/Messages // have aslo tried ...mynumberyyy/SMS/Messages
HTTP Auth Username XXXXmyTwilioAccountSIDyyyy
HTTP Auth Password XXXmyTwilioAuthTokenyyyy
Method POST
Content Type application/x-www-forms-urlencoded
HTTP Version 1.1
HOST I left this blank
Headers None added
Body From=+15875555555&To=+15875555555&Body=Test Message 1 // not my real hone numbers
Parse String I left this blank
Any pointers would be greatly appreciated.
  10 个评论
Sheila Hill
Sheila Hill 2020-11-20
Thanks Vinod, I hope to send very few emails - ideally none. An alert means I may have to drive several hours to go light a pilot light or fix something else.
Thanks Christopher, posting that detailed code for me did the trick. I set up a react to check for a temperature > 9 and if so, trigger the MATLAB send SMS via Twilio. It works and works very fast!
Another question - maybe I should post separately?? I see a React can easliy be set up to check for "no data". And I specify what channel to check. Is there a way to check individual fields in that channel? If I have several devices sending data to different fields in the same channel, I want to know if one of them stops sending data, even if the others are still sending data.
Christopher Stapels
Christopher Stapels 2020-11-20
编辑:Christopher Stapels 2020-12-8
We reccomend one channel per device for several reasons. One is that asynchronous posts could be within the update frequency and result in lost data. Another is that you get null values in the other fields when a device posts to a shared channel. If you put each device in its own channel, you can then create a summary channel that combines the two channels.
To check individual fields, I would use a MATLAB analysis script and then run it regularly with TimeControl.
thingSpeakRead() lets you specify a field to read from, or you can read a bunch of data and parse it to find missing values.

请先登录,再进行评论。

回答(0 个)

社区

更多回答在  ThingSpeak Community

类别

Help CenterFile Exchange 中查找有关 Act on Data 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by