moritzmhmk / homebridge-camera-rpi

raspberry pi camera plugin for homebridge
MIT License
159 stars 29 forks source link

No Image showing #35

Open vmiyoshi opened 6 years ago

vmiyoshi commented 6 years ago

I physically installed the camera module Run the Prerequisite Then I decided on the "Installation (as homebridge plugin)," and not the "Installation (standalone)" because this device already has a working homebridge install with the Nest plugin loaded. After everything was said and done, I have a "Pi Camera" in homekit, but no image. I see a Video camera icon with a "/" through it.

moritzmhmk commented 6 years ago

Can you post the error log of homebridge?

Depending on how you installed it you might get it with journalctl -u homebridge.

Fasani commented 6 years ago

I get the same issue, I think.

I think this part did not work. module bcm2835-v4l2 loaded (add bcm2835-v4l2 to /etc/modules and reboot)

Log says it couldn’t write to the folder Videos/0

Or something like that, which I read is connected somehow to the module part of the install.

Any hints for module issues?

Fasani commented 6 years ago

I got it working, basically I did this:

sudo nano /etc/modules // at the end of the file, add this line: bcm2835-v4l2

Fasani commented 6 years ago

I get a video update about every 10 seconds, is streaming possible in the main home view mini panel?

It’s streaming live when you click the camera. I guess it doesn’t stream in the main home view mini mode?

moritzmhmk commented 6 years ago

It is supposed to only update still images in the main view.

Fasani commented 6 years ago

When the light is off and the camera is effectively sending black data, I get a live feed no problem, when light comes on I wait for around 60 seconds and then it says stream is offline. I guess the Pi is struggling with encoding?

Fasani commented 6 years ago

Answering my own question: Works fine after IOS restarted. Also tested on macOS Mojave in the new HomeKit app, works there also.

Fasani commented 6 years ago

Any tips on adding a second pi camera attached to a second raspberry pi on the network and appearing in HomeKit?

tokamac commented 6 years ago

I have the same issue since a few days: black screen, no still picture in Home. When clicking on it, the LED lights up on the pi camera, but there is no video stream (seconds counts on the upper left part in Home, displaying the line "Loading…" and a crossed camera icon eventually shows up in the middle of the screen).

mhermosi commented 6 years ago

I just installed the plug in.. I have tested the streaming using motion, now that I have installed the plugin, disabled motion (module is loaded device present) I see this on log:

`[8/19/2018, 1:28:18 AM] --- [8/19/2018, 1:28:19 AM] Loaded plugin: homebridge-camera-rpi [8/19/2018, 1:28:19 AM] Registering platform 'homebridge-camera-rpi.rpi-camera' [8/19/2018, 1:28:19 AM] --- [8/19/2018, 1:28:19 AM] Loading 1 platforms... [8/19/2018, 1:28:19 AM] [rpi-camera] Initializing rpi-camera platform... [8/19/2018, 1:28:19 AM] Loading 0 accessories... Setup Payload: X-HM://0023ISZOQOGF8 Scan this code with your HomeKit app on your iOS device to pair with Homebridge: QR code and pin .... └────────────┘

--set-ctrl rotate=0 --set-ctrl vertical_flip=0 --set-ctrl horizontal_flip=0 [8/19/2018, 1:28:23 AM] Homebridge is running on port 51826. [8/19/2018, 1:28:23 AM] Pi Camera is running on port 36025.`

No image in home neither when clicking on Pi Camera

Initial err messages:

Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] Muting event '1.15' notification for this connection since it originated here. Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] Muting event '1.15' notification for this connection since it originated here. Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] HTTP Response is finished Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] HTTP request: /characteristics?id=1.22 Sun, 19 Aug 2018 05:28:27 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: GET /characteristics?id=1.22 Sun, 19 Aug 2018 05:28:27 GMT Accessory [Pi Camera] Getting value for Characteristic "Streaming Status" Sun, 19 Aug 2018 05:28:27 GMT Accessory [Pi Camera] Got Characteristic "Streaming Status" value: AQEA Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] Muting event '1.22' notification for this connection since it originated here. Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] Muting event '1.22' notification for this connection since it originated here. Sun, 19 Aug 2018 05:28:27 GMT EventedHTTPServer [::ffff:192.168.1.4] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] New connection from client Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP server listening on port 34873 Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /pair-verify Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: POST /pair-verify Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] Pair verify step 1/2 Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /pair-verify Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: POST /pair-verify Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] Pair verify step 2/2 Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] Client D66899D1-4185-4FA2-9AB6-869DFB0249F8 verification complete Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /accessories Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: GET /accessories Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: PUT /characteristics Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Processing characteristic set: [{"aid":1,"iid":15,"ev":true},{"aid":1,"iid":22,"ev":true}] Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Registering Characteristic "Streaming Status" for events Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Registering Characteristic "Streaming Status" for events Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: PUT /characteristics Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Processing characteristic set: [{"aid":1,"iid":15,"ev":true}] Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Registering Characteristic "Streaming Status" for events Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: PUT /characteristics Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Processing characteristic set: [{"aid":1,"iid":22,"ev":true}] Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Registering Characteristic "Streaming Status" for events Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics?id=1.15 Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: GET /characteristics?id=1.15 Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Getting value for Characteristic "Streaming Status" Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Got Characteristic "Streaming Status" value: AQEA Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics?id=1.22 Sun, 19 Aug 2018 05:33:02 GMT HAPServer [50:EF:75:D9:40:08] HAP Request: GET /characteristics?id=1.22 Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Getting value for Characteristic "Streaming Status" Sun, 19 Aug 2018 05:33:02 GMT Accessory [Pi Camera] Got Characteristic "Streaming Status" value: AQEA Sun, 19 Aug 2018 05:33:02 GMT EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished

