Send Telemetry Data to Azure IoT Central Device using HTTP GET Requests - azure-logic-apps

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:

Related

Using Amazon MQ or AWS IoT for self managed IoT Devices

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.

See Firebase network traffic in debug purpose

I want to be able to debug the firebase analytics using Charles Proxy. I don't have access to the source code and can therefore not enable the debug view in Firebase.
I want to track the network traffic to be able to see what events that is sent within my app using Charles proxy for Firebase Analytics data. I have tried to set up an SSL connection using Charles proxy but can't see the Firebase Analytics traffic from my app.
The purpose of this is since I don't have access to source code in the app and can't thereby enable debugView.
I want to be able to see the network traffic from my app that is sent to Firebase Analytics. The same principal as you can do for Google Analytics data.

How to susbcribe to a telemetry events using MQTT and using C code?

How to susbcribe to a telemetry events using MQTT and using C code? (this is a microcontroller code)
I can send data to a specified topic but when I trying to subscribe to this topic I got error message
This is the message from the log
"mqttTopic": "/devices/my-device/events/my_telem_topic1",
This is the error message from the log
"message": "SUBSCRIBE: Failed to subscribe to topic: '/devices/my-device/events/my_telem_topic1'."
To add to what Kamal posted:
Part of the confusion here is that both MQTT and Pub/Sub (where IoT Core puts your device's telemetry events) are called "topics".
There are 4 MQTT topics for devices to work with (this is all on device side, not Cloud side):
/devices/<device-id>/commands
/devices/<device-id>/config
/devices/<device-id>/state
/devices/<device-id>/events
The first two are there for devices to subscribe to in order to get updates from the IoT Core Admin SDK, the latter two are topics for device to publish data to the Cloud.
In order for a device to subscribe to another device's telemetry, it would need to be able to subscribe to the Pub/Sub topic that's receiving telemetry from the other device. This won't be done as part of the MQTT implementation, but rather, you'd need to implement the Pub/Sub API on your device. This is going to require a separate authentication path as well, likely a service account key that you add to your GCP project, then download to your device. The links in Kamal's answer should get you started if you want to go down that route.
Depending on what you're doing however, as they say, you can probably process the incoming telemetry from one device in a Cloud Function or similar, then set a config for the device that wants to be responsive to that telemetry. That way, if the device is online, it'll get it right away, or if it's not online, it'll get it upon reconnecting to IoT Core.
Telemetry events sent to Cloud IoT are sent to a Cloud Pub/Sub topic that is configured when the device registry is created and are not intended to be retrieved via MQTT on devices. One could use any of the mechanisms available in Google Cloud to subscribe to these messages (Cloud Functions, Cloud Dataflow, or a custom-written subscriber). Commands can be received by devices via MQTT. The topic for a device's commands is /devices/{device-id}/commands/#. APIs are available to send commands to devices.
One would generally send telemetry events from devices, analyze them with one of the aforementioned Cloud products, and then possibly generate commands to devices based on the results of that analysis.

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.

Call Google Glass Mirror API using service account

I need to create a (demo) application for Google Glass with a simple user interaction: insert a card on Glass and get a response back to the application.
I think this can be done by using the Mirror API.
This application is not a web application so I think I need to use a service account.
I have created an API project on the Google APIs console https://code.google.com/apis/console/ and enabled the Google Mirror API.
After that I created a new client ID with application type "service account" (calls Google APIs on behalf of your application instead of an end-user; more info at https://developers.google.com/accounts/docs/OAuth2#serviceaccount).
The result is a client id, email address and public key fingerprint and a P12 key with password.
The problem is that I cannot find an example how to do the service account authentication and for example a card insert.
Any ideas? The used programming language is less important...
See also Can I use OAUTH2 Service Accounts with Glass Mirror API? but unfortunately without an answer.
Edit:
From the answer below I understand I cannot use the service account for this.
Is it then correct that I always need a web application where Google Glass has a callback url so data can be send from Glass to the application?
We develop a Warehouse Management System where the operator in the warehouse uses a voice client (like http://www.epf-gmbh.de/bilderorg/talkman_joe.jpg) that communicates with the server. The server sends commands to the client and the operator can send voice commands back to the server.
For demo purposes I would like to replace the voice client with Google Glass.
Edit 2:
Something like this: http://youtu.be/kbcskj4yAvo
You cannot do timeline operations with a service account. Most Mirror API operations (on the Timeline, Contacts, and Subscriptions) require a user's account since these operations must be done on behalf of the user in order to correctly identify which Glass will be used.
Update:
Your followup questions don't exactly relate to the authentication question, and they may be better asked in a new question, but two quick points:
Yes, when working with the Mirror API if you want to get information from Glass into your server you'll need a webapp which can take callbacks. You'll be registering this as part of a Subscription.
The example you pointed at uses the GDK, not the Mirror API.

Resources