Using Amazon MQ or AWS IoT for self managed IoT Devices - aws-iot

I've tried Amazon MQ today and found out that it is very easy to setup and we can integrate the pub/sub feature on our IoT device side quickly. But unfortunately, when I check the limitations of Amazon MQ, the maximum connection for an instance is only 1000.
The ff screenshot taken from Amazon MQ Docs:
This is too low. And I don't see a quota increase options for that. Plus, I am only allowed to have a maximum of 20 brokers per region, so basically a max of 20k devices only. And to create 20 brokers, the cost is too high as compared to setting up an MQTT broker by myself in an EC2 instance of 8Gb memory and 2CPUs, I can handle up to 50k connections.
Then I saw another option which is to use the AWS IoT for device management. It supports up to 500k devices. But the downside is I have to register all my devices as "Thing", and I have to get certificate for each device. But I really don't need Amazon to manage my devices and keep track of the device's states, we already have it done. Plus, we have to familiarize our self on how devices are managed using the AWS IoT device management console. Therefore, using the AWS IoT service as a message broker is more time consuming to implement than using Amazon MQ.
So, my question is, is Amazon MQ really not designed for IoT devices? Is there anyway to use just the MQTT broker service alone of AWS IoT device management without using its management features(I don't think this is possible)?

Amazon MQ is a cloud managed service for Apache ActiveMQ. One of its aims is to make it easy to migrate an existing product using the protocols that ActiveMQ supports to a cloud managed solution.
So, my question is, is Amazon MQ really not designed for IoT devices?
Your question presumes that there is a black and white answer. Amazon MQ may be entirely suitable for an existing product that needs a managed cloud broker. For another product with different requirements it may not be suitable.
Is there anyway to use just the MQTT broker service alone of AWS IoT device management without using its management features(I don't think this is possible)?
Yes, it is possible to use the AWS IoT broker without using the 'thing' management features. From https://docs.aws.amazon.com/iot/latest/developerguide/iot-thing-management.html
You do not need to create a thing in the registry to connect a device to AWS IoT.
You can connect a client device to the AWS IoT MQTT broker using just a certificate without creating a thing. Though typically each device has its own certificate and the thing registry is a means to manage the relationship between a device and a certificate.
There are also alternate means for clients to authenticate.

As of now Amazon proposes managed RabbitMQ, where there are no fixed limits on the number of connections (it just depends on the size of your machines):
EDIT: they don't support the mqtt plugin for the moment, so this will do for AMQP, but not for MQTT.

Related

Connecting a mobile device to IOT system in a home

I am interested in building a device that will be connected to my home network and I will be able to control remotely via an app on my cell phone.
My original thought is this:
Both systems will pull data from some cloud service
My mobile device will modify a data entry in the cloud service
The device will be constantly pulling this data and update the necessary setting when they change
Concerns with the original thought:
Constant pulling of the device in order to see when data has been changed (inefficient)
No way to communicate from the device to the phone (feature limiting)
Question:
What is the best way to create the link between my mobile device and the device that will remain in my home?
Potential similar architectures include Nest, Ring, etc.
The concept is correct - typically, IoT devices and mobile apps communicate through the cloud. There are cases when you want to connect your app directly to a device (e.g. through bluetooth, LAN or sometimes even internets), but that is done usually for a specific reason, e.g.:
IP cameras generate a lot of traffic, putting it through a centralized server is very expensive, so cheap home products do P2P from mobile app (centralized served could help you get the IP address for your camera)
TV with phone as remote control. Using cloud service hear would be weird and limiting access to LAN simplifies the setup
In general cases (Next, Ring) you can be pretty sure the IoT devices talk to the cloud, instead of the mobile app directly. It both offer more feature (as the data can be processed in bulk in cloud), but there's also benefits for using the cloud even if it's used only to relay data.
In many cases, you also want to limit traffic (e.g. save batteries or data plan). Two key aspects to be able to do that:
Don't waste time setting up a connection. That means connecting to a stable cloud service (your mobile might not be online) and using optimized network (e.g. LAN with static IP address, NB-IoT or LTE-M)
Choose optimal M2M protocol. Two popular M2M protocols are COAP ("light weight HTTP") and MQTT (a messaging protocol)
Once you've set up how both your device and mobile app can exchange data with the server, it's up to you to design how to use that. Note that there's nothing stopping from the device to also push data to the server - all connection (IoT device <-> cloud <-> mobile app) can use two-way protocols.

Send Telemetry Data to Azure IoT Central Device using HTTP GET Requests

I'm trying to send telemetry to a device in Azure Iot Central, with HTTP GET requests.
I have a legacy iot application, and I am trying to migrate it to Azure IoT Central, so for now I need to synchronize my ongoing Iot Data to Azure IoT Central.
One way I found to do it quickly was to use Logic Apps.
I have successfully created the Iot Central application and Logic Apps configuration, and I also found a way to get device information and update properties, but I'm not finding where to send telemetry data.
Is it possible to do with Logic Apps, or there is another way to send the telemetry?
Any hints will be very useful, thanks!
you should use the REST POST request to send a telemetry data to the IoT Central App.
The following is an example for device1:
Note, that the iothubhostname must be obtained from DPS service and also the Authorization header (sas token) is required.
and the following screen snippet shows the IoT Central App Dashboard:

How to change MQTT hostname for Google Iot Core

I am working on an iot device using google-cloud-iot-core, but i would like to have allow for 3rd party support, so i want to change the host name of the mqtt, how can it be done?
Thanks in advance
If you change that endpoint, then you're no longer talking to IoT Core. It's not configurable, as that's the endpoint to talk to the service.
You can setup your own MQTT server somewhere else (could do it in GCE or GKE with a custom container) and make the hostname whatever you want, and then setup your own broker to take the MQTT payloads and create Pub/Sub messages, or even to act as a forwarding proxy to IoT Core itself I suppose (although security and auth might get a bit odd).
Or you could even just go directly to Pub/Sub. It all just depends on your need.
As I mentioned, changing the hostname for IoT Core (the mqtt.googleapis.com) it means that you aren't using IoT Core any longer. There's no other way to access the communication broker piece of IoT Core to do the Pub/Sub message creation, etc. If you don't use the IoT Core endpoint (hostname) then you'd be on your own for creating the Pub/Sub messages from the IoT device data.

Windows: Connect TI-Launchpad to Amazon Web Services

I'm doing a project in which I am using the TI CC3200 LaunchPad to detect my bedroom's temperature, real-time. I followed all the AWS IOT C SDK to my Windows machine, downloaded the security keys / certificates, and created a new "thing"in my AWS IOT console. However, it's not clear what are the actual steps to run the sample application and truly test the connection of my device to the Amazon cloud.
I'd suggest to not use bare CC3200, at least for the beginning. There are ready to use CC3200 solutions, like MWS (see here ), probably you can find something else. But AFAIK MWS (or even this) is able to connect AWS. Later, then you will understand how it works you can decide either continue to use MWS (etc) or rewrite everything from scratch.

Google App Engine, Amazon EC2 and sockets

As I know the GAE does not support use the raw TCP/IP sockets, i.e. java.net.ServerSocket. Is there any other well known cloud service I can use it? E.g. Amazon EC2?
My client application needs the permanent TCP connection to the server...
Thanks a lot
STeN
Any IaaS provider will allow to do that. IaaS is Infrastracture as a Service, where Amazon EC2 is the most known one. In IaaS you can do all the same things that you could do with a dedicated server. The only difference is that it is using visualization and you can deploy and undeploy servers within minutes. You can find a number of IaaS providers at cloudorado.com .
GAE is PaaS - Platform as a Service. You don't play there with servers at all, you even don't know how many servers is your application using. You just put your app (like war) into the service and it hosts it. The platform will take care of scaling, distributing, etc. But there is an expense - you need to limit yourself, since the application needs to almost stateless (apart from session object). You cannot start your own services, db servers, start threads, etc.
EDIT: It appears now to be possible with GAE Managed VMs: https://cloud.google.com/appengine/docs/managed-vms/
sockets in GAE is a coming soon feature.
I read from here http://code.google.com/p/googleappengine/wiki/SdkForGoReleaseNotes
For now you need to sign up as a trusted tester to use this feature, but I guess this will be available to the public in the future.

Resources