1

I am trying to connect Raspberry Pi using TLS with Client Certificate and Token to Watson IoT Platform and after following this tutorial :

https://developer.ibm.com/recipes/tutorials/connect-raspberry-pi-to-ibm-watson-iot-platform-using-client-side-certificates/

I had this this issues :

[BaseClient:connect] Connecting to IoTF with host : ssl://XXXXX.messaging.internetofthings.ibmcloud.com:8883
[BaseClient:onError] Connection Error :: Error: Connection refused: Not authorized
Error: Connection refused: Not authorized
    at MqttClient._handleConnack (/home/pi/node_test_watson/iot-nodejs/node_modules/mqtt/lib/client.js:673:9)
    at MqttClient._handlePacket (/home/pi/node_test_watson/iot-nodejs/node_modules/mqtt/lib/client.js:274:12)
    at process (/home/pi/node_test_watson/iot-nodejs/node_modules/mqtt/lib/client.js:218:12)
    at Writable.writable._write (/home/pi/node_test_watson/iot-nodejs/node_modules/mqtt/lib/client.js:228:5)
    at doWrite (/home/pi/node_test_watson/iot-nodejs/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/home/pi/node_test_watson/iot-nodejs/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at Writable.write (/home/pi/node_test_watson/iot-nodejs/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at TLSSocket.ondata (_stream_readable.js:555:20)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at TLSSocket.Readable.push (_stream_readable.js:134:10)
    at TLSWrap.onread (net.js:548:20)
[BaseClient:connect] Iotfclient is offline. Retrying connection
[BaseClient:connect] Retry in 3 sec. Count : 1
[BaseClient:onClose] Connection was closed.
Disconnected from IoTF

what can i do plaese ??

  • the problem is resolved by adding the "mqtt-server" configuration update by https://github.com/ibm-watson-iot/iot-nodejs/issues/59 the to device.json : { "org": "xxxxx", "domain": "internetofthings.ibmcloud.com", "type": "Rpi3_Test01", "id": "Test4", "auth-method": "token", "auth-token": "xxxxxxxxxxxxxxx", "use-client-certs":true, "mqtt-server": "xxxxx.messaging.internetofthings.ibmcloud.com", "client-ca": "/home/pi/certs/rootCA.pem", "client-cert": "/home/pi/certs/client.pem", "client-key": "/home/pi/certs/client.key" } – Hassen Dakhlaoui Mar 17 '17 at 08:33

0 Answers0