Closed eskandari closed 5 years ago
Under the device explorer, find the ~unauthorized~ unassociated devices
and associate the device.
Tnx for promot response. I navigated to the device explorer, select raspberry pi, but I can't find the unauthorized devices.
Please see the attachment.
there is no device under unassociated devices please see below
should I open a new issue with more descriptions?
Can you browse into that device’s panel and click open to ‘connect’ button up-right and use the creds there?
I’ve deleted your last share that includes device creds. Could you try the info there to authenticate?
In other words, your mistake is ... using device key as if it is a master key. Use the creds there directly to create a connection string
I just followed the documentation. here is the link: https://www.npmjs.com/package/dps-keygen
first i used below to get the device key:
dps-keygen <Primary/Secondary_Key(GroupSAS)>
then after getting the device key, then I used below to get connection string: dps-keygen device key device_id scope_id
Not sure where is my mistake.
Sorry for the confusion. The first command is used for account master key to create device authentication keys. Since you were already using an auth. key from device window, there is no need to execute the first command.
You can find your master key under admin settings.
I appreciate if you check and confirm this works for you
Side question; what environment you are working on? I’m trying to understand the reason for using connection string
so if I understand correctly, i should use below: dps-keygen masterKey device_id scope_id getting the masterKey from: Administration => Device Connection => Primary key
Even with this I am getting the same error code.
I am running "dps-keygen" on my surface pro, once I have the connection string, i would push it to c# code and publish and push it to my raspberry pi which running rasbien.
appreciate your patience.
it's dps-keygen <device key> <device id> <scope_id>
So, you shouldn't use your master key and you shouldn't call the first command that doesn't require the scope id.
dps-keygen 2YNErCL.............GSbfP8h8= 87f4d9a8-3b.........461a7869d 0ne00043291
this worked for me
dps-keygen
thanks for your help. I think info here is confusing:https://www.npmjs.com/package/dps-keygen
Glad you got it working now.
@sandeeppujar FYI. I’m open for documentation suggestions and contribution
Here is how I call it:
first generate device key: dps-keygen 2......deleted....= 87f4d9a8-3b71-41a7-94f5-3e7461a7869d
Azure IoT DPS Symetric Key Generator v0.2.1 MASTER-KEY: 2YNErCL....deleted....= BASE-DEVICE-ID: 87f4d9a8-3b71-41a7-94f5-3e7461a7869d
please find the device key below. M5UWhqRBmUl.....BOt2PtHnT0stYfYBo=
then for getting the connection string I am getting below error:
dps-keygen M5UWhqRBmUleZsb7w4CKOJh2fSBOt2PtHnT0stYf.....= 87f4d9a8-3b71-41a7-94f5-3e7461a7869d 0ne00043291
Azure IoT DPS Symetric Key Generator v0.2.1 MASTER-KEY: M5UWhqRBmUleZsb7w4CKOJh2fSBOt2PtHn.....= BASE-DEVICE-ID: 87f4d9a8-3b71-41a7-94f5-3e7461a7869d { errorCode: 401000, trackingId: '0a65127b-2c0a-4112-8fa2-eff426cb6b5e', message: 'Unauthorized', timestampUtc: '2019-02-02T23:06:34.4415072Z' }