title: Getting error while publishing data to GCP IoT core and Pub/Sub using C SDK
body: <p>I am running an example code from Google IoT C SDK which is iot-device-sdk-embedded-c.</p>
  <pre><code>iot-device-sdk-embedded-c/examples/iot_core_mqtt_client
  </code></pre>
  <p>I am running the code using the following commands</p>
  <pre><code>./iot_core_mqtt_client --project_id=project-aura-249003 --device_path=projects/project-aura-249003/locations/asia-east1/registries/Linux_PC/devices/linux_pc --publish_topic=projects/project-aura-249003/topics/Example --publish_message=Hello_world --private_key_filename=./ec_private.pem
  </code></pre>
  <p>I am getting error, below</p>
  <p><code>IoTC Embedded C Client Version: 1.0.2</code>
  <code>connected to mqtt.2030.ltsapis.goog:8883</code>
  <code>publishing msg &quot;H&quot; to topic: &quot;projects/project-aura-249003/topics/Example&quot;</code></p>
  <p><code>connection closed - reason 17 : !</code></p>
  <p>The error means <code>IOTC_CONNECTION_RESET_BY_PEER_ERROR</code></p>
  <p>I found a solution from git where they told to try to change the topic to <code>events</code> or <code>states</code> so i tried with that as well by the same error is coming.</p>
  <p>You can find the SDK <a href="https://github.com/GoogleCloudPlatform/iot-device-sdk-embedded-c" rel="nofollow noreferrer">here</a></p>
  <p>What am i missing here?</p>
  <p>Please help me with this</p>
  <p>Thank you
  Harsha</p>