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.

running sample application on raspberrypi zero w getting premature close error

See original GitHub issue

working fine on my mac, transferred the sample app onto raspberry pi zero w, getting the below

any ideas? I have all the certs, and everything required to connect.

pi@pids01iot150:~/iot $ ./start.sh

Running pub/sub sample application...
offline
error Error: premature close
    at TLSSocket.onclose (/home/pi/iot/node_modules/end-of-stream/index.js:47:67)
    at TLSSocket.emit (events.js:185:15)
    at _handle.close (net.js:541:12)
    at TCP.done [as _onclose] (_tls_wrap.js:379:7)
close
reconnect
error Error: premature close
    at TLSSocket.onclose (/home/pi/iot/node_modules/end-of-stream/index.js:47:67)
    at TLSSocket.emit (events.js:185:15)
    at _handle.close (net.js:541:12)
    at TCP.done [as _onclose] (_tls_wrap.js:379:7)
close

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
sdessingoucommented, Jan 13, 2020

When I run my program I am getting below issue, I didn’t get any solution so far, can someone help, thanks in advance. ` events.js:200 throw er; // Unhandled ‘error’ event ^ Error: premature close at onclosenexttick (xxx/node_modules/end-of-stream/index.js:54:86) at processTicksAndRejections (internal/process/task_queues.js:76:11)

Emitted ‘error’ event on DeviceClient instance at: at MqttClient. (xxx/node_modules/aws-iot-device-sdk/device/index.js:772:15) at MqttClient.emit (events.js:228:7) at TLSSocket.f (xxx/node_modules/once/once.js:25:25) at onclosenexttick (xxx/node_modules/end-of-stream/index.js:54:73) at processTicksAndRejections (internal/process/task_queues.js:76:11)`

when I try to check the connection with the certificates:

openssl s_client -connect xxxxEP:8883 -CAfile xxxAmazonRootCA1.pem -cert xxx.pem.crt -key xxx-private.pem.key

CONNECTED(00000003)

0reactions
jankes44commented, May 13, 2020

Same problem here, but other line in events.js events.js:174 throw er; // Unhandled ‘error’ event ^

Error: premature close at onclosenexttick (xxx/server/node_modules/end-of-stream/index.js:54:86)

Read more comments on GitHub >

github_iconTop Results From Across the Web

STICKY: Is your Pi not booting? (The Boot Problems Sticky)
Disconnect any extraneous USB devices, and try booting with only the video and the power cable connected. If you have to press keys...
Read more >
Raspberry Pi Zero W Setup - Medium
Raspberry Pi Zero W Setup ... This is my stream-of-consciousness notes to get a headless (ie no display) raspberry pi zero w up...
Read more >
How to Build a Raspberry Pi Server for Development - Toptal
In this article, I'm going to guide you through the process of setting it up as a home development server and deploying a...
Read more >
RPi.GPIO basics 3 – How to Exit GPIO programs cleanly ...
This program will run until it finishes, or a keyboard interrupt or other exception occurs. Whichever of these occurs, the finally: block (lines...
Read more >
Raspberry Pi Zero 2 W - YouTube
Raspberry Pi Zero 2 W review, including hardware specification and comparative performance tests. You can find more information on the ...
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