Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup command doesn't work #125

Open
Emstr opened this issue Mar 12, 2022 · 7 comments
Open

Setup command doesn't work #125

Emstr opened this issue Mar 12, 2022 · 7 comments

Comments

@Emstr
Copy link

Emstr commented Mar 12, 2022

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?

@brutella
Copy link
Owner

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?

@Emstr
Copy link
Author

Emstr commented Mar 13, 2022

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?

@brutella
Copy link
Owner

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.

@phenomeus
Copy link

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

@Emstr
Copy link
Author

Emstr commented Apr 3, 2022

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

@brutella
Copy link
Owner

brutella commented Apr 6, 2022

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?

@ApplebaumIan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants