Azure IoT Edge as a translation gateway for TCP/IP based OBD-II device [closed] - azure-iot-hub

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
We want to use Azure IoT Edge as an identity translation gateway with the protocol translation gateway. Because we are working with an OBD-II device that strictly uses TCP/IP as communication protocol. We can only add IP, PORT, and APN in the device nothing else.
We want to use these devices with the Azure IoT Hub. As we know Azure IoT hub works only with MQTT, AMQP, and HTTPS.
We want to use Identity translation for:
Creating IDs for these lots of devices from the IoT edge and register them in IoT Hub.
If possible, we want to automatically make the device to Azure IoT Hub communication via IoT Edge.
We want to use protocol translation for:
Acting as a medium to communicate between the Devices working on the TCP/IP and the Azure IoT Hub, which supports MQTT, AMQP, and HTTPS communication protocol.
We want to have a Bi-directional communication with the Azure IoT cloud. So we can send messages back to the devices when needed and do FOTA.
My Questions:
Is there a module available for the TCP/IP implementation in this sample?
Can this repository be used for production-level implementation for the above?
Is there any full detailed documentation like this sample for implementing the actual asked for production level?
Does this Implementation way provide two-way communication? Device to edge to cloud and then Cloud to edge to the device?
Is this identity translation gateway in development and is actually not fully blown for the production purpose?
Is there any working example or a full developer guide for Implementing Azure IoT Edge gateway as an Identity translation gateway with protocol translation gateway?

IoT Edge as a translation gateway (protocol translation and identity translation) is only supported by third-party modules. That custom or third-party module will be responsible for pre-processing the incoming messages and turn them into a format that can be understood by IoT Hub.
The IoT Edge runtime does not include protocol or identity translation
capabilities. These patterns requires custom or third-party modules
that are often specific to the hardware and protocol used. Azure
Marketplace contains several protocol translation modules to choose
from. For a sample that uses the identity translation pattern, see
Azure IoT Edge LoRaWAN Starter Kit.
Ref: Device capabilities behind translation gateways
There is a full developer guide and best practices for implementing Azure IoT Edge as a transparent gateway in the following doc: Connect a downstream IoT Edge device to an Azure IoT Edge gateway
Like mentioned in the github repo you are referring to Azure IoT Edge Identity Translation Lite: Sample on implementing Identity Translation at the edge , that is a:
'lite' implementation of the Identity Translation pattern as it only
supports the basic identity translation flows based on symmetric keys
Leverage github issues section and suggest pull requests there with your implementation - that sample started being implemented by Microsoft Engineers though it is not officially supported by IoT Edge runtime.

Related

Azure webhook triggers a IoT Hub

I want to make a webhook that can be triggered by either get/post and triggers connected IoT devices to a WebSocket.
So, I thought Azure might help to automize this process, instead of writing everything from scratch and run it on a webserver.
I am very new in the Azure world, I found it very complicated to make it working on Azure.
Can you point me to any simple to make it work?
The first thing to do is to decide where you want to connect your devices to. Generally, you'll either use Azure IoT Hub or IoT Central (which uses an IoT Hub anyway). Your question doesn't include any details about your devices, or whether you're developing them yourself, but I'll assume you can connect to either.
If you go for Azure IoT Central, the easiest way to get a webhook going is to create a Logic App and link nodes together to trigger a Command to your device. You can use an HTTP request as the trigger, and use the built-in IoT Central node to trigger your command, example:
If you end up connecting your devices to IoT Hub, you can use Direct Methods, Cloud to Device messages or even Device Twins to communicate with your devices. You can leverage these by creating an Azure Function with an HTTP trigger, and you program the logic to call IoT Hub, which will communicate with your devices. There are a lot of samples on the web that show how to create Functions, or control your device remotely.
There are a lot of ways to go about your scenario, if you need some help from the Microsoft community, you can get a lot of help on Microsoft Q&A.
Update based on the comments:
In this case, the devices are connected to IoT Hub. You can use the Service SDK to run a job that fires a Direct Method to all currently connected devices. This doc describes the process.

Azure IoT Hub Device Identity requirements

