# Reading from serial. Works in sample-js file, but when running in node-red serial port gets closed

**URL:** https://discourse.nodered.org/t/reading-from-serial-works-in-sample-js-file-but-when-running-in-node-red-serial-port-gets-closed/36347
**Category:** Developing Nodes
**Created:** [22 November 2020 17:18 UTC](https://discourse.nodered.org/t/reading-from-serial-works-in-sample-js-file-but-when-running-in-node-red-serial-port-gets-closed/36347 "2020-11-22T17:18:13Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)
#### Post date: [23 November 2020 09:07 UTC](https://discourse.nodered.org/t/reading-from-serial-works-in-sample-js-file-but-when-running-in-node-red-serial-port-gets-closed/36347/10 "2020-11-23T09:07:11Z")

</div>

Not clear what pi you are using, however have a look at this.

> **[Configuring The GPIO Serial Port On Raspbian Jessie and Stretch Including Pi...](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3-4/)**
>
> The Raspberry Pi GPIO serial port configuration has changed under Jessie / Stretch / Buster and also with the Raspberry PI 3 / 4. How to set it up.

---

_[View the full topic](https://discourse.nodered.org/t/reading-from-serial-works-in-sample-js-file-but-when-running-in-node-red-serial-port-gets-closed/36347)._
