owntracks / talk

Questions, talk about OwnTracks
32 stars 4 forks source link

Owntracks on Azure IOT Hub #40

Closed fbasson closed 6 years ago

fbasson commented 6 years ago

Hi

Would like to use Owntracks with Azure IOT Hub as the MQTT broker. Any pointers as to setting this up? Tried based on the description of the MS documentation on the link https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support, however no success thus far. The description in this document is adequately misaligned to the Owntracks client configuration to make it difficult to identify the exact information to be used for the host, username and password.

magohl commented 6 years ago

Got the same problem here. I run Android and have tried both with and without websockets.

This is the setup i tried with:

Host: xxxxxxx.azure-devices.net

Username: xxxxxx.azure-devices.net/mysuperdevice/api-version=2016-11-14

Password: SharedAccessSignature sr=xxxxxx.azure-devices.net%2Fdevices%2Fmysuperdevice&sig=pRDBXw7xxxxxxxxxxxxxxjnCNmGXxxxxxxxxNH%2BkKxvE%3D&se=1522139111

Deviceid: mysuperdevice

Error: Connection lost (32109) EOFException

jpmens commented 6 years ago

Be advised that most of us here are not particularly interested in getting these "special" (or should I say "non-standard"?) platforms working. We believe, and that is the reason we created OwnTracks initially, that people should use their own infrastructure, i.e. an MQTT broker under their control, properly secured, etc.

Aside from connection issues, the next problem you're bound to run into are payload formats and the inability of these so-called "IoT" platforms to handle what you want.

Please consider taking the time to set up your own kit. We have spent considerable effort on our Booklet informing of how this can be accomplished, and we believe that is the proper way to use our mobile apps.

magohl commented 6 years ago

We believe, and that is the reason we created OwnTracks initially, that people should use their own infrastructure, i.e. an MQTT broker under their control, properly secured, etc.

Ok, thanks for the information. That was not clear to me from just finding the app followed by googling "Owntracks Azure". I have used the Azure IOT Hub with great success earlier so that is why i defaulted to that - not to mention that i had some free developer credits. :)

I will give Mosquitto a go instead.

simonachmueller commented 1 year ago

I know it's a bit old topic, but I was looking into same setup today and got it working. First of all, here is some documentation about MQTT support in Azure IoT Hub https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly-as-a-device

Then, my particular settings I had to change were: "sub" : false, "pubTopicBase" : "devices//messages/events", "host" : ".azure-devices.net", "ws" : true, "port" : 443,

Username and password regarding documentation, SAS as password as described here https://learn.microsoft.com/en-us/cli/azure/iot/hub?view=azure-cli-latest#az-iot-hub-generate-sas-token