1
votes

I am trying to get data into Azure Iot-Hub using a SARA-R410-02B module (NB-IoT) via MQTT or HTTPS. Microsofts MQTT guide for IoT-Hub states that:

  • For the Username field, use {iothubhostname}/{device_id}/?api-version=2018-06-30, where {iothubhostname} is the full CName of the IoT hub.

    For example, if the name of your IoT hub is contoso.azure-devices.net and if the name of your device is MyDevice01, the full Username field should contain: contoso.azure-devices.net/MyDevice01/?api-version=2018-06-30

  • For the Password field, use a SAS token. The format of the SAS token is the same as for both the HTTPS and AMQP protocols:

    SharedAccessSignature sig={signature-string}&se={expiry}&sr={URL-encoded-resourceURI}

This means that the username (and password) will exceed the 30-character limitation that i have on the SARA-R410. Is there any way around this? I have the same limitation when it comes to HTTPS.

I have found that the password limitation can be solved by using x.509 certificates, but the username remain the same.

2

2 Answers

0
votes

If your device is capable of X.509 authentication then it will resolve your password issue but, as you note, it will not resolve your user identity problem. You might try it without the api parameter and see if it will assume a default. That would give you a few characters to play with if it worked.

Failing that, you would need to set up an application to receive the telemetry and forward it to the hub. Such as publish everything to a mosquito server and have an app subscribe to it and forward. Unfortunately adds more administration and points of failure.

0
votes

I´ve tried without the api parameter for the HTTP, and it does not work. I have some problems with coverage, so i still haven't tried with MQTT, but I am guessing that the result will be the same?

I got an answer from u-blox. They say it can be worked around by implementing the MQTT protocol using sockets on the SARA-R410. This seems like the best solution.