mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-26 01:06:21 +00:00
This application provides a full stack implementation for communicating with the Google IOT Cloud. It leverages the a JWT library to create JSON tokens which are then signed using a RSA or ECDSA private key. The signed token is used to authenticate with the Google IOT cloud servers. Once that is accomplished, the application can subscribe, or publish data at will. Included in the application is a python script that can be used to create RSA/ECDSA certificates and keys. The user will load the certificate for the appropriate device on the Google IOT Cloud. The private key is created by the script and stored in a C structure format that is then consumed by the application. It is important to note that any keys generated from the scripts SHOULD NOT BE STORED publicly. Please refer to the README for more information. Signed-off-by: David Brown <david.brown@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org> |
||
---|---|---|
.. | ||
src | ||
CMakeLists.txt | ||
Kconfig | ||
prj_base.conf | ||
README.rst | ||
sample.yaml |
.. _google-iot-mqtt-sample: Google IOT MQTT Sample ###################### Overview ******** This sample application demonstrates a "full stack" application. This currently is able to - Aquire a DHCPv4 lease. - Connect to an SNTP server and acquire current time - Establish a TLS connection with the Google IOT Cloud servers - Publish data to the Google IOT Cloud - Send/Receive keep alive / pings from cloud server The source code for this sample application can be found at: :file:`samples/net/google_iot_mqtt`. Requirements ************ - Entropy source - Google IOT Cloud account - Google IOT Cloud credentials and required information - Network connectivity Building and Running ******************** This application has been built and tested on the NXP FRDMK64F. RSA or ECDSA certs/keys are required to authenticate to the Google IOT Cloud. The application includes a key creation script. Run the ``create_keys.py`` script in the ``samples/net/google_iot_mqtt/src/private_info/`` directory. Users will also be required to configure the following Kconfig options based on their Google Cloud IOT project: - CLOUD_CLIENT_ID - created from <telemetry>/<region>/registries/<registry name>/devices/<device name> - CLOUD_AUDIENCE - created from telementry without projects on front - CLOUD_SUBSCRIBE_CONFIG - created from /devices/<device name>/config - CLOUD_PUBLISH_TOPIC - created from /devices/<device name>/state See `Google Cloud MQTT Documentation <https://cloud.google.com/iot/docs/how-tos/mqtt-bridge>`_.