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

I can't find the key pair (private and public) on the device #1

Open
qq601654720 opened this issue Aug 11, 2017 · 3 comments
Open

I can't find the key pair (private and public) on the device #1

qq601654720 opened this issue Aug 11, 2017 · 3 comments

Comments

@qq601654720
Copy link

I can't find the key pair (private and public) on the device

@evgkarasev
Copy link

evgkarasev commented Aug 15, 2017

It seems that MQTT connection should be configured first. It uses SharedPreferences to store the connection details, so it could be configured via intent, just take some <DEVICE_ID> that will be registered later:

adb shell am startservice -a com.example.androidthings.sensorhub.mqtt.CONFIGURE -e project_id \
<PROJECT_ID> -e cloud_region <REGION> -e registry_id <REGISTRY_ID> -e device_id \
<DEVICE_ID> com.example.androidthings.sensorhub/.cloud.CloudPublisherService

After that, device could be registered on GCP with taken <DEVICE_ID> and public key certificate.

gcloud beta iot devices create <DEVICE_ID> --project=<PROJECT_ID> --region=<CLOUD_REGION> \
--registry=<REGISTRY_ID> --public-key path=cloud_iot_auth_certificate.pem,type=rs256

The only issue is that the app should be restarted manually as soon configuration is done.

Confirmed. It works like a charm!

@Pedotech
Copy link

Pedotech commented Dec 2, 2017

I too can´t find the key pair!
Sorry I don't understand evgkarasev's instructions: where is the cloud_iot_auth_certificate.pem?
When I run the second set command I get permission denied!
Can you help?

@Pedotech
Copy link

Pedotech commented Dec 2, 2017

Thank you evgkarasev!! The certificate was on the sd! Used it and now it's OK

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

3 participants