AWS IoT: Possible to connect mobile devices - amazon-web-services

Is it possible to programmatically connect a mobile device to IoT in AWS?
Would the end-user need to do any configuration on their side for this to work?

It depends on the type of device that you have in hand. The device must have a device certificate, private key, and root CA certificate installed for communicating with AWS IoT Core.
There is a SDK that can help you programatically. The AWS IoT Device SDKs help you to connect your devices to AWS IoT. Here is a list of SDKs based on the platform that you are using.
Here is a good link for reference establishing connection with AWS IoT core service

Related

Common IoT connectivity to GCP, AWS, Azure, etc

I've to extend an existing product based on ARM-Cortex M0 and M4 micro-controller (No RTOS-bare metal event loop) to enable IoT capabilities.
I'm using W5500 Hardwired TCP/IP embedded Ethernet controller to enable internet connection for my micro-controllers.
One of the requirement of the project is that it must have cloud connectivity (using MQTT and/or ReST API) with all major vendors i.e. Google Cloud Platform, Amazon Web Services, Microsoft Azure and optional cloud providers like Linode and Digital Ocean.
The cloud connectivity is decided by client during installation.
As these devices are field configurable, connectivity to all these platforms need to be built-in the devices.
While I was scouring over internet regarding this topic, I found out that GCP have their own set of libraries and so do AWS and Azure.
Google Cloud IoT Device SDK for Embedded C
AWS IoT Device SDK for Embedded C
Azure SDK for Embedded C
I was under assumption that either by using simple MQTT and/or ReST API I would be able to communicate with any cloud service. Is my assumption wrong?
Is their any additional communication mechanism/layer that has been introduced over MQTT or ReST API to communicate with these cloud services that warrant need of such explicit libraries.
What are my options here to interface with all these services?
Can I use GCP MQTT library to communicate with AWS or Azure or vice versa?
Can I use Wiznet IO Library's MQTT client to connect to either of these services.

Retrieve AWS Greengrass v2 "Core device CA certificate" without using cloud discovery?

For Greengrass v2, I cannot find any way to retrieve the Core Device CA certificate. Can't find any method in Console, SDK or API to retreive Core Device CA Certificate either.
I am aware that the client devices receive the specific certificate in response to the cloud discovery however, I am trying to find a way where client devices do not require internet connection.
In case I'll have the certificate, the client devices can use that certificate along with already known Greengrass Core endpoint to authenticate and connect to Greengrass Core device without the need of internet connection.
So the question is, if there is any way to retrieve/download the Core Device CA certificate?
While this is not yet documented in the docs, Greengrass Core device CA certificate can be found at following path in core device:
/greengrass/v2/work/aws.greengrass.clientdevices.Auth/ca.pem
Using this certificate, ip address of core device & port, client device can connect and authenticate with core device.

AWS IoT - How to create a Web Application

I'm new to AWS and web application development.
I have a project where I have a motor and relay connected to a Raspberry Pi 4 Model B.
The Raspberry Pi is to communicate to a web application through AWS IoT to send/receive messages and commands from registered user accounts.
The web application should contain a Sign In page as well as a dashboard.
I wish to also host the web application on the AWS cloud.
I am unsure which of AWS services I should be using and how to use them.
So far, I've only worked out to use AWS IoT Core to communicate between the Raspberry Pi and AWS IoT Core without any web application involved.
Can anyone advise on what services/web framework I might need to know to create a web application that can send/receive commands/messages to/from the Raspberry Pi?
Any advice is much appreciated!
You can use AWS Greengrass service. Install the Greengrass Core on your IOT devices (Raspberry Pi) which will install and include the X.502 certificates required to connect to your AWS Account. once you set up the Greengrass, you can install components from Greengrass V2 onto your device from your AWS Account. Deploy a component which would be able to publish messages on an IOT Core topic as and when required by taking data from sensors. Use MQTT protocol for sending messages to IOT Core. Once you receive the messages in IOT Core you can send them to other AWS Services using IOT Core Rules.

how to connect device to AWS greengrass

I am using MOKOSMART_mkgw1 to collect data and send it to AWS IoT Core.
for that, I need to set the following configurations,
endpoint (aws iot endpoint)
topic (any)
device certificate and private key
root ca.
I was able to connect and send data to aws iot core.
now I want to connect it to aws greengrass device instead of iot core directly.
i have greengrass running, on ip 192.196.1.12 on port 8883 (windows machine).
i download Group CA using basic discovery api. so i used this mqtt settings for device:
broker endpoint (192.168.1.12:8883)
topic (same as registered in subscription in aws iot GG)
device certificate and private key (the device is registered in aws iot GG)
Group CA (downloaded by basic discovery sample application)
but i am still not able to connect to aws gg?
my understanding is aws GG also has a MQTT broker. so by providing a proper authentication and topic, i should be able to connect to it, whether or not I have aws device SDKs or not. am i wrong? what does "basic discovery example" do extra to be able to connect to aws gg ??
I am so sorry for wasting your time if you brainstorm on this question.
the issue was, I was passing a random clientID in MQTT.
instead, I passed "Device Name" as the client ID and it worked.
keep this question here if someone else falls in the same hole.

Is it possible to control my IoT device from outside my private network using Google IoT Cloud services?

Is it possible to control my IoT device from outside of my private network through Google IoT Cloud services. Especially when my IoT devices are offline.
Yes, you would set up a IoT Core Gateway device in addition to registering regular devices.
Assuming you can program your gateway, it would communicate with Cloud IoT Core via MQTT/HTTP. Then, you can use any protocol you want (zigbee, zwave, bluetooth, etc). The gateway device should be able to store private keys/sign JWTs which are used to authenticate itself to IoT Core, so that the devices themselves don't need to.
For more information, I would read the following: https://cloud.google.com/iot/docs/how-tos/gateways/