[英]iot-smart-home-cloud (gcp project) registered devices not appear in the fluter app and in Angular/web
I have this issue open on github for 10 days: https://github.com/GoogleCloudPlatform/iot-smart-home-cloud/issues/20我在 github 上打开了这个问题 10 天: https : //github.com/GoogleCloudPlatform/iot-smart-home-cloud/issues/20
I can see the devices registered in the firestore(look photo below), but they do not appear on the mobile screen or in the Angular/web application.我可以看到在 firestore 中注册的设备(看下面的照片),但它们没有出现在移动屏幕或 Angular/Web 应用程序中。 In the latter case, the devices are correctly registered in the GCP/Cloud Iot Core Api/PubSub.
在后一种情况下,设备已在 GCP/Cloud Iot Core Api/PubSub 中正确注册。
I already registered 1 device using the tutorial below, which also does not appear http://nilhcem.com/iot/cloud-iot-core-with-the-esp32-and-arduino我已经使用下面的教程注册了 1 个设备,它也没有出现http://nilhcem.com/iot/cloud-iot-core-with-the-esp32-and-arduino
How to solve?怎么解决?
Even though the error message in the screenshots mentions an issue with the authentication, the real error message was the "Device Not Found".尽管屏幕截图中的错误消息提到了身份验证问题,但真正的错误消息是“找不到设备”。
The issue was that the code was looking for a specific registry-device that didn't exist due to a mismatch in the registry name.问题是代码正在寻找由于注册表名称不匹配而不存在的特定注册表设备。
For reference, the configuration of the iot settings in firebase is mentioned in the step 3 of the quickstart :作为参考, 快速入门的第3步中提到了firebase中iot设置的配置:
Add your Cloud IoT Core project info as Firebase config environment variables:
将您的 Cloud IoT Core 项目信息添加为 Firebase 配置环境变量:
$ firebase functions:config:set \\ cloudiot.region=$REGION \\ cloudiot.registry=$REGISTRY
The Device Manager sample app you are working with registers the data scanned from a device QR code to the pending
Firestore collection until until the backend can establish that the data provided matches an existing valid device in Cloud IoT Core (see the relevant code ).您正在使用的设备管理器示例应用将从设备 QR 码扫描的数据注册到
pending
Firestore 集合,直到后端可以确定所提供的数据与 Cloud IoT Core 中的现有有效设备相匹配(请参阅相关代码)。
If you are able to successfully register a device to pending
but it's never removed from that collection, then the issue is in that code path somewhere.如果您能够成功将设备注册为
pending
设备,但它从未从该集合中删除,则问题出在该代码路径中的某处。 The cloud function logs should provide some insight into why your code is failing there (eg invalid credentials, bad configuration, etc.)云函数日志应该提供一些关于你的代码在那里失败的原因(例如无效的凭据、错误的配置等)
You might also find this blog post helpful, which overviews the architecture of the sample code's use case.您可能还会发现这篇博文很有帮助,它概述了示例代码用例的架构。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.