简体   繁体   中英

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

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. In the latter case, the devices are correctly registered in the 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

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 :

Add your Cloud IoT Core project info as Firebase config environment variables:

 $ 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 ).

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM