brutella / hkcam

Open-Source HomeKit Surveillance Camera
https://hochgatterer.me/hkcam/
Apache License 2.0
932 stars 141 forks source link

HKCam stops working after a few days: "Close connection and remove session" #99

Closed dingoosh closed 2 years ago

dingoosh commented 3 years ago

I've been trying to figure this out for weeks now. I've tried compiling the binary from the latest commit with the same issue.

On a fresh HKCam image (0.0.9), I can pair the camera to my home app and it'll display flawlessly - for a day or two. Then it'll suddenly refuse to connect. When attempting to open the camera on the home app, the little red LED on the camera module flashes on for about 1 second, then turns itself off with the eventual "No response from camera" display. Re-pairing the camera by removing the contents of /var/lib/hkcam/data doesn't help either - only a full reimage of the entire pi fixes the issue. This obviously isn't practical, so I'd like to reach out to see if anyone has any insight.

Here are the logs captured upon boot to attempting to open the camera a few times:

DEBUG 2020/11/04 07:36:04 camera_control.go:194: {"assets":[]}

INFO 2020/11/04 07:36:04 ip_transport.go:186: Listening on port 38291

DEBUG 2020/11/04 07:36:19 pair-verify.go:37: 10.0.0.28:50578 POST /pair-verify

DEBUG 2020/11/04 07:36:19 pair-verify.go:44: Create new pair verify controller

DEBUG 2020/11/04 07:36:19 verify_server_controller.go:93: -> A: ff6b0fe52f09df326ea2248f5570150418c3dd1bd59c8a44acbd3399ec569e16

DEBUG 2020/11/04 07:36:19 verify_server_controller.go:127: K: ed4e839b68413d9e931094127caae91a0dba19c97f3f473888138ccadc8a6533

DEBUG 2020/11/04 07:36:19 verify_server_controller.go:128: B: 73b732a4741d694d66cf5826edabcc86e9e1c95763efd7190396fe0d15da8060

DEBUG 2020/11/04 07:36:19 verify_server_controller.go:129: S: 54c2f98a53473fde6e27cb8b9f95f62b43e3ba3d43478963f85a5dd9cf0b03b2

DEBUG 2020/11/04 07:36:19 verify_server_controller.go:130: Shared: 357fbda0a169af039073a9ec095f39b54af205a8782409c9960ba164548e3a51

DEBUG 2020/11/04 07:36:19 verify_server_controller.go:132: <- B: 73b732a4741d694d66cf5826edabcc86e9e1c95763efd7190396fe0d15da8060

DEBUG 2020/11/04 07:36:19 connection.go:112: Close connection and remove session

DEBUG 2020/11/04 07:38:47 pair-verify.go:37: 10.0.0.30:59753 POST /pair-verify

DEBUG 2020/11/04 07:38:47 pair-verify.go:44: Create new pair verify controller

DEBUG 2020/11/04 07:38:47 verify_server_controller.go:93: -> A: eb76f23d83c31b5785707b9f2a2f63bdd322ab23bacd64e805c994a1e41a6773

DEBUG 2020/11/04 07:38:47 verify_server_controller.go:127: K: 63f861d8cff37e12836e44feb2cff9801cd9ed19955a328521bacb4d1a2160c7

DEBUG 2020/11/04 07:38:47 verify_server_controller.go:128: B: c44421cc8f9fdeae1157999e43083dbec20308c1a571c16c4fcd467a00f4c932

DEBUG 2020/11/04 07:38:47 verify_server_controller.go:129: S: c60101046c2d05fdd9b6a7d874cf87e6ba01e07bd1d086569e7b53030ee55952

DEBUG 2020/11/04 07:38:47 verify_server_controller.go:130: Shared: 326bbbcdeb02f1c5c3450c847467f383f5167956a4ab7e911eac0dfd0f3ab12a

DEBUG 2020/11/04 07:38:47 verify_server_controller.go:132: <- B: c44421cc8f9fdeae1157999e43083dbec20308c1a571c16c4fcd467a00f4c932

DEBUG 2020/11/04 07:38:47 connection.go:112: Close connection and remove session

DEBUG 2020/11/04 07:41:17 pair-verify.go:37: 10.0.0.7:56899 POST /pair-verify

DEBUG 2020/11/04 07:41:17 pair-verify.go:44: Create new pair verify controller

DEBUG 2020/11/04 07:41:17 pair-verify.go:37: 10.0.0.7:56898 POST /pair-verify

DEBUG 2020/11/04 07:41:17 pair-verify.go:44: Create new pair verify controller

DEBUG 2020/11/04 07:41:17 pair-verify.go:37: 10.0.0.75:62807 POST /pair-verify

DEBUG 2020/11/04 07:41:17 pair-verify.go:44: Create new pair verify controller

DEBUG 2020/11/04 07:41:17 verify_server_controller.go:93: -> A: 0b327bbc3fc72f27dfd4995119685b8776bbbc1bdcffc81c2533b3af87ac5e31

DEBUG 2020/11/04 07:41:17 pair-verify.go:37: 10.0.0.75:62808 POST /pair-verify

DEBUG 2020/11/04 07:41:17 pair-verify.go:44: Create new pair verify controller

