# Node-red-contrib-p1reader error

**URL:** https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650
**Category:** General
**Created:** [24 December 2021 09:25 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650 "2021-12-24T09:25:53Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [24 December 2021 09:25 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/1 "2021-12-24T09:25:53Z")

</div>

node-red-contrib-p1reader installed and worked got data to debug node.  
Now it give this error and i have no idea how to solve. Reinstall the node,rebooted the pi.Only thing i dit not is turn the pi off as is remote and in a almost unreachable place.

```auto
 "Connection to P1 meter failed. Error details: Error: Error Resource temporarily unavailable Cannot lock port"

```

PS How to contact the maintainer of a node ?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [24 December 2021 10:34 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/2 "2021-12-24T10:34:14Z")

</div>

> [@old-grumpy](#):
>
> How to contact the maintainer of a node ?

1. Go to the flows page for the node ([node-red-contrib-p1reader (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-p1reader))
2. click the `View on GitHub` link in the `Node Info` section of the right column
3. Open an issue with a question - note you will need a GitHub account

But before opening an issue, did you read the `How to Use` section and configure your smartmeter?

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [24 December 2021 23:57 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/3 "2021-12-24T23:57:15Z")

</div>

yes i read ,it worked and it stopped working with that error.And nothing how to solve.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [25 December 2021 01:02 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/4 "2021-12-25T01:02:56Z")

</div>

Well I would suggest opening an issue on the GitHub page.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [25 December 2021 06:36 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/5 "2021-12-25T06:36:33Z")

</div>

I don't think this is an issue with the node.

> Cannot lock port

This means another process is reading (like serial.read) from the port and it is exclusive.

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [25 December 2021 11:32 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/6 "2021-12-25T11:32:08Z")

</div>

@bakman2 Ok noob here, how to find out what process it is, think it must be his own process that keep running.Only node-red and vncserver run on this pi.  
PS merry Christmas to all.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 December 2021 11:51 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/7 "2021-12-25T11:51:29Z")

</div>

If you reboot does it start working again?

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [25 December 2021 11:59 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/8 "2021-12-25T11:59:42Z")

</div>

@Colin after a reboot it say connected but ,no data to the debugnode. after a deploy it say disconnected and give the error.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [25 December 2021 12:02 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/9 "2021-12-25T12:02:50Z")

</div>

Did you verify if you have access from node-red to the device file ? Depending how you connected the P1 device to your pi and which device file it uses, eg `/dev/tty-usbserial`, do a `ls -l` on it check the permissions, usually it can only be accessed by root.

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [25 December 2021 12:06 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/10 "2021-12-25T12:06:10Z")

</div>

drwxr-xr-x 6 pi pi 4096 Aug 8 11:52 p1-smartmeter  
from log `[2021-12-25T12:06:48.856Z] Trying to connect to Smart Meter via port: /dev/ttyUSB0 (BaudRate: 115200, Parity: none, Databits: 8, Stopbits: 1) 25 Dec 13:06:48 - [info] Started flows [2021-12-25T12:06:48.876Z] Error emitted: Error: Error Resource temporarily unavailable Cannot lock port `  
Off to Christmas 🙂

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 December 2021 12:37 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/11 "2021-12-25T12:37:36Z")

</div>

Does that message appear when you deploy for the first time?

If so then it probably is a bug in the node not releasing the port when it is stopped, so that it can connect again when it restarts after the deploy.

**[Edit]** Sorry, I see you answered the first question already, so it may well be a problem with the node.

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [30 December 2021 09:02 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/12 "2021-12-30T09:02:41Z")

</div>

Verry helpful reply on github NOT. \*\* This is a typical serialport issue. It is usually fixed when you restart node-red. (not just the flow, restart node-red entirely). If that doesn't help, it's probably a configuration issue or some kind of conflict. Google is your friend, there is ton of material on this problemt\*\*  
Not helpful as there is nothing to configure and get a noting found so STUCK.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [30 December 2021 09:53 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/13 "2021-12-30T09:53:07Z")

</div>

Can you do a:

```auto
sudo lsof /dev/ttyUSB0

```

and post the output ?

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [30 December 2021 15:30 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/14 "2021-12-30T15:30:10Z")

</div>

After reboot

```auto
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node-red 316 pi 22uW CHR 188,0 0t0 267 /dev/ttyUSB0

```

the node say connected but no output to debug.  
after a deploy it say disconnected, output lsof stay the same

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [30 December 2021 18:03 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/15 "2021-12-30T18:03:06Z")

</div>

Did you set the debug node to output the "complete msg object" ?  
Could you also add a catch node with a debug node (with complete msg object) and do you get any output ?

I assume you have a P1 reader that is compatible with the library ?

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [30 December 2021 18:59 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/16 "2021-12-30T18:59:41Z")

</div>

Added the catch and debug then deploy node goes to disconect and the debug gets the data every second NOT the catch debug that gets nothing !  
the note give the error .  
Fact even if i do not use deploy the org-debug gets data.

edit for new stuff  
so made a function node to split the telegram to dashboard and see if it keep running. it get data even the p1 node say disconnected .

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [1 January 2022 09:59 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/17 "2022-01-01T09:59:22Z")

</div>

Happy New Year.

It keeps running but if i go to the dash it take a very long time to show something.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [1 January 2022 11:20 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/18 "2022-01-01T11:20:11Z")

</div>

Slow dash is usually due to one of the following...

- Trying to display charts with too much data (more data points than the width in pixels is simply a waste of resources)
- Running dashboard on pi browser (browser is resource hungry)
- High CPU usage on computer where browser is running
- High CPU usage on computer where node-red is running

---

<div class="post-metadata">

### Author: ![old-grumpy](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@old-grumpy](https://discourse.nodered.org/u/old-grumpy)
#### Post date: [1 January 2022 12:05 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/19 "2022-01-01T12:05:24Z")

</div>

Q Steve-Mcl , Yes it write a lot of data in line chart, so i removed the charts and use mqqt. Yes i hope node-red make a dedicated browser only for node-red use,today browsers are to bloated..

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 March 2022 12:05 UTC](https://discourse.nodered.org/t/node-red-contrib-p1reader-error/55650/20 "2022-03-02T12:05:44Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
