-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Username size is too short for Microsoft Azure IoT Hub #3686
Comments
Hi, So as to increase the 32 characters limit for mqtt username/password, you need to change: File: settings.h But this will scramble ALL the internal saved settings. So, you will need to erase all flash and then compile your modified Tasmota version and flash to your device. Sorry, but I don't think this change will be implemented in Tasmota due to backward incompatibility and too much use of memory. Hope this information help you to achieve what you want. |
Adrian,
Thanks for the directions.
Ok, not a problem, I will compile my modified version.
Thanks a lot.
Em seg, 3 de set de 2018 às 21:23, Adrian Scillato <notifications@github.com>
escreveu:
… Hi,
So as to increase the 32 characters limit for mqtt username/password, you
need to change:
File: *settings.h*
Line 209:char mqtt_user[150];
Line 210:char mqtt_pwd[150];
But this will scramble ALL the internal saved settings.
So, you will need to erase all flash and then compile your modified
Tasmota version and flash to your device.
Sorry, but I don't think this change will be implemented in Tasmota due to
backward incompatibility and too much use of memory.
Hope this information help you to achieve what you want.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3686 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB-kx4OYyD6TVRXzSlen5yZSsH2P9kr3ks5uXcflgaJpZM4WYCU6>
.
--
Wagner Bertolini Junior
|
@ascillato2 I have changed the header accordingly:
But, I am still having problems with the password, it is truncating to 99 chars. =/ |
So, memory is not enough. Sorry |
@ascillato I got it. I managed it hardcoding directly the variables..
But after that I realized that Tasmota didn't support TLS and Azure IoT Hub requires that. Thanks by the way! |
I think the characters have been truncated to 100 because of the tmp[100] buffer in HandleSaveSetttings() in xdrv_02_webserver.ino settings.h:
xdrv_02_webserver.ino: HandleSaveSettings() |
@arendst @TBraune I am trying the same thing -- to get it to talk to Azure IoT Hub using a SAS token. When I make one simple change While that change is just defining the size of a variable, there seems to be something else causing an issue. I have tried this with the master branch and the v9.3.1 branch, which has some of the fixes required but still has has the limited mqtt_user and mqtt_pwd set to char[33]. Any help would be appreciated, as we are trying to use the platform, but use it talking to IoT Hub. |
@ksaye you're a bit late to this party! There is a reason why Things have changed massively since 2018. In theory you can have any length you want as long as you stay within the character pool of 699 characters. The ratio is displayed with command |
Story of my life, always late. :) I did not notice that the So I guess (based on https://tasmota.github.io/docs/TLS/) I can just set the "#define USE_MQTT_TLS" in user_config_override.h, compile [Azure requires TLS] and it should work. Thanks for the rapid response. |
@arendst Thanks for the direction and support. I was able to get it to connect with the following settings. Posting info here for others who may have the same issue. Step 1: In user_config_override.h, define:
As you can see below, it is connected and sending messages: There is an issue of 'flattening' the topics, but I will post a separate issue. |
First thanks for the great job.
I am trying to use the MQTT feature with Microsoft Azure IoT Hub that has very specific configurations as described here: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#using-the-mqtt-protocol-directly
I am not having success on sending MQTT packages and I think that the problem is that the username and password are being truncated by the configurations. I took a look at your documentation and you say that the username and password both can have 32 chars, but the IoT hub uses a very large username and password...
for instance:
username: "iothub-brw.azure-devices.net/TH10_01/api-version=2016-11-14"
password: "SharedAccessSignature sr=iothub-brw.azure-devices.net%2Fdevices%2FTH10_01&sig=2############################MDYeLIaiQcso%3D&se=1599999991"
Is it possible to set directly by a command a bigger username/password?
I can see both truncated on this message when using miniterm.py.
I am using a TH10 device, latest firmware (sonoff.bin).
Thanks for your help.
The text was updated successfully, but these errors were encountered: