These projects came about because I just wanted to try the Serverless framework. I had been told that it was basically ‘magic’ and made deploying simple services a dream. Couple that with AWS Lambda’s free tier and you end up with infrastructure that doesn’t cost anything while being extremely easy to spin up. Win win!
Cheaper International Calls
Code on Github.
I want to be able to call home (the UK) from trail towns and their surrounding areas without it costing me extensively. Of course in this day and age we have Skype and Whatsapp calls which in all honesty, will probably suffice. However, being able to call using regular calls instead of VoIP means I’ll be able to call home from wider areas with worse reception (I think?). Again, this project was mainly for entertainment rather than actually needing the function!
So, lets get to how this works:
- Send an SMS to a Twilio number that you own (lets call this X) with a phone number with international code as the body of the SMS (lets call this Y)
- Twilio will then call you using X
- You pickup
- Twilio connects the call to Y
Theoretically, this will cost me a bit less than 3¢ per minute (plus $1 a month for the Twilio phone number rental).
Code on Github.
Early last year I backed the Somewear project on Kickstarter. Somewear is a small GPS 2 way communicator that bluetooths to your phone and from an Android/iOS app on there you can message people, send location pins and request weather reports.
Since backing the project Garmin has released the inReach Mini and there’s something else called the Bivystick. I’d probably go for the Garmin now due to it being a trustworthy brand and the fact that startups like Somewear are more likely to go out of business, leaving you with a $350 device that no longer does anything. However, I have the Somewear now and it seems to work well. The app is super simple to use and the connectivity has been pretty good so far so I don’t see myself switching.
Back to the point of this post. I decided that I wanted to try to send short daily updates about the hike instead of trying to write longer form updates in town about the last week or so. It seemed more manageable and I’m thinking it might be more useful for future hikers in the long run. Twitter seems like a good place for this, and it looked pretty simple to tie Somewear to it via SMS.
Basically, Somewear can SMS a US/CA phone number or email any email address (or IM any user of the Somewear app). The easiest solution was to get a Twilio number and tie that to a simple service write that would then post whatever is texted to it to Twitter. Twitter has a text to tweet service but that would require tying Twitter to a Somewear phone number which I didn’t own and which could theoretically change at any time.
The only slight complication I had is that at some point someone sent an SMS to my Twilio number saying “Be at the restaurant at 6.30”. I didn’t realize for about a week and thus had that tweet to my name in the interim. My hacky solution was to require a specific substring in the SMS before posting it.
Thoughts on Serverless
Granted these services are as simple as they come but even so, Serverless was really nice to work with here. Deployment was so so easy and testing was easy enough using the Serverless Mocha Plugin. Those two are often the pain points for me when I’m trying to quickly get something out there and fortunately that wasn’t the case this time. All in all, I highly recommend Serverless if you have ideas like these that you want to spin up ASAP.