Adakah yang mendapat contoh di quickstart mereka untuk bekerja? Mereka menyediakan kode NodeJS untuk terhubung ke jembatan MQTT mereka, tetapi bagi saya itu tidak berfungsi:
[root@centos7 google-iot-mqtt]# node cloudiot_mqtt_example_nodejs.js \
> --project_id=curious-furnace-181313 \
> --registry_id=my-registry \
> --device_id=mimic1 \
> --private_key_file=./rsa_private.pem \
> --algorithm=RS256
Google Cloud IoT Core MQTT example.
connect { '0': {},
'1':
{ [Function: require]
resolve: [Function: resolve],
main:
Module {
id: '.',
exports: {},
parent: null,
filename: '/home/tmp/uwe/google-iot-mqtt/cloudiot_mqtt_example_nodejs.js',
loaded: true,
children: [Object],
paths: [Object] },
(ribuan garis jejak tumpukan) dan tidak ada aktivitas di dasbor Google IoT Core, atau pesan apa pun dalam langganan tarikan.
Mosquitto_pub mengembalikan kesalahan aneh:
% ./mosquitto_pub -d -h mqtt.googleapis.com -p 8883 -i projects/curious-furnace-181313/locations/us-central1/registries/my-registry/devices/mimic1 -u unused --key ~/mimic/scripts/mqtt/google-iot/rsa_private.pem --cert ~/mimic/scripts/mqtt/google-iot/rsa_cert.pem -t /devices/mimic1/events -m hello --insecure
Client projects/curious-furnace-181313/locations/us-central1/registries/my-registry/devices/mimic1 sending CONNECT
Error: Unrecognised command 16
Error: A network protocol error occurred when communicating with the broker.