HAP-NodeJS
HAP-NodeJS copied to clipboard
Can't upgrade old code to new version or run wiki example
Current Situation
Hi there,
I previously set up HAP-NodeJS to work with some lights in my RV. That setup worked great for several years, but it's time to clean out the cobwebs. To that end, I've been trying to upgrade my existing code from ^0.4.40
to ^0.10.2
.
Unfortunately, I haven't had any luck upgrading my existing code. I'm able to add the accessory (a bridge) and identify its sub-accessories during setup, but I can't actually control anything. All accessories just end up in the "No Response" state. I'm also able to remove the bridge from the Home app just fine.
I assumed I was just doing something wrong, so I also tried running the light.js script from the wiki. For some reason though, this gives me the same result! I'm able to add/remove/call identify on the accessory just fine, but I can't control it.
Please let me know if I can provide any additional information. Attached logs are from my test with the wiki script.
Logs
» DEBUG=* node wiki-example.js
ciao:init Loading ciao v1.1.5... +0ms
HAP-NodeJS:Advertiser Initializing HAP-NodeJS v0.10.2 ... +0ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Creating new AccessoryInfo for our HAP server +0ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Creating new IdentifierCache +10ms
HAP-NodeJS:Advertiser Preparing Advertiser for 'Example Accessory Name 4921' using bonjour-hap backend! +0ms
Accessory setup finished!
HAP-NodeJS:EventedHTTPServer Server listening on [::]:47129 +0ms
HAP-NodeJS:Advertiser Starting to advertise 'Example Accessory Name 4921' using bonjour-hap backend! +3ms
HAP-NodeJS:EventedHTTPServer [::ffff:192.168.40.103] New connection from client on interface en4 (::ffff:192.168.40.78) +10s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] Internal HTTP server listening on 127.0.0.1:64957 +0ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] Internal HTTP socket connected. HAPConnection now fully set up! +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /pair-setup +2ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-setup +0ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair step 1/5 +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +64ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /pair-setup +8s
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-setup +8s
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair step 2/5 +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +92ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /pair-setup +33ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-setup +123ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair step 3/5 +0ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair step 4/5 +1ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair step 5/5 +8ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Paired with client 24BB021A-4BD9-423E-97AB-1F43278A9026 +18s
HAP-NodeJS:Advertiser Updating txt record (txt: { 'c#': 2, ff: 0, id: '17:51:07:F4:BC:8A', md: 'Default-Model', pv: '1.1', 's#': 1, sf: 0, ci: 5, sh: '8zPjbw==' }, silent: NaN) +18s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +16ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] Client connection closed +48ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP connection was closed +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP server was closed +0ms
HAP-NodeJS:EventedHTTPServer [::ffff:192.168.40.103] New connection from client on interface en4 (::ffff:192.168.40.78) +10s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] Internal HTTP server listening on 127.0.0.1:64960 +1s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] Internal HTTP socket connected. HAPConnection now fully set up! +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /pair-verify +0ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-verify +1s
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair verify step 1/2 +0ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +12ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /pair-verify +23ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-verify +34ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair verify step 2/2 +0ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Client 24BB021A-4BD9-423E-97AB-1F43278A9026 verification complete +7ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +8ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /accessories +31ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: GET /accessories +32ms
Queried current light state: false
Queried current brightness level: 100
HAP-NodeJS:EventedHTTPServer [::ffff:192.168.40.103] Muting event '1.11' notification for this connection since it originated here. +80ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +4ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /characteristics +43ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: PUT /characteristics +47ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Processing characteristic set: {"characteristics":[{"aid":1,"iid":10,"ev":true},{"aid":1,"iid":11,"ev":true}]} +1s
HAP-NodeJS:Accessory [::ffff:192.168.40.103] Registered Characteristic "On" on "Example Accessory Name 4921" for events +0ms
HAP-NodeJS:Accessory [::ffff:192.168.40.103] Registered Characteristic "Brightness" on "Example Accessory Name 4921" for events +0ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /characteristics +4ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: PUT /characteristics +6ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Processing characteristic set: {"characteristics":[{"aid":1,"iid":10,"ev":true},{"aid":1,"iid":11,"ev":true}]} +5ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /characteristics?id=1.3,1.4,1.6,1.7 +9ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: GET /characteristics?id=1.3,1.4,1.6,1.7 +10ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Got Characteristic "Manufacturer" value: "Default-Manufacturer" +11ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Got Characteristic "Model" value: "Default-Model" +0ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Got Characteristic "Serial Number" value: "Default-SerialNumber" +0ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Got Characteristic "Firmware Revision" value: "0.0.0" +0ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /pairings +40ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pairings +43ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pairings: successfully executed ADD_PAIRING +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +2ms
HAP-NodeJS:EventedHTTPServer [::ffff:192.168.20.90] New connection from client on interface en0 (::ffff:192.168.20.90) +1s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] Internal HTTP server listening on 127.0.0.1:64963 +1s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] Internal HTTP socket connected. HAPConnection now fully set up! +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP request: /pair-verify +4ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-verify +1s
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair verify step 1/2 +0ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP Response is finished +10ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP request: /pair-verify +25ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: POST /pair-verify +35ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Pair verify step 2/2 +0ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] Client 24BB021A-4BD9-423E-97AB-1F43278A9026 verification complete +8ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP Response is finished +9ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP request: /accessories +4ms
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: GET /accessories +5ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP Response is finished +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP request: /characteristics +2s
HAP-NodeJS:HAPServer [17:51:07:F4:BC:8A] HAP Request: PUT /characteristics +2s
HAP-NodeJS:Accessory [Example Accessory Name 4921] Processing characteristic set: {"characteristics":[{"aid":1,"iid":2,"value":true}]} +3s
HAP-NodeJS:Accessory [Example Accessory Name 4921] Identification request +0ms
HAP-NodeJS:Accessory [Example Accessory Name 4921] Identification request ignored; no listeners to 'identify' event +0ms
HAP-NodeJS:EventedHTTPServer [::ffff:192.168.40.103] Muting event '1.2' notification for this connection since it originated here. +2s
HAP-NodeJS:Accessory [Example Accessory Name 4921] Setting Characteristic "Identify" to value true +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP Response is finished +3ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] Client connection closed +3s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP connection was closed +1ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.20.90] HTTP server was closed +0ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] Client connection closed +3s
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP connection was closed +2ms
HAP-NodeJS:EventedHTTPServer:Connection [::ffff:192.168.40.103] HTTP server was closed +1ms
HAP-NodeJS:EventedHTTPServer Currently 0 hap connections open: +37s
Configuration
N/A
Environment
- OS: macOS and Raspbian
- Software: 0.10.2
- Node: 16.16.0
- npm: 8.11.0
Process Supervisor
not applicable
Additional Context
No response
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Seems like the pairing is completing just fine. Also another of our apple devices successfully connects after the pairing was established (the second /pair-verify
) step. Even the write to the identify characteristics works just fine! And the first device even registers to some events.
Some everything seems normal.
When you try to control any devices you nothing happens in the log right?
Do you maybe have a link to the exact code sample you are running there?
Follow up, what versions of macOS/iOS are you running?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed as no further activity has occurred.
This issue has been closed as no further activity has occurred.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed as no further activity has occurred.