# PI GPIOD Node ECONNREFUSED

**URL:** <https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500>\
**Category:** General\
**Created:** [23 March 2020 11:24 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500 "2020-03-23T11:24:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 11:24 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/1 "2020-03-23T11:24:07Z")

</div>

Hey Guys,

i tried to write a simple Programm to change the angle of my servo with the "pi gpiod" node on my Raspberry pi. In the debug window i just get the message: "Error:connect ECONNREFUSED 127.0.0.1:102". I hope there is any help for me.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 March 2020 11:30 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/2 "2020-03-23T11:30:39Z")

</div>

> [@noob](#):
>
> pi gpiod

Are you sure that you are using the right IP port? The default appears to be _8888_?

Port 102 is a privileged port number and you would have to run gpiod as root to have that.

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 12:44 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/3 "2020-03-23T12:44:08Z")

</div>

I use 8888 in the pi gpiod node

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 March 2020 13:02 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/4 "2020-03-23T13:02:26Z")

</div>

But you are trying to connect to port 102 which is clearly wrong. Does the node have a setting for the port? I don't use it so I don't know.

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 13:36 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/5 "2020-03-23T13:36:27Z")

</div>

There is a possibility to give the host. Ive got there "localhost" and "8888"

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 13:38 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/6 "2020-03-23T13:38:14Z")

</div>

You have to run the pigpiod daemon in a separate terminal session

`sudo pigpiod`

The node will then connect to that running daemon and it will work (went thru same process myself 4 days ago ) 🙂

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 14:40 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/7 "2020-03-23T14:40:05Z")

</div>

Hello cymplecy, where have i to write in the command? In the command window of the rasperry pi?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 14:51 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/8 "2020-03-23T14:51:24Z")

</div>

Yes - launch a terminal and type it in

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 14:52 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/9 "2020-03-23T14:52:49Z")

</div>

I get "Can't lock /var/run/pigpio.pid" and "Can't initialise pigpio library"

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 14:57 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/10 "2020-03-23T14:57:46Z")

</div>

☹  
Is this a standard Pi running Raspbian?

Just noticed that your getting a strange port number - got this message before I fixed mine

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/1/514edaba6d7c4d4794ed0dcaeaeb47173212677d.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 15:00 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/11 "2020-03-23T15:00:08Z")

</div>

I can get that error by running the command twice

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9a826fb326493d475187f25aed05cadc9cf51761.png)

Can you switch off and on again and try it again please?

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 15:02 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/12 "2020-03-23T15:02:01Z")

</div>

I restarted the pi and got the error again, after i wrote the command ☹

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 15:02 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/13 "2020-03-23T15:02:56Z")

</div>

I have the Raspberry Pi 3 Model B Vi 2

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 15:06 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/14 "2020-03-23T15:06:37Z")

</div>

restart your pi - dont run the sudo pigpiod command - run this instead and see what it gives

`sudo ps aux | grep pigpiod`

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 15:43 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/15 "2020-03-23T15:43:33Z")

</div>

i think that worked. What should i do now?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 15:44 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/16 "2020-03-23T15:44:13Z")

</div>

Can you post the output of it please 🙂

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 15:46 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/17 "2020-03-23T15:46:03Z")

</div>

root 331 7.6 0.1 9976 1636 ? SLsl 16:01 0:39 /usr/bin/pigpiod -l  
pi 3006 0.0 0.0 7360 576 pts/0 S+ 16:09 0:00 grep --color=auto pigpiod

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 16:13 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/18 "2020-03-23T16:13:08Z")

</div>

So that shows its already running - I wonder what is starting it?

But never mind - at least its running 🙂

So - if you start node-red - are you still getting the ECONNREFUSED localhost:102 error message?

---

<div class="post-metadata">

**Author:** ![noob](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@noob](https://discourse.nodered.org/u/noob)\
**Post date:** [23 March 2020 16:17 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/19 "2020-03-23T16:17:14Z")

</div>

unfortunately yes, i get that error message

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [23 March 2020 16:25 UTC](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500/20 "2020-03-23T16:25:10Z")

</div>

I am out of ideas at this point ☹  
Sorry ☹

[Next page](https://discourse.nodered.org/t/pi-gpiod-node-econnrefused/23500.md?page=2)