I need to connect some sensors to an Azure IoT Edge Runtime via MQTT.
I read here:How an IoT Edge device can be used as a gateway , that in the "Transparent" Pattern, devices who hold their own IoT Hub device identity can communicate directly with Azure IoT Edge via MQTT.
I am still in the planning phase and don't have the sensors (or Iot Hub devices) at the moment so I couldn't really start testing directly. I wanted to know if all devices/sensors can hold their IoT Hub device identity and if there are any hardware requirements in order to do so?
Thank you very much in advance!
In the transparent gateway case, the requirements for devices / sensors are the same as if the device would connect directly to an IOTHub using its identity. That is, if the device or sensor supports to Azure IOTHub via MQTT, it should work through the transparent gateway. When configuring the device, instead of using a connection string for the Azure IOTHub itself, you'd use a connection string that references the local Edge gateway.
There are 3 basic steps to take in the transparent gateway scenario - the article you linked steps into them, but I'll add in some color for 2 and 3.
Set up the gateway for connectivity from the downstream devices & routing to the upstream IOTHub. This article has good details.
For each device, create an identity in Azure IOTHub, using the device's unique ID (for example, device EUI for a lorawan sensor) as the IOTHub DeviceId, and set up auth per this article. This step is where you determine the Edge gateway connection string.
Connect the downstream device to the gateway device and start sending messages. That's this article. This is obviously dependent on the device itself and the operating code/configs (whether a 3rd party black box type device or something running your own code).

How to connect non-programmable (no SDK) devices to IoT Hub

I am building an IoT solution based on devices that are not programmable (3rd party devices).
I can just configure the server they must connect to and I have the messaging (sending messages and receiving commands).
What is the best way to integrate them in an Azure IoT Solution (IoT Hub) ?
It looks like we can use Azure IoT Edge as Gateway (https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/iot-edge/iot-edge-as-gateway.md) in a "Identity translation" pattern, but I still not figure out how to do it.
I also find Azure IoT Protocol Gateway (https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-protocol-gateway) that seems to do the job but it is not sufficiently clear for me what to do.
Thanks in advance for your help.
The question is which protocols your devices support and how configurable your devices are. For instance you might be able to talk MQTT directly to the IoT Hub without using the SDK: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly-as-a-device
Same is possible for HTTP using the REST API directly: https://learn.microsoft.com/en-us/rest/api/iothub/device
If neither is an option then yes, you need some kind of gateway - like in the examples which you linked.

Why Azure IoTHub is defined as Platform as Service?

I see Azure IoTHub described as Cloud Platform as a Service? could anyone explain why IoTHub is PAAS?
https://azure.microsoft.com/en-in/services/iot-hub/
From the documentation:
Connect, monitor and manage billions of IoT assets—Use Azure IoT Hub to securely connect, monitor and manage billions of devices to develop Internet of Things (IoT) applications. IoT Hub is an open and flexible cloud platform as a service that supports open-source SDKs and multiple protocols.
To provide some context, the following article gives a high level overview of the various Azure IoT services, both PaaS and SaaS: Internet of Things (IoT) technologies and solutions: PaaS and SaaS

Is LoRaWan only accessible with an internet connection?

I'm planning to build an IoT project for an oil palm plantation through the use of an Arduino and an Android Mobile application for my final year project in University. As plantations have low to no communication signals which includes wifi, it is possible to implement LoRaWAN without access to the internet/use/ of a web-based application?
The LoRaWAN node does not need any other communications channel aside from LoRaWAN, of course. Would not make any sense otherwise. ;-)
The gateway however does need a connection to the server application that is to be used as a central instance for your use case. Usually this is an existing LoRaWAN cloud service such as The Things Network (TTN) with your application connected behind, but in theory you could connect the gateway to your very own central, making your whole network independent. This is possible because LoRa uses frequency bands free for use (ISM bands) so anyone can become a „network operator“. The TTN software is available as Open Source, for example.
Connection from the gateway to the central is usually done via existing Ethernet/WiFi infrastructures or mobile internet (3G/4G), whatever suits best.
Besides, the LoRa modules available for Arduinos can be used for a low-level, point-to-point LoRa (not LoRaWAN) connection between two such modules. No gateway here. Maybe that is an option, too, for your use case.
The LoraWAN is using the Gateway connected to some kind of cloud, for example the TTN network which is community based. If you live in a bigger city you have good chances to have a TTN Gateway in your area.
You can however connect two Lora nodes together to get a point to point connection. You can send data from Node1, which is connected to some kind of sensor and batterypowered, to Node2, which is stationary and stores all the data to a flashdrive for example. From this flashdrive you can import the data to a website or you could use an application like Node-Red to display the data on a Dashboard.
Here you will find instructions on how to send Data from one Lora-Node to another.
Here you will find instuctions on how to use Node-Red to display your Lora-Data. You will have to change the input from the TTN-Cloud to a textfile on your Raspberry, or whatever gateway you use. (Optional)