hkcam icon indicating copy to clipboard operation
hkcam copied to clipboard

Setup command doesn't work

Open Emstr opened this issue 2 years ago • 7 comments

When I go to run:

./hkcam -db=/var/lib/hkcam/data -multi_stream=true -verbose

My error says:

flag provided but not defined: -db

Replacing -db with -data_dir results in this:

INFO 2022/03/12 17:49:58 main.go:73: version v0.1.0 (built at 2022-03-04T21:28:23Z+0100) DEBUG 2022/03/12 17:49:58 camera_control.go:194: {"assets":[]} DEBUG 2022/03/12 17:49:58 server.go:208: listening at [::]:43285

But I can't see the camera inside HomeKit. What am I doing wrong here?

Emstr avatar Mar 12 '22 04:03 Emstr

Replacing -db with -data_dir results in this:

You are right, you have to replace -db=... with -data_dir=.... I fixed the example in the readme in bc083d1.

But I can't see the camera inside HomeKit. What am I doing wrong here?

Did you add the camera to HomeKit as shown in the readme?

brutella avatar Mar 12 '22 10:03 brutella

Nope, the camera won't show up for me in HomeKit. I'm using a raspberry pi zero 2 w and the official raspberry pi camera. Any advice?

Emstr avatar Mar 13 '22 05:03 Emstr

Is your Raspberry Pi connected to the same network as your iOS device? Also multicast has to be enabled in your network for hkcam to work.

brutella avatar Mar 13 '22 19:03 brutella

i had to delete /data and restart with 0.1.0 to bring the camera back in home app under + add device

phenomeus avatar Apr 02 '22 18:04 phenomeus

I can see the camera in HomeKit, but when I try to connect I get an error on my iPhone: Unable to add accessory. Then I can no longer see the camera in HomeKit. definitely on the same wifi network and had no trouble using home bridge or other HomeKit devices.

Here's the logs from the RPI:

