swyx
swyx

Reputation: 2511

How do I set up a Twilio account that sends POST requests to the IP of my Raspberry Pi?

thanks for giving this question a read! I am trying to replicate this work: https://github.com/iameli/buttonpusher

I have gotten through nearly all the steps except for the actual connectivity to Twilio itself, so I need help! the author simply says:

you'll need a Twilio account that sends POST requests to the IP of the Pi.

That is a hell of a lot of steps skipped. The closest SO question I can find is How to receive sms messages on raspberry pi where the incomplete answer was "You'd have to expose the RasPi to the public internet". Of course this isn't enough to help newbies like us. From further googling, I found this Twilio blogpost: https://www.twilio.com/blog/2014/05/making-your-apartment-buzzer-party-friendly-with-raspberry-pi-and-twilio.html which showed how to reserve a static IP for my Pi, but that seems to be an internal IP since it starts with 192.168.x.x

I still need to know a few things:

  1. How do I point Twilio to my internal IP? the Twilio blogpost says to use freedns, which I have set up, but I still have no idea what to point the freedns redirect towards.
  2. Where in the Twilio control panel do I set up the POST request to the IP of my Raspberry Pi? is it this?

enter image description here

  1. am I missing anything else I will need to create "a Twilio account that sends POST requests to the IP of the Pi"?

Thanks very much! I feel like you the vast gap in knowledge between people who know this IP-related stuff, and people who don't, is very hard to breach. Please help me at least figure out what to google, you don't have to handhold me the whole way but I'm going to need more than "You'd have to expose the RasPi to the public internet".

Upvotes: 1

Views: 141

Answers (2)

buzzard51
buzzard51

Reputation: 1467

If I understand what you're doing, and if you are just using SMS, all you need to do is set up port forwarding on your router to point http requests to your pi. NGROK looks like a great tunneling app but you are not exposing your pi to predatory browsers, so it may be overkill for you.

I use this exact setup to allow SMS control into my home automation system. It would be hard to hack because I filter incoming numbers and restrict authority to just two numbers.

Upvotes: 0

Alex Baban
Alex Baban

Reputation: 11702

In your picture, you have a correct place where you set up Twilio to make a POST request. But your Pi, has an internal IP address, and is not visible from the internet so Twilio can't call your Pi.

Take a look at https://ngrok.com/ which will give you a url that is public and is being 'tunneled' to your Pi.

Also, more about it on this Twilio blog: https://www.twilio.com/blog/2013/10/test-your-webhooks-locally-with-ngrok.html

Upvotes: 2

Related Questions