Skip to content
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

mqtt failed, rc=-2 on MKR1010 #10

Open
4lenz1 opened this issue Aug 29, 2020 · 1 comment
Open

mqtt failed, rc=-2 on MKR1010 #10

4lenz1 opened this issue Aug 29, 2020 · 1 comment

Comments

@4lenz1
Copy link

4lenz1 commented Aug 29, 2020

Hi thanks for the amazing guideline
I've read #2 and #3 but still facing rc=-2 problem as below

16:48:04.885 -> Getting the time from time service:
16:48:04.920 -> Current time: 29. August 2020 - Saturday 07:48:05
16:48:04.955 -> Getting IoT Hub host from Azure IoT DPS
16:48:15.020 -> Starting IoT Hub connection
16:48:25.205 -> ---> mqtt failed, rc=-2
16:48:37.233 -> ---> mqtt failed, rc=-2
16:48:49.262 -> ---> mqtt failed, rc=-2
16:49:01.284 -> ---> mqtt failed, rc=-2
.
.
.

And I did not get couldn't connect to DPS error message like this post , anyone know how should I fix this problem ?

@ehenneberg
Copy link

ehenneberg commented Oct 27, 2020

Hi , thanks for the suggestions in #2 and #3 , they worked for me, except iotc_scopeId is name for oithubHost in configure.h .

So at line# 316 in mkr10x0iotc.ino I commented out these 3 lines and added iothubHost = iotc_scopeId;

// char hostName[64] = {0};
// getHubHostName((char*)iotc_scopeId, (char*)iotc_deviceId, (char*)iotc_deviceKey, hostName);
// iothubHost = hostName;
iothubHost = iotc_scopeId;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants