Description
thsq-jetstream
is a tool for connecting a Thingsquare IoT system to a third-party IoT cloud, such as AWS IoT or Microsoft Azure. It can also be used to post data to any REST API that supports an HTTPS POST endpoint.
Installation
sudo npm install -g thsq-jetstream
Basic usage
See help for how to set up data selection filters:
thsq-jetstream -h
Quickstart
Output s.p
data to console instead of to a cloud service:
thsq-jetstream -u <thingsquare user token> --dryrun --filter s.p
Using thsq-jetstream to publish to AWS IoT
Below are instructions for getting started with publishing data to an AWS IoT device.
Components
thsq-jetstream
- AWS IoT connection details including connection string using symmetric key, see:
https://console.aws.amazon.com/iot/
Quick start
Send s.p
data to AWS IoT:
thsq-jetstream -u <thingsquare user token> --awsclient=<connectionstring> --filter s.p
Subscribe to the MQTT topic topic
on the AWS IoT website (Act > Test
) to see data posted in real-time.
Using thsq-jetstream to publish to Microsoft Azure Storage
Below are instructions for getting started with publishing data to Microsoft Azure Storage.
Components
Quickstart
Send s.p
data to Azure Storage:
$ thsq-jetstream -u <thingsquare user token> --azurestorage=<connectionstring> --azuretable=<tablename> --filter s.p
You can use the Microsoft Azure Storage Explorer
application to view and inspect posted data.
Using thsq-jetstream to publish data and synchronize device identities to Microsoft Azure IoT Hub
Below are instructions for getting started with publishing device data and replicating device identities to Microsoft IoT Hub.
Components
thsq-jetstream
- Microsoft Azure account: https://portal.azure.com/
- Azure IoT Hub connection string with iothubowner permissions
- Azure IoT Hub Event Hub-compatible endpoint with iothubowner permissions (must route TwinChangeEvents to events)
Quickstart
Publish to Azure IoT Hub:
$ thsq-jetstream -u <thingsquare user token> --azureiot=<connectionstring> --azureendpoint=<endpoint> --filter s.p
Using thsq-jetstream to publish to REST API
Below are instructions for getting started with publishing data to a HTTPS POST REST API.
Components
thsq-jetstream
- REST API URL
Quickstart
Send s.p
data to an HTTPS POST REST API:
$ thsq-jetstream -u <thingsquare user token> --rest=<resturl> --filter s.p
You can test the REST functionality using publicly available REST API services such as https://httpbin.org/post
.