So every year around this time ie. the holidays, I’ll embark on a coding (more like “hacking”) spree and one of the on-going projects has been to build a simple telemetry (or what I called “App Beaconing”) system. I started with using Splunk (ie. beaconing to a Splunk server) and got a little frustrated with the whole process of finding a cheap Splunk instance to host it on (lol).
So last year (yeah, talk about *late* documentation! The code *is* on github tho), I decided to keep it simple and just implement a simple REST API on a LAMP stack and host it on Digital Ocean. Oh gosh I so love Digital Ocean! The best thing about DO is that it is just great for hobbyists cos unlike AWS (you practically sign your life away once you give them your credit card. It makes Amazon *really* rich tho) you can control your spend. Just prepay a fixed amount eg. $100 and once you hit that limit you know you have overspent or not (and it’s probably time to do some spring cleaning). You don’t clock up bills of like thousands of dollars (which happens a fair bit on AWS, so I’ve heard).
OK, enough with the bullcrap. Here is the github repo: https://github.com/foohm71/DeviceBigBrother
The README.md is pretty descriptive. This is fairly old code and not updated so you’ll have to do your own updating (sorry!). There are 3 main folders:
- LAMP – this is where the server code resides. There are PHP scripts and MySQL scripts there for set up.
- iOS – this is code for the iOS app for beaconing the device location etc
- Android – ditto for Android app
So what’s with the “hash” thingy? Well the code and server uses a shared secret to generate a HTTP Authorization header so that you know the POST is legit. (I’m too cheap to go with HTTPS).