IoT Kitteh was inspired by a discussion with a coworker about IoT and silly ideas as we watched a quad-copter drone crash into our office parking lot. Long story short I decided I wanted to connect my cat Lily to AWS IoT so I could get her GPS coordinates and I decided to include cellular phone call capabilities simply because a cell modem on a cat makes me laugh. In talking with my coworker about this he said it would be awesome to call the cat but I told him that's a ridiculous idea because how in the world would the cat answer the phone call. Instead I would push a message over AWS IoT to the device and have it initiate a phone call to my cell phone, thus avoiding the problem of trying to train a cat to answer the phone.
I started by soldering the FONA 808 modem to it's pin strip for use on my breadboard. I then connected the USB to TTL Serial Cable to one of the Raspberry Pi's USB ports and connected the wires to the modem in the following manner:
- USB to TTL Serial Cable's black wire to the FONA 808's Ground pin
- USB to TTL Serial Cable's red wire to the FONA 808's Vio pin
- USB to TTL Serial Cable's green wire to the FONA 808's Rx pin
- USB to TTL Serial Cable's orange wire to the FONA 808's Tx pin
- Connect the FONA 808's Ground pin to the FONA 808's Key pin
After my Pi was up and running on my wifi network I installed Node Version Manager (NVM) because it's awesome and makes life easier when it comes to managing and versioning multiple installations of Node.js. There's a great walk though on installing NVM and Node.js at this page:
For setting up the AWS IoT Thing, certificates, security roles, and a DynamoDB table to log the messages I'll leave you to the detailed AWS tutorial at:
Once I had the x509 certificate files created I copied them to the Raspberry Pi at /home/pi/AWSCerts. These files will be referenced in my Node.js application code so I can connect to the AWS IoT service.
The next step was to write the iot-kitteh application. I've made the code available on GitHub at:
If you clone the repository be sure to call the following command to download the dependencies:
Once the dependencies are downloaded and ready you can run the application by calling:
Now to drive the Node.js code I used the MQTTT.fx application on my laptop to connect to the AWS IoT service to send JSON formatted commands to the Raspberry Pi that instructed it to make phone calls or acquire GPS information. These commands are documented at the project's GitHub page. The MQTT.fx application is available at:
You can use the same x509 certificates to connect MQTT.fx to the AWS IoT service like you do with the Node.js application on the Raspberry Pi. Information about configuring and using MQTT.fx is also covered in the Quick Start Guide I mentioned above for getting started with AWS IoT so there's no need to list all the steps here.
After getting everything pulled together it was time for a field test. I used some small cardboard boxes to protect the Raspberry Pi and modem hardware from incidental damage and attached everything to a small harness vest I have for Lily the cat.And then it was time to put the vest on Lily and take it all for a spin.
And here's a video showing that I could request GPS information from my laptop using the MQTT.fx client and also initiate phone calls from Lily the cat to my cell phone.