Search code examples
azureconnectioncloudiotdevkit

IoT DevKit MXChip AZ3166: ERROR: base64_utility.c (ln 201): Invalid length Base64 string


Did you resolve this issue?

When my IoTDevKit is connected to the wifi. It repeats a message no-stop (see below).

I fallowed the step-by-step Microsoft Procedure "GetStarted - Connect IoT DevKit AZ3166 to Azure IoT Hub"

I took the ConnectionString from this command:

az iot hub device-identity show-connection-string --hub-name YourIoTHubName --device-id MyNodeDevice --output table

I tried with the connection located in Iot Device Explorer... and same result.

And i used this connection string format:

HostName={YourIoTHubName}.azure-devices.net;DeviceId=MyNodeDevice;SharedAccessKey={YourSharedAccessKey}

This is the ERROR:

2019-08-28 13:22:04 ERROR: base64_utility.c (ln 201): Invalid length Base64 string! 2019-08-28 13:22:04 ERROR: sastoken.c (ln 217): Unable to decode the key for generating the SAS. 2019-08-28 13:22:04 ERROR: iothub_client_authorization.c (ln 460): Failed creating sas_token 2019-08-28 13:22:04 ERROR: iothubtransport_mqtt_common.c (ln 2169): failure getting sas token from IoTHubClient_Auth_Get_SasToken.

The screen of my IoTDevKit still with the IP Adress and Running... (under that, " > IoT Hub")

Did you have a solution for that? My connection string contains only 112 characters (with the Label "HostName=") And... all worked fine the first day that I tried. The next day... this issue appears.

version

DevKitSDK version: 1.6.2

Mico version: 31620002.049

mbed-os version: 5.4.3

mbed TLS version: 2.15.0

WIFI version: wl0: Sep 10 2014 11:28:46 version 5.90.230.10

MXChipScreen Connected but not working

Error from Putty connected to the MxChip


Solution

  • For anyone else who might run into this issue. I solved it on the current firmware by using this guide (https://microsoft.github.io/azure-iot-developer-kit/docs/use-configuration-mode/) to first get the DevKit into configuration mode and from there I entered the connectionstring with the "set_az_iothub" command in PuTTY.