brutella / hkcam

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

Raspberry Pi 4 config #89

Closed sighmon closed 4 years ago

sighmon commented 4 years ago

After running the Ansible playbook on RaspiOS Lite Buster 2020-05-27 I was struggling with the error from cat /var/log/hkcam/current:

2020-07-23_13:44:40.23375 [video4linux2,v4l2 @ 0x238d200] Cannot open video device /dev/video1: No such file or directory

So I modified the ansible/roles/hkcam/tasks/configure.yml to a newer v0.12.5 release of v4l2loopback:

# ansible/roles/hkcam/tasks/configure.yml

- name: Download v4l2loopback
  get_url:
     url: https://github.com/umlaeute/v4l2loopback/archive/v0.12.5.tar.gz
     dest: /tmp
  register: v4l2_pkg_download

I then stopped the service on the Raspberry Pi with sudo sv stop hkcam and re-ran the ansible playbook on macOS ansible-playbook rpi.yml -i hosts --ask-pass.

This still didn't seem to work, as I still didn't have /dev/video1, so I re-ran the modprobe command:

sudo sv stop hkcam
sudo modprobe v4l2loopback
sudo sv start hkcam

After that it created /dev/video1 and I could get the video streaming.

It's a bit late at night here to see if re-running modprobe would have fixed it without having to install v0.12.5, but in any case this is what worked for me.

rstrehle commented 4 years ago

Just a symlink to /dev/video0 is enough: ln -s /dev/video0 /dev/video1

brutella commented 4 years ago

@sighmon Thanks for the details description. I'm also using v4l2loopback v.0.12.5 without any issues. The playbook will be updated asap.

@rstrehle This doesn't work.