I want to send SIM808 GPS data to the Azure IoT hub using MQTT.
As mentioned in docs of azure, I have used the same parameters.
https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly
But it doesn't work. Did not published.
Can we connect to Azure MQTT using Username and password without attaching certificate? if not
How to create the certificate?
How to send SIM808 data to the Azure IoT hub using MQTT?
Suggest me a way to do it with an example.
Thanks!!!
Yes, you can do it. You can use tokens.
As a simplest alternative you may also use flespi telematics hub to reach same goal. Your device can send via HTTP or MQTT messages to flespi channel. And flespi will stream processed information to MS Azure and/or AWS in their specific protocols.
Related
Is there a way to send data to a device in Azure IoT Hub using a shared key without first generating a SAS token? The reason I am trying to do this is because I want to send events via a web hook without writing code for it. The device is connected to our system and we're trying to use our web hooks functionality which can relay an event to a HTTP endpoint with preconfigured headers and format but it can't execute the code to get a temporary SAS token.
Alternatively can I make a SAS token that never expires?
Ended up using Azure IoT Central + the Azure IoT Central Bridge. The IoT Bridge is an Azure function where you put some JS code to convert your message to a format that IoT Central understands and then it deals with the tokens and eventual device registration. This is not an exact answer to the question since IoT Central is not exactly IoT Hub (it is a portal over it) but it turns out it works well enough for our case. Also I think the codebase of the IoT Bridge can be used with the IoT Hub if one wants to dig enough through it. Maybe this solution can serve someone else.
I am working on a simple dashboard for showing IoT data in a browser.
So far, I was using the Paho MQTT client library and a public MQTT broker to receive data. However, I'd like to use the Azure IoT Hub from now on.
The data I'm sending is just simple temperature and humidity values.
I already found out that I can't connect to the IoT Hub via MQTT. So my question is:
Is there a possibility to connect (eg. using javascript) directly to IoT Hub and read the data?
If not, what's my best option?
I thought about saving the messages to an SQL Database and reading from that, but that seems quite complicated for what should be a simple IoT use case (showing real-time data)
Thank you in advance!
You can connect to IoT Hub via MQTT. Please take a look at this documentation for detail. We also have a Node.js SDK for connecting to IoT Hub if you don't want to deal with MQTT directly. I know you are working on your own dashboard, but have you looked at Azure IoT Solutions Accelerator? It's completely open source and you can modify it as you want.
I have some devices that sends their data to my Azure IoT Hub. For now, a Stream analytics job processes the data, but I would also like to "forward" the data stream to an external Mosquitto server. How can I do that? Can I set up the IoT Hub to function as a MQTT Bridge?
Thanks in advance for help! (Sorry, I'm a little new to this...)
One option: You can use Azure Functions to process the incoming data and forward it to your Mosquito server.
I am working on internet of things, in one of my current project I am reading the data from Azure IoT hub in a Windows 10 UWP app, where I am passing my IoT Hub connection string to azure while reading data( using Cloud to Device concept).
Is it secure/fine way or not reading data from a client app.
Thanks,
Pradeep
Yes. The library uses https, however the contents of the message is not encrypted, so if you're super-sceptical, just encrypt it before sending.
Do you know if it is possible to retrieve device-to-cloud messages, with Microsoft Azure and IoT Hub, with a javascript client running in the browser (i.e. no node js) ?
It is my understanding that this is not currently possible, but I'd like to make sure (i.e. all current APIs can only work server side).
Edit1: REST APIs might be the obvious choice to attempt to do this; However, having tried these APIs via manual request, it seems the response does not provide the allow-access-control-origin header, so I can't call them from ajax due to CORS.
UPDATE: The example code was removed by requirement from Azure IoT Hub team, and they do not like users to connect to IoT Hub from browsers (https://github.com/Azure/azure-iot-sdk-node/issues/112#issuecomment-338073636).
Sorry for the broken links in this answer.
It seems this is an old question, however, I find there is still nobody can give the right answer.
In short, is there a way to read IoT Hub D2C messages in browser? The answer is absolute YES!
You shouldn't use RESTful API to loop checking messages, but use AMQP over WebSockets.
Before you start, you must know that IoT Hub has two sides, Device side and Service side. For Device side, you connect to IoT Hub using HTTP, AMQP and MQTT, however, for Service side you can ONLY connect to IoT Hub using AMQP.
Fortunately, Red Hat had already written a AMQP over WebSockets Node module, and you can do some simple work to make it working in browser.
You can learn more about the AMQP Node module from https://github.com/grs/rhea.
Also, we've made a web based tool for receiving D2C messages https://iotdevtool.com/service/, you can learn more about it from https://blogs.msdn.microsoft.com/zhiqing/2017/03/16/connect-to-azure-event-hub-in-browser-using-amqp-over-websockets/.
I haven't tried it myself but my understanding is that it's possible to retrieve cloud-to-device messages in JavaScript using the IoT Hub REST API.