pi@raspberrypi:~ $ sudo ./hkcam -data_dir=/var/lib/hkcam/data -multi_stream=true -verbose INFO 2022/04/03 17:06:28 main.go:73: version v0.1.0 (built at 2022-03-04T21:28:23Z+0100) DEBUG 2022/04/03 17:06:28 camera_control.go:194: {"assets":[]} DEBUG 2022/04/03 17:06:28 server.go:208: listening at [::]:37393 DEBUG 2022/04/03 17:06:45 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from [fe80::14aa:3152:a3b:e992%wlan0]:58670 - 200 409B in 218.912202ms DEBUG 2022/04/03 17:06:59 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from 192.168.86.28:58673 - 200 409B in 217.879171ms DEBUG 2022/04/03 17:06:59 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from 192.168.86.28:58673 - 200 69B in 215.443146ms DEBUG 2022/04/03 17:06:59 pair-setup.go:197: {"Identifier":"5807E2B6-B86E-41DF-A0CA-547B9B13C464","PublicKey":"uiRE2mlx8y59B5FXVJs2l5zX/pNu+m0Fdw4LhFM8II4=","Signature":"rXJ0nFw8OOZ9FrhkcDkU+RxBpuMiZDt3pNk89DepiAEVogACd9oo27UkfogB16Yk7pVGa0jontLH3buvn7qpDQ=="} DEBUG 2022/04/03 17:06:59 pair-setup.go:211: ed25519 signature valid DEBUG 2022/04/03 17:06:59 pair-setup.go:252: storing public key for 5807E2B6-B86E-41DF-A0CA-547B9B13C464 DEBUG 2022/04/03 17:07:01 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from 192.168.86.28:58673 - 200 140B in 1.013537487s DEBUG 2022/04/03 17:07:01 logger.go:161: "POST http://Camera._hap._tcp.local/pair-verify HTTP/1.1" from 192.168.86.28:58674 - 200 140B in 14.393194ms DEBUG 2022/04/03 17:07:01 logger.go:161: "POST http://Camera._hap._tcp.local/pair-verify HTTP/1.1" from 192.168.86.28:58674 - 200 3B in 7.958598ms DEBUG 2022/04/03 17:07:01 accessories.go:25: {"accessories":[{"aid":1,"services":[{"iid":1,"type":"3E","characteristics":[{"iid":2,"type":"14","perms":["pw"],"format":"bool"},{"iid":3,"type":"20","perms":["pr"],"value":"Matthias Hochgatterer","format":"string"},{"iid":4,"type":"21","perms":["pr"],"value":"-","format":"string"},{"iid":5,"type":"23","perms":["pr"],"value":"Camera","format":"string"},{"iid":6,"type":"30","perms":["pr"],"value":"-","format":"string"},{"iid":7,"type":"52","perms":["pr"],"value":"v0.1.0","format":"string"}]},{"iid":8,"type":"111","characteristics":[{"iid":9,"type":"25","perms":["pr","pw","ev"],"value":false,"format":"bool"},{"iid":10,"type":"ACD9DFE7-948D-43D0-A205-D2F6F368541D","perms":["pr","ev"],"value":"eyJhc3NldHMiOltdfQ==","format":"tlv8"},{"iid":11,"type":"6A6C39F5-67F0-4BE1-BA9D-E56BD27C9606","perms":["pr","pw"],"value":"","format":"tlv8"},{"iid":12,"type":"3982EB69-1ECE-463E-96C6-E5A7DF2FA1CD","perms":["pr","pw"],"value":"","format":"tlv8"},{"iid":13,"type":"E8AEE54F-6E4B-46D8-85B2-FECE188FDB08","perms":["pw"],"description":"Take Snapshot","format":"bool"}]},{"iid":14,"type":"110","characteristics":[{"iid":15,"type":"114","perms":["pr"],"value":"AbYBAQACHQEBAAAAAQEBAAABAQICAQAAAAIBAQAAAgECAwEAAwsBAoAHAgI4BAMBHgAAAwsBAgAFAgLQAgMBHgAAAwsBAoACAgJoAQMBHgAAAwsBAuABAgIOAQMBHgAAAwsBAkABAgK0AAMBHgAAAwsBAgAFAgLAAwMBHgAAAwsBAgAEAgIAAwMBHgAAAwsBAoACAgLgAQMBHgAAAwsBAuABAgJoAQMBHgAAAwsBAkABAgLwAAMBDw==","format":"tlv8"},{"iid":16,"type":"115","perms":["pr"],"value":"AQ4BAQMCCQEBAQIBAAMBAgAAAQ4BAQICCQEBAQIBAAMBAQIBAA==","format":"tlv8"},{"iid":17,"type":"116","perms":["pr"],"value":"AgEA","format":"tlv8"},{"iid":18,"type":"117","perms":["pr","pw"],"value":"","format":"tlv8"},{"iid":19,"type":"120","perms":["pr","ev"],"value":"AQEA","format":"tlv8"},{"iid":20,"type":"118","perms":["pr","pw"],"value":"","format":"tlv8"}]}]}]} DEBUG 2022/04/03 17:07:01 logger.go:161: "GET http://Camera._hap._tcp.local/accessories HTTP/1.1" from 192.168.86.28:58674 - 200 1833B in 2.365871ms DEBUG 2022/04/03 17:07:01 pairings.go:49: add pairing FBA7EAD5-9B2D-4599-BF4F-919A6C74C272 DEBUG 2022/04/03 17:07:02 logger.go:161: "POST http://Camera._hap._tcp.local/pairings HTTP/1.1" from 192.168.86.28:58674 - 200 3B in 1.013391509s

Emstr avatar Apr 03 '22 05:04 Emstr

I can't see any errors in the logs, so the camera successfully paired with your iOS device.

Do you get any other errors on your iOS device which might help debug this issue?

brutella avatar Apr 06 '22 16:04 brutella

So I'm also having the same issue but I managed to get it to throw more errors as well.

pi@RepetierServer:~ $ sudo ./hkcam -data_dir=/var/lib/hkcam/data -multi_stream=true -port=8081 -verbose
INFO 2023/01/24 05:39:41 main.go:73: version v0.1.0 (built at 2022-03-04T21:28:23Z+0100)
DEBUG 2023/01/24 05:39:41 camera_control.go:194: {"assets":[]}
DEBUG 2023/01/24 05:39:41 server.go:208: listening at [::]:8081
DEBUG 2023/01/24 05:39:50 logger.go:161: "POST http://Camera._hap._tcp.local/identify HTTP/1.1" from 10.0.0.205:59859 - 204 0B in 3.489946ms
DEBUG 2023/01/24 05:39:57 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from 10.0.0.205:59859 - 200 409B in 435.154228ms
INFO 2023/01/24 05:39:58 pair-setup.go:145: client proof is invalid
DEBUG 2023/01/24 05:39:58 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from 10.0.0.205:59859 - 200 6B in 508.615086ms
DEBUG 2023/01/24 05:39:58 logger.go:161: "POST http://Camera._hap._tcp.local/pair-setup HTTP/1.1" from 10.0.0.205:59859 - 200 409B in 526.627805ms

This was after I deleted the data_dir and started again.

ApplebaumIan avatar Jan 24 '23 05:01 ApplebaumIan