washcroft / homebridge-http-garagedoorcontroller

An HTTP based Garage Door/Light plugin for HomeBridge
MIT License
15 stars 7 forks source link

No Response Homebridge - Default code #11

Closed jeylites closed 6 years ago

jeylites commented 6 years ago

I had this working in the past but now with version 2.0 I'm unable to troubleshoot what is causing it not to work on Homekit App. Below is my setup.

CONFIG.JSON

{
   "bridge":{
      "name":"Homesensors#6",
      "username":"FF:11:6F:F1:FF:11",
      "port":51826,
      "pin":"031-45-152"
   },
   "description":"",
   "platforms":[

   ],
   "accessories":[
      {
         "accessory":"HttpGarageDoorController",
         "name":"Garage Door",
         "lightName":"Garage Light",
         "doorOperationSeconds":0,

         "httpHost":"garagedoorcontroller.local",
         "httpPort":80,
         "httpSsl":false,
         "httpStatusPollMilliseconds":4000,
         "httpRequestTimeoutMilliseconds":10000,

         "httpHeaderName":"X-API-Key",
         "httpHeaderValue":"MyAPIKey",

         "oauthAuthentication":true,
         "oauthSignatureMethod":"HMAC-SHA256",
         "oauthConsumerKey":"MyOAuthConsumerKey",
         "oauthConsumerSecret":"MyOAuthConsumerSecret",

         "apiConfig":{
            "apiType":"HttpGarageDoorController"
         }
      }
   ]
}

ARDUINO SERIAL PRINT (Wemos D1)

`1384, room 16 
tail 8
chksum rl�$⸮⸮<�⸮d⸮|⸮l⸮c|⸮⸮⸮⸮{⸮c⸮c⸮⸮'n⸮doo⸮⸮⸮cx⸮⸮drlslp⸮g⸮⸮dĜc'⸮|d⸮⸮c⸮⸮g'⸮�d⸮⸮l`⸮ool`'s⸮⸮⸮ob⸮ds⸮⸮oc⸮d⸮s⸮⸮⸮l⸮l`⸮⸮g⸮Started Serial Debug

WiFi Connection Lost - Connecting
Finding WiFi hardware......found!
Connecting to WiFi network...{"result":200,"success":true,"message":"OK","light-input":false,"light-requested":false,"light-state":false,"sensor-open":false,"sensor-closed":false,"door-state":"unknown"}
{"result":200,"success":true,"message":"OK","light-input":false,"light-requested":false,"light-state":false,"sensor-open":false,"sensor-closed":false,"door-state":"unknown"}
{"result":200,"success":true,"message":"OK","light-input":false,"light-requested":false,"light-state":false,"sensor-open":false,"sensor-closed":false,"door-state":"unknown"}

connected to SIMHOME
Obtaining IP address...obtained 192.168.1.72
WiFi Connection Complete

SSID: SIMHOME
Signal Strength (RSSI): -79 dBm
Client MAC: 5e:cf:7f:f6:d1:d0
Station MAC: e4:b1:c9:ec:39:ed
Client IP Address: 192.168.1.72
Gateway IP Address: 192.168.1.254
mDNS Hostname: garagedoorcontroller.local

Starting OTA updater / mDNS responderStarting HTTP web server...started!
Initalising clock...initalised at 2018-02-27 13:02:04 UTC
{"result":200,"success":true,"message":"OK","light-input":false,"light-requested":false,"light-state":false,"sensor-open":false,"sensor-closed":false,"door-state":"unknown"}
{"result":200,"success":true,"message":"OK","light-input":false,"light-requested":false,"light-state":false,"sensor-open":false,"sensor-closed":false,"door-state":"unknown"}
`
jeylites commented 6 years ago

UPDATE on Homebridge Logs

homesensor_1 | [2018-2-27 13:40:50] [Garage Door] ERROR in _checkStates() - ERROR in _determineDoorState() - An error occurred during the HTTP request: getaddrinfo ENOTFOUND garagedoorcontroller.local garagedoorcontroller.local:80

homesensor_1 | [2018-2-27 13:40:54] [Garage Door] ERROR in _checkStates() - ERROR in _determineDoorState() - An error occurred during the HTTP request: getaddrinfo ENOTFOUND garagedoorcontroller.local garagedoorcontroller.local:80

homesensor_1 | [2018-2-27 13:40:58] [Garage Door] ERROR in _checkStates() - ERROR in _determineDoorState() - An error occurred during the HTTP request: getaddrinfo ENOTFOUND garagedoorcontroller.local garagedoorcontroller.local:80

washcroft commented 6 years ago

@jeylites Exactly as per the error message:

An error occurred during the HTTP request: getaddrinfo ENOTFOUND garagedoorcontroller.local garagedoorcontroller.local:80

garagedoorcontroller.local cannot be found on your network, maybe mDNS isn't working properly, change your HomeBridge config (httpHost) to your controllers direct IP address (192.168.1.72).

jeylites commented 6 years ago

After doing some digging, I got it working with homebridge. However, on a different RaspberryPi, I'm currently running homebridge in docker mode that's when it doesn't.

UPDATE

gave it a static IP and deleted the persist folder and it fixed everything... Thank you.

jeylites commented 6 years ago

@washcroft

Where in the Arduino script I have to change to give it a static IP?

washcroft commented 6 years ago

@jeylites

Where in the Arduino script I have to change to give it a static IP?

Don't change the script, set the correct config.

"httpHost":"garagedoorcontroller.local",

"httpHost":"192.168.100.123",

Edit: This project isn't an Arduino project, it's a HomeBridge script/plugin.