how to create mqtt topics for devices in aws iot by cmd - aws-iot

I'm creating a script to automate the creation of certificates for my devices on aws iot, and I would like to know if it's possible to create an mqtt topic via cmd to send messages without needing the aws interface.

Related

AWS DUPLICATE_CLIENT_ID

I have a Jetson, set up as core device. It has greengrass installed on it (inc. deployments, components etc)
I want to set up an AWS SSH tunnel, installed and configured the aws-iot-device-client, but it gets disconnected. In the AWS console at MQTT Test I get the error message DUPLICATE_CLIENT_ID.
Any thoughts or ideas are highly appreciated.
If you are using AWS IoT Greengrass V2, you can deploy the AWS-provided Secure Tunneling component to install and configure the AWS IoT Device Client for you, so you can create SSH tunnels. This component uses the Greengrass nucleus' MQTT connections, so it avoids the duplicate ID error.

Difference between AWS IoT Device SDKs and AWS IoT Device Client

I am learning the way to use AWS and searching to understand the Difference between AWS IoT Device SDKs and AWS IoT Device Client.
Finally, I want to use Raspberry Pi for Telemetry, but which set of tools should I use AWS IoT Device SDKs OR AWS IoT Device Client.
Since you are working with Raspberry Pi, I would recommend you to use AWS IOT Device sdk. Specifically AWS IOT Device SDK for Python or Nodejs. Further using AWS IOT Device SDK :
Register Thing in AWS IOT Console
Register Certificates and Download them
Copy over Certificates to Raspberry PI
Use Sample Application provided in AWS IOT SDK GitHub and connect to AWS IOT and start publishing messages.
Here is the helpful repo to get you started : https://github.com/aws/aws-iot-device-sdk-python
AWS IoT Device Client looks like a complete software running on Linux (according to AWS description). AWS IoT Device SDKs on the other hand are libraries that allows you to connect your devices to AWS-IOT through mqtt and websockets protocol.
I personally would go with the classic SDKs approach for the reason that not enough information other than AWS Docs are available for Device Client so far
You can use the IoT Device client to embed within the Firmware of a Device however AWS IOT SDK is more of a library for accessing AWS resources programmatically.

how to register device to azure iot hub from device(with iot client c sdk)

I couldn't connect my iot device to azure iot hub to register device.
I saw some example in node.js and c# sharp client sdk. But I couldn't find for c sdk. Is it possible register device (obtain credential) from client side?
How can I connect my device to iot hub?
I tried to use this code:
https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt.c
Also I used this article for help: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-device-sdk-c-intro
Very important: you don't want a device to create a new identity on its own in IoT Hub as that would mean that the device has credentials to manage the IoT Hub instance. This is a considerable security risk.
This is one of the main reason why we have 2 types of SDKs: service client SDKs and device client SDKs.
The service client SDKs are meant to be used in back-end applications that will manage the Hub, while the device client SDKs are meant to be used on devices. This allows to keep control of your IoT solution and prevent a rogue compromised device to start messing around with the other devices or your data.
You can actually find a C service client SDK in the C SDK repo under the folder "service" if you want to develop a back-end or management application in C.
Now, all that said, what it seems you are actually looking for is for a secure auto-registration mechanism, which is something we don't have yet on Azure IoT Hub. You can actually vote this feature up on uservoice here, as we are using this to help prioritize the upcoming features of the service.

Google replacement for CloudMqtt

We have an IoT project here
Facts:
We have our app running on Google App Engine, PHP runtime.
The clients are raspberry pi or similar boards.
We are using cloudmqtt (www.cloudmqtt.com) to generate a push event on our C client app, which then runs the sync process with the server
Is there a google cloud replacement for what we are doing?
We tried Google Push/Sub, but our C app needed to be polling the service.
We would love to use Google Cloud Messaging but we could not find any way to use it for push notifications for the client.
Basically, we need to send push messages to a raspberry pi, what would you recommend for that? (remember our server is on GAE)
GCM handle polling mechanisms on its own and should let you push notifications as well as messages to the client. Try debugging your application using documentation.
During I/O 2016, they also launched Firebase Cloud Messaging (FCM) which is basically a newer version of GCM, and is the recommended product to use.
But if you wanted to use your deployment rather than a service, you can use Google Compute Engine instances to deploy EMQTTD which is a highly scalable MQTT broker written in Erlang.

Can I Use Google App Engine as XMPP Gateway

I have a Cloud App hosted on Windows Azure and I need to integrate XMPP with the service. Can I use GAE's XMPP API to achieve this? I'll need to be able to create new Jabber IDs and send & receive messages from other clients like GTalk.
As far as I know, GAE only supports Java, Python and my expertise is limited to .NET & C#; so, I'll have to make my Azure App to communicate with the GAE.
Finally, can I use GAE as an alternative to running ejabbered on Windows Azure Virtual Machines or Amazon EC2?
Thanks in advance... :)
You could but it would be very limited. You may be better off running ejabbered somewhere else.
With GAE's XMPP API, your username selection is rather limited. See the GAE XMPP Overview API documentation.
Your Cloud App would need to send and receive messages from your GAE app via HTTP accesses. This is no big deal for sending, but you'll have to work your own way of receiving messages. You could buffer your messages to the datstore and poll for messages. You could use the Channel API to receive messages directly, but so far the Channel API client is only available in Javascript, so your app would need some sort of javascript interpreter to use the client.
You will be able to send/receive messages from other XMPP addresses like GTalk clients.

Resources