No clue!

nijisakai commented 6 years ago

-- Logs begin at Thu 2016-11-03 17:16:42 UTC, end at Mon 2018-08-20 12:45:33 UTC. -- Aug 20 12:44:12 hassbian systemd[1]: Started Node.js HomeKit Server. Aug 20 12:44:19 hassbian homebridge[505]: [2018-8-20 12:44:18] Loaded config.json with 0 accessories and 2 platforms. Aug 20 12:44:19 hassbian homebridge[505]: [2018-8-20 12:44:19] --- Aug 20 12:44:19 hassbian homebridge[505]: [2018-8-20 12:44:19] Loaded plugin: homebridge-camera-rpi Aug 20 12:44:19 hassbian homebridge[505]: [2018-8-20 12:44:19] Registering platform 'homebridge-camera-rpi.rpi-camera' Aug 20 12:44:19 hassbian homebridge[505]: [2018-8-20 12:44:19] --- Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] Loaded plugin: homebridge-homeassistant Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] Registering platform 'homebridge-homeassistant.HomeAssistant' Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] --- Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] Loading 2 platforms... Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] [HomeAssistant] Initializing HomeAssistant platform... Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] [HomeAssistant] Fetching HomeAssistant devices. Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] [rpi-camera] Initializing rpi-camera platform... Aug 20 12:44:20 hassbian homebridge[505]: [2018-8-20 12:44:20] Loading 0 accessories... Aug 20 12:44:20 hassbian homebridge[505]: --set-ctrl rotate=0 Aug 20 12:44:20 hassbian homebridge[505]: --set-ctrl vertical_flip=0 Aug 20 12:44:20 hassbian homebridge[505]: --set-ctrl horizontal_flip=0 Aug 20 12:44:21 hassbian homebridge[505]: [2018-8-20 12:44:21] Raspberry Pi Camera is running on port 46469. Aug 20 12:44:21 hassbian homebridge[505]: v4l2-ctl Failed to open /dev/video0: Permission denied Aug 20 12:44:21 hassbian homebridge[505]: v4l2-ctl Failed to open /dev/video0: Permission denied Aug 20 12:44:21 hassbian homebridge[505]: v4l2-ctl Failed to open /dev/video0: Permission denied Aug 20 12:44:21 hassbian homebridge[505]: [2018-8-20 12:44:21] [HomeAssistant] Failed getting devices: Error: connect ECONNREFUSED 192.168.1.100:8123. Retrying... Aug 20 12:44:22 hassbian homebridge[505]: --set-ctrl video_bitrate=299000 Aug 20 12:44:22 hassbian homebridge[505]: -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -an -payload_type 99 -ssrc 1 -f rtp -srtp_out_suite AES_CM_128_HMAC_S Aug 20 12:44:22 hassbian homebridge[505]: v4l2-ctl Failed to open /dev/video0: Permission denied Aug 20 12:44:23 hassbian homebridge[505]: ffmpeg ffmpeg version N-91481-gb8c4d2b2ed Copyright (c) 2000-2018 the FFmpeg developers Aug 20 12:44:23 hassbian homebridge[505]: built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 Aug 20 12:44:23 hassbian homebridge[505]: configuration: Aug 20 12:44:23 hassbian homebridge[505]: ffmpeg libavutil 56. 18.102 / 56. 18.102 Aug 20 12:44:23 hassbian homebridge[505]: libavcodec 58. 21.105 / 58. 21.105 Aug 20 12:44:23 hassbian homebridge[505]: libavformat 58. 17.101 / 58. 17.101 Aug 20 12:44:23 hassbian homebridge[505]: libavdevice 58. 4.101 / 58. 4.101 Aug 20 12:44:23 hassbian homebridge[505]: libavfilter 7. 26.100 / 7. 26.100 Aug 20 12:44:23 hassbian homebridge[505]: libswscale 5. 2.100 / 5. 2.100 Aug 20 12:44:23 hassbian homebridge[505]: libswresample 3. 2.100 / 3. 2.100 Aug 20 12:44:23 hassbian homebridge[505]: ffmpeg [video4linux2,v4l2 @ 0x2c86380] Aug 20 12:44:23 hassbian homebridge[505]: ffmpeg Cannot open video device /dev/video0: Permission denied Aug 20 12:44:23 hassbian homebridge[505]: ffmpeg /dev/video0: Permission denied Aug 20 12:44:26 hassbian homebridge[505]: [2018-8-20 12:44:26] [HomeAssistant] Fetching HomeAssistant devices. Aug 20 12:44:26 hassbian homebridge[505]: [2018-8-20 12:44:26] [HomeAssistant] Failed getting devices: Error: connect ECONNREFUSED 192.168.1.100:8123. Retrying...

