Help wanted for running samples from C++ IoT Device SDK

0

Hi everyone, I created a thing by following the "Onboard" wizard and downloaded the Python SDK, and can run the basicPubSub example successfully.
But I cannot successfully run the pub-sub-sample from the C++ Iot Device SDK (https://github.com/aws/aws-iot-device-sdk-cpp) . I am using the same certificates and client private keys as in the Python SDK, and I got a time out error like this

The MQTT request timed out : SDK Code -703.

when the program tries to connect to AWS at this line : https://github.com/aws/aws-iot-device-sdk-cpp/blob/dab39e33abad342e51476cde85d35613159203c5/samples/PubSub/PubSub.cpp#L245

I attached the contents of my SampleConfig.json below. Can someone please tell me what i am missing here? Many thanks!

{
  "endpoint": "a290wgkilk3d91w8-ats.iot.us-west-2.amazonaws.com",
  "mqtt_port": 8883,
  "https_port": 443,
  "greengrass_discovery_port": 8443,
  "root_ca_relative_path": "certs/root-CA.crt",
  "device_certificate_relative_path": "certs/TestThing001.cert.pem",
  "device_private_key_relative_path": "certs/TestThing001.private.key",
  "tls_handshake_timeout_msecs": 60000,
  "tls_read_timeout_msecs": 2000,
  "tls_write_timeout_msecs": 2000,
  "aws_region": "us-west-2",
  "aws_access_key_id": "",
  "aws_secret_access_key": "",
  "aws_session_token": "",
  "client_id": "basicPubSub",
  "thing_name": "TestThing001",
  "is_clean_session": true,
  "mqtt_command_timeout_msecs": 20000,
  "keepalive_interval_secs": 600,
  "minimum_reconnect_interval_secs": 1,
  "maximum_reconnect_interval_secs": 128,
  "maximum_acks_to_wait_for": 32,
  "action_processing_rate_hz": 5,
  "maximum_outgoing_action_queue_length": 32,
  "discover_action_timeout_msecs": 300000
}

Edited by: newbie2020 on Apr 22, 2019 12:15 PM

asked 5 years ago531 views
1 Answer
0

I think I can answer the question myself. It is due to clien-id mismatch.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions