Google Cloud Platform IoT Device Simulator
The following GCP components/services are involved:
- Compute Engine (
f1-micromachine type) - IoT Core service
- PubSub service
- GCP user account with necessary permissions
gcloudcommand installed and properly configured
Open a terminal at the project root:
-
Set environment variables in
.envfile (see.env.example). -
Run
./gcp-init.sh --confirmto perform GCP infrastructure initial setup. -
Run
./create-iot-device.shwith optional device ID argument, e.g.:$ ./create-iot-device.sh my-deviceby default
GCP_DEVICE_IDvalue from.envfile is used. -
Run
./run-iot-device.shwith optional device ID argument, e.g.:$ ./run-iot-device.sh -d my-deviceby default
GCP_DEVICE_IDvalue from.envfile is used.To be able to run device simulator in a background mode an extra optional argument
-bcan be added:$ ./run-iot-device.sh -d my-device -bYou can run multiple instances of the device with different device ids.
$ ./run-iot-device.sh -d my-device-1 -b $ ./run-iot-device.sh -d my-device-2 -b
- Add ability to run fake iot device in a background
- Use Docker containers to ship python code
- Use API calls instead of using
gcloud(someday) - Create Web application to manage fake iot devices (someday)