i got this

mhermosi commented 6 years ago

hey @Nijisakai can you see /dev/video0 ? ls -l /dev/video0 ?

if you can, verify if you are running as root or pi, BTW which raspberry pi are you using?

moritzmhmk commented 5 years ago

is this solved?

Macoperator commented 5 years ago

Unfortunately not solved. I've got the same error. Running on a Raspberry Pi Zero W. /dev/video0 is owned by root homebridge error message states: "v4l2-ctl Failed to open /dev/video0: Permission denied"

Workaround for me was to install and use the standalone version.

moritzmhmk commented 5 years ago

Is homebridge run as a user other than pi? If so add that user to the group video.

sweetw0r commented 5 years ago

added root to video group and still getting:

Jan  7 01:24:55 raspberrypi homebridge[321]: --set-ctrl video_bitrate=299000
Jan  7 01:24:55 raspberrypi homebridge[321]: -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -an -payload_type 99 -ssrc 8059212 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params goAoFz0aMunx0ScmIX+aIgT9FGc39AaiYjOFRca0 srtp://10.0.0.74:60207?rtcpport=60207&localrtcpport=60207&pkt_size=1378
Jan  7 01:24:55 raspberrypi homebridge[321]: v4l2-ctl Failed to open /dev/video0: Permission denied
Jan  7 01:24:57 raspberrypi homebridge[321]: ffmpeg ffmpeg version 3.2.10-1~deb9u1+rpt2 Copyright (c) 2000-2018 the FFmpeg developers
Jan  7 01:24:57 raspberrypi homebridge[321]:   built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
Jan  7 01:24:57 raspberrypi homebridge[321]:   configuration: --prefix=/usr --extra-version='1~deb9u1+rpt2' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
Jan  7 01:24:57 raspberrypi homebridge[321]: ffmpeg   libavutil      55. 34.101 / 55. 34.101
Jan  7 01:24:57 raspberrypi homebridge[321]:   libavcodec     57. 64.101 / 57. 64.101
Jan  7 01:24:57 raspberrypi homebridge[321]:   libavformat    57. 56.101 / 57. 56.101
Jan  7 01:24:57 raspberrypi homebridge[321]:   libavdevice    57.  1.100 / 57.  1.100
Jan  7 01:24:57 raspberrypi homebridge[321]:   libavfilter     6. 65.100 /  6. 65.100
Jan  7 01:24:57 raspberrypi homebridge[321]: ffmpeg   libavresample   3.  1.  0 /  3.  1.  0
Jan  7 01:24:57 raspberrypi homebridge[321]:   libswscale      4.  2.100 /  4.  2.100
Jan  7 01:24:57 raspberrypi homebridge[321]:   libswresample   2.  3.100 /  2.  3.100
Jan  7 01:24:57 raspberrypi homebridge[321]:   libpostproc    54.  1.100 / 54.  1.100
Jan  7 01:24:57 raspberrypi homebridge[321]: ffmpeg [video4linux2,v4l2 @ 0x7716f0] Cannot open video device /dev/video0: Permission denied
Jan  7 01:24:57 raspberrypi homebridge[321]: ffmpeg /dev/video0: Permission denied
sweetw0r commented 5 years ago

sudo chmod 777 /dev/video0 helped!

firelizzard18 commented 5 years ago

@sweetw0r Usually that file is owned by root:video. Given that changing the mode of a device file is not really permanent (next reboot should forget that change), I suggest you instead add the user (homebridge probably) to the video group: sudo usermod -aG video homebridge.

This is what @moritzmhmk is suggesting.