DEBUG 2020/11/04 07:41:17 verify_server_controller.go:93: -> A: 5f6ce030b14040551ef85d9ab745367e10572b152c4f5e89baab5080728b4501

DEBUG 2020/11/04 07:41:17 verify_server_controller.go:93: -> A: a9c290203d21ebd7ffdb65e1687b3cc001c5d7cae23bc1496c2cfde575c3165f

DEBUG 2020/11/04 07:41:18 verify_server_controller.go:127: K: 632b15e84903696cca386cc54fb075a199d89cb8530e75e6c254a858550c08d7

DEBUG 2020/11/04 07:41:18 verify_server_controller.go:128: B: 87baa6c32ff5e21bf7924bd6c9d3d156a9e33615e9ceddf03ea62a1e3b37cc1a

DEBUG 2020/11/04 07:41:18 verify_server_controller.go:129: S: c0e92f88248691395b09c8bf0f493dd30b7006ac35074ad0eeb1bf53b7ab1fbd

DEBUG 2020/11/04 07:41:18 verify_server_controller.go:130: Shared: 89531929dbb9bc84ad983882284cc137c7268acb7027112f49c77f5e5e8d6023

DEBUG 2020/11/04 07:41:18 verify_server_controller.go:132: <- B: 87baa6c32ff5e21bf7924bd6c9d3d156a9e33615e9ceddf03ea62a1e3b37cc1a

DEBUG 2020/11/04 07:41:18 verify_server_controller.go:93: -> A: 908c86cf15487205dd759b0776d204a8662e1783b6d9a9fe6e746e06c401b321

DEBUG 2020/11/04 07:41:18 connection.go:112: Close connection and remove session

PvdGulik commented 3 years ago

I have the same problem, but not after 2 day, but immediately after fresh install.

When attempting to open the camera on the home app, the little red LED on the camera module flashes on for about 1 second, then turns itself off with the eventual "No response from camera" display.

Did you resolve this already?

Thanks

micheld93 commented 3 years ago

Yes, I did or at least I think I did. My iPhone was conntected to the 5 GHz when it didn't work. When it worked, I was connected to the 2,4 GHz WiFi.

Am Mo., 21. Juni 2021 um 08:47 Uhr schrieb PvdGulik < @.***>:

I have the same problem, but not after 2 day, but immediately after fresh install.

When attempting to open the camera on the home app, the little red LED on the camera module flashes on for about 1 second, then turns itself off with the eventual "No response from camera" display. <

Did you resolve this already?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brutella/hkcam/issues/99#issuecomment-864774013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EPPUXEFULLMW2ZVMJG5DTT3OAJANCNFSM4TJWES3A .

PvdGulik commented 3 years ago

But is your HKCam connected to the 2.4 Ghz Wifi? Mine is on 5Ghz, just as my iPhone

Op 21 jun. 2021, om 11:39 heeft micheld93 @.***> het volgende geschreven:

Yes, I did or at least I think I did. My iPhone was conntected to the 5 GHz when it didn't work. When it worked, I was connected to the 2,4 GHz WiFi.

Am Mo., 21. Juni 2021 um 08:47 Uhr schrieb PvdGulik < @.***>:

I have the same problem, but not after 2 day, but immediately after fresh install.

When attempting to open the camera on the home app, the little red LED on the camera module flashes on for about 1 second, then turns itself off with the eventual "No response from camera" display. <

Did you resolve this already?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brutella/hkcam/issues/99#issuecomment-864774013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EPPUXEFULLMW2ZVMJG5DTT3OAJANCNFSM4TJWES3A .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brutella/hkcam/issues/99#issuecomment-864889767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACH4FIULDOHRMNT35U3LYEDTT4CDZANCNFSM4TJWES3A.

micheld93 commented 3 years ago

Yes, it is because all other HK devices are in 2.4 GHz.

Am 21.06.2021 um 15:51 schrieb PvdGulik @.***>:

But is your HKCam connected to the 2.4 Ghz Wifi? Mine is on 5Ghz, just as my iPhone

Op 21 jun. 2021, om 11:39 heeft micheld93 @.***> het volgende geschreven:

Yes, I did or at least I think I did. My iPhone was conntected to the 5 GHz when it didn't work. When it worked, I was connected to the 2,4 GHz WiFi.

Am Mo., 21. Juni 2021 um 08:47 Uhr schrieb PvdGulik < @.***>:

I have the same problem, but not after 2 day, but immediately after fresh install.

When attempting to open the camera on the home app, the little red LED on the camera module flashes on for about 1 second, then turns itself off with the eventual "No response from camera" display. <

Did you resolve this already?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brutella/hkcam/issues/99#issuecomment-864774013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EPPUXEFULLMW2ZVMJG5DTT3OAJANCNFSM4TJWES3A .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brutella/hkcam/issues/99#issuecomment-864889767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACH4FIULDOHRMNT35U3LYEDTT4CDZANCNFSM4TJWES3A.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brutella/hkcam/issues/99#issuecomment-865049572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EPPSC2UFQ6Y24VUESL7DTT47VPANCNFSM4TJWES3A.

brutella commented 2 years ago

I've just released version 0.1.0, which should run much more reliable than previous versions.