Something recently changed - Arduino > Thingspeak > Twilio stopped working | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Something recently changed - Arduino > Thingspeak > Twilio stopped working
No permission to create posts
August 26, 2019
9:39 pm
Avatar
rosspeters

Silver
Members
Forum Posts: 5
Member Since:
August 26, 2019
sp_UserOfflineSmall Offline

I have an old alarm system in my house and a couple of years ago I did an interesting project - using an Arduino to monitor the system and send me a text message if the alarm is tripped. It has worked like a charm for the past two years, but something seems to have changed recently (literally in August). When I test the system, twlio returns an invalid phone number error. I have looked into it, and the issue seems to be around a change in the format of the HTTP call to ThingHTTP.

When I use a test ThingHTTP App with a Body of: From=+12125551212&To=+12125551234&Body=Test it works fine (although I changed the phone numbers here), so the call to Twilio is working

The real ThingHTTP has a body of: From=+12125551212&To=%%number%%&Body=%%message%%, where the Arduino is supposed to pass along the number (it loops twice to send to both my wife and myself) and a specific message based on what happened. The relevant Arduino code is:

client.print("GET /apps/thinghttp/send_request?api_key=");
client.print(apiKey);
client.print("&number=");
client.print("+12125551234");
client.print("&message=");
client.print(message);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(server);
client.println("Connection: close");
client.println();

Earlier code defines the message, but it doesn't even get to the point of sending the text. If i hard code the phone number into ThinkHTTP is does send it with a message of "%%message%%" so it is getting through - just not with %%number%% and %%message%% properly defined

Any help would be appreciated - I am a programming amateur who leveraged a few different pieces I found to make this all work. Something has obviously changed recently but I can't find any reference to what it is.

Thanks,

Ross

August 29, 2019
7:54 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 771
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

Replacement keys are most reliable when triggered by time control or react. I will look into your case and see if I can reproduce it.

September 1, 2019
10:45 am
Avatar
rosspeters

Silver
Members
Forum Posts: 5
Member Since:
August 26, 2019
sp_UserOfflineSmall Offline

Thanks - if it helps, I used the SMS code from http://www.instructables.com/id/Send-SMS-from-Arduino-over-the-Internet-using-ENC2/ in my Arduino sketch. I had set up the simple example (with valid credentials) as part of my development, and it also no longer works.

Any insight would be appreciated - hopefully there is a simple syntax fix.

Thanks,

Ross

September 1, 2019
12:34 pm
Avatar
rosspeters

Silver
Members
Forum Posts: 5
Member Since:
August 26, 2019
sp_UserOfflineSmall Offline

I also tried using POSTMAN to trigger the Thingspeak API entering the keys there, and had the same issue so I don't think the problem is on the Arduino side. The HTTP call is pretty simple -

https://api.thingspeak.com/apps/thinghttp/send_request?api_key=XXX&number=+1xxx&message=Hello

But the number and message fields don't seem to be getting passed through.

September 4, 2019
3:13 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 771
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

This is being investigated and there may be a fix available tomorrow.

September 7, 2019
9:39 am
Avatar
rosspeters

Silver
Members
Forum Posts: 5
Member Since:
August 26, 2019
sp_UserOfflineSmall Offline

Works now - thanks for your help!

Cheers,

Ross

September 9, 2019
8:23 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 771
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

Thanks for the confirmation.

FYI, MATLAB Answers is now the preferred location for online help regarding ThingSpeak topics.

https://www.mathworks.com/matlabcentral/answers/?product_base_code%5B%5D=ThingSpeak&sort=asked+desc

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Hema, askask, Rakwireless, budiardi basuki, oliver009, shelby1234

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457