question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

connection between iot edge gateway and iothub device

See original GitHub issue

hi, i installed the certificate in my iotedge gateway , and when i type qn OpenSSl co;;and i got this .

pi@iotedgegateway:~ $ openssl s_client -connect port:8883 -CAfile /home/pi/WRKDIR/certs/azure-iot-test-only.root.ca.cert.pem -showcerts
CONNECTED(00000003)
write:errno=0
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 176 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : 0000
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: 
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1549532660
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: no
---

what is the difference between the gateway"s IPadress and the hosname cuz in the connection string when i use the ip adress of my gateway the client has been connected but when i use the hostname i get this ;

Creating IoTHub handle
Error: Time:Thu Feb  7 09:29:34 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c Func:lookup_address_and_initiate_socket_connection Line:277 Failure: getaddrinfo failure -3.
Error: Time:Thu Feb  7 09:29:34 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c Func:socketio_open Line:760 lookup_address_and_connect_socket failed
Error: Time:Thu Feb  7 09:29:34 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:on_underlying_io_open_complete Line:760 Invalid tlsio_state. Expected state is TLSIO_STATE_OPENING_UNDERLYING_IO.
Error: Time:Thu Feb  7 09:29:34 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:tlsio_openssl_open Line:1258 Failed opening the underlying I/O.
Error: Time:Thu Feb  7 09:29:34 2019 File:/home/pi/azure-iot-sdk-c/umqtt/src/mqtt_client.c Func:mqtt_client_connect Line:1001 Error: io_open failed
Error: Time:Thu Feb  7 09:29:34 2019 File:/home/pi/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2261 failure connecting to address iotedgegateway.
The device client has been disconnected
Sending message 1 to Edge Hub
Sending message 2 to Edge Hub
Sending message 3 to Edge Hub
Sending message 4 to Edge Hub
Sending message 5 to Edge Hub
Sending message 6 to Edge Hub
Sending message 7 to Edge Hub
Sending message 8 to Edge Hub
Sending message 9 to Edge Hub
Sending message 10 to Edge Hub
Sending message 11 to Edge Hub
Sending message 12 to Edge Hub
Sending message 13 to Edge Hub
Sending message 14 to Edge Hub
Sending message 15 to Edge Hub
Sending message 16 to Edge Hub
Sending message 17 to Edge Hub
Sending message 18 to Edge Hub
Sending message 19 to Edge Hub
Sending message 20 to Edge Hub

Press any key to continue
Error: Time:Thu Feb  7 09:29:35 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c Func:lookup_address_and_initiate_socket_connection Line:277 Failure: getaddrinfo failure -3.
Error: Time:Thu Feb  7 09:29:35 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/socketio_berkeley.c Func:socketio_open Line:760 lookup_address_and_connect_socket failed
Error: Time:Thu Feb  7 09:29:35 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:on_underlying_io_open_complete Line:760 Invalid tlsio_state. Expected state is TLSIO_STATE_OPENING_UNDERLYING_IO.
Error: Time:Thu Feb  7 09:29:35 2019 File:/home/pi/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:tlsio_openssl_open Line:1258 Failed opening the underlying I/O.
Error: Time:Thu Feb  7 09:29:35 2019 File:/home/pi/azure-iot-sdk-c/umqtt/src/mqtt_client.c Func:mqtt_client_connect Line:1001 Error: io_open failed
Error: Time:Thu Feb  7 09:29:35 2019 File:/home/pi/azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c Func:SendMqttConnectMsg Line:2261 failure connecting to address iotedgegateway.
The device client has been disconnected

i m using the latest version of iotedge 1.0.6-1and the sa;e for SDK 1.2.13

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
myagleycommented, Feb 8, 2019

This looks like it is failing to resolve the hostname to an ip address. Is your downstream device a physically separate device? You may need to add the gateway’s hostname to the downstream device’s /etc/hosts file to get the downstream device to connect.

0reactions
lt72commented, Nov 19, 2019

Closing this issue as it seems stale. Please re-open as needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gateways for downstream devices - Azure IoT Edge
IoT Edge devices can operate as gateways, providing a connection between other devices on the network and IoT Hub. The IoT Edge hub...
Read more >
Connect a downstream device to an Azure IoT Edge gateway
Here, you find instructions for establishing a trusted connection between downstream devices and IoT Edge transparent gateways.
Read more >
Use an IoT gateway to connect a device to Azure IoT Hub
Use IoT gateway to connect things to the cloud - SensorTag to Azure IoT Hub · Before you start this tutorial, make sure...
Read more >
how-to-connect-downstream-iot-edge-device.md
The gateway device handles interactions between the downstream device and IoT Hub, including authentication and message routing. Modules deployed to downstream ...
Read more >
Azure IoT Edge vs Protocol Gateway (IoT Hub)
The key point about IoT Hub is the interoperability it provides between some common protocols used by IoT devices: AMQP, MQTT and HTTPS....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found