我按照 node.js 教程通过 Azure DPS(设备配置服务)@ https://docs.microsoft.com/en-us/azure/iot-dps/quick-create-simulated-device-x509-node注册设备. 对于单个设备注册,它成功了,但是当我尝试通过注册组注册设备时它失败了。我曾经"create_test-cert.js root"
生成我的根证书和
create_test-cert.js verification --ca {rootcertificate_cert
.pem} --key {rootcertificate_key.pem} --nonce {verificationKey}
验证 。我还要used create_test-cert.js device {leafcertificate} {rootcertificate-name}
创建设备证书。最后,我使用 register_x509.js 文件将我的设备注册到 Azure。执行这个文件我有以下错误
azure-iot-provisioning-device:X509Registration registrationId: first +0ms
azure-iot-provisioning-device:PollingStateMachine register called for registrationId "first" +0ms
azure-iot-provisioning-device:PollingStateMachine completed transition from disconnected to sendingRegistrationRequest +0ms
azure-iot-provisioning-device-http:Http submitting PUT for first to /0ne00015676/registrations/first/register?api-version=2017-11-15 +0ms
azure-iot-provisioning-device-http:Http {"registrationId":"first"} +0ms
azure-iot-provisioning-device-http:Http error executing PUT: UnauthorizedError: Error: {"errorCode":401002,"trackingId":"e6b9c185-64c4-4535-8d23-a7625dd3e011","message":"Unauthorized","timestampUtc":"2018-04-23T12:21:56.1390465Z"} +353ms
错误代码“401002 是 IotHubUnauthorizedAccess”
谢谢