https://github.com/ianmas-aws/iot-button-emulator
Emulate the AWS IoT Button on a Raspberry Pi with a simple push button using this C++ sample
https://github.com/ianmas-aws/iot-button-emulator
Last synced: 6 months ago
JSON representation
Emulate the AWS IoT Button on a Raspberry Pi with a simple push button using this C++ sample
- Host: GitHub
- URL: https://github.com/ianmas-aws/iot-button-emulator
- Owner: ianmas-aws
- License: other
- Created: 2016-08-31T17:12:24.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-16T15:32:01.000Z (over 9 years ago)
- Last Synced: 2024-04-20T18:01:29.307Z (about 2 years ago)
- Language: C++
- Homepage:
- Size: 1.98 MB
- Stars: 10
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-iot - AWS IoT Button ★ 5 ⧗ 4 - Emulate the AWS IoT Button on a Raspberry Pi with a simple push button using this C++ sample. (Fork / Others)
- awesome_iot - AWS IoT Button ★ 5 ⧗ 4 - Emulate the AWS IoT Button on a Raspberry Pi with a simple push button using this C++ sample. (Fork / Others)
README
# iot-button-emulator
A simple emulator for the AWS IoT Button implemeted in C++ for compilation on the Raspberry Pi.
Quick getting started guide (needs more work) - assumes you have Raspbian Jessie Minimal installed
Downloading and Building WiringPi
* Install git on your Pi with `sudo apt-get install git`
* Clone the wiringPi source repo with `git clone git://git.drogon.net/wiringPi`
* cd wiringPi && ./build
Downloading and Building the AWS IoT SDK for Embedded C
* Install cmake on your Pi with `sudo apt-get install cmake`
* Clone the AWS IoT SDK with `git clone https://github.com/aws/aws-iot-device-sdk-embedded-C`
* `git clone https://github.com/cpputest/cpputest`
* `mv cpputest/* aws-iot-device-sdk-embedded-C/external_libs/CppUTest/ && rm -rf cpputest`
* `wget https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.1.1.zip`
* `unzip mbedtls-mbedtls-2.1.1`
* `mv mbedtls-mbedtls-2.1.1/* aws-iot-device-sdk-embedded-C/external_libs/mbedTLS/ && rm -rf mbedtls-mbedtls-2.1.1`
* `cd aws-iot-device-sdk-embedded-C`
* `make`
This will kick off the build the AWS IoT C SDK on your Raspberry Pi. This takes a while. As the Pi is a British invention, go and make a cup of tea at this point
Setting up the IoT Button Emulator
* Clone this repo in samples/linux/ with the other client samples with `cd samples/linux ; git clone https://github.com/ianmas-aws/iot-button-emulator`
* Set up your thing on the AWS IoT console or use the command line and download your device certificates & public/private keys
* Create a directory called samples/linux/certs
* Put your downloaded device specific certificate, the CA root certificate and public/private keys in samples/linux/certs
* Edit aws_iot_config.h with the correct filenames for your certificates and keys, your device serial number, and your account specific AWS IoT endpoint
* Build with the `make` command. This build the mbedtls library on first build along with the button emulator
* Replicate the wiring setup shown in iot-button-emulator-wiring.jpeg
* run `sudo ./iot-button-emulator` (must be run as root for access to the GPIO)
* subscribe to the iot-button-emulator/+ topic with the AWS IoT Console
Press the connected button and watch the JSON messages flow