ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
308 stars 18 forks source link

Error "localhost LED: error: 127.0.0.1:8888: cannot connect: ECONNREFUSED" #69

Closed danalvi closed 3 years ago

danalvi commented 3 years ago

Hello @ebaauw !

I must begin with expressing my gratitude for this wonderful work. I am trying to completely “digitalise” my house, so this is one modest attempt.

I am on Raspberry Pi 2 2014, otherwise am on the latest of everything. My Raspberry Pi is local i.e. I am installing homebridge, and RPi both on the same Raspberry Pi. pigpio works too. I am wishing to configure an LED to blink via the Switch device on pin 22, but run into the following problem.

localhost LED: error: 127.0.0.1:8888: cannot connect: ECONNREFUSED.

Everything else is positive. My configuration file is the following.

{ "bridge": { "name": "Homebridge 215A", "username": "0E:BA:93:8F:5C:70", "port": 51000, "pin": "105-21-149" }, "accessories": [], "platforms": [ { "name": "Config", "port": 8581, "platform": "config" }, { "platform": "RPi", "hosts": [ { "host": "localhost", "devices": [ { "device": "switch", "name": "LED", "gpio": 22 } ] } ] } ] }.

Looking forward to hearing from you!

ebaauw commented 3 years ago

Did you try 127.0.0.1 instead of localhost. Sometimes a connection to localhost is treated as a remote connection. Something to do with IPv4 vs IPv6, I don’t understand the details. See https://github.com/ebaauw/homebridge-rpi/issues/50.

danalvi commented 3 years ago

I followed that and it worked! Can’t wait to digitalise my home !