HomeKit Homekit won't connect to Homebridge running on Raspberry Pi

Discussion in 'HomeKit, HomePod, CarPlay, Home & Auto Technology' started by wotfan, Mar 25, 2018.

  1. wotfan macrumors newbie

    Joined:
    Apr 27, 2011
    #1
    Hi,

    I have homebridge running on a Mac Mini and want to move it to a Raspberry Pi. I followed the instructions here and everything seems to work until I try to add homebridge to HomeKit. HomeKit see homebridge and accepts the 8 digit code but hangs on the "Adding Homebridge, Make sure it stays connected to power and nearby" screen. Eventually it displays a failed to connect to accessory message.

    I am very new to the raspberry pi and linux for that matter. I would appreciate any advice. Thanks.

    By the way, I am using a Raspberry Pi 3 and used the NOOB installer to install the latest version of Raspbian before following the installation instructions. It has a wired connection to my network now but I will eventually move it to wireless.
     
  2. wotfan thread starter macrumors newbie

    Joined:
    Apr 27, 2011
    #2
    Update: I have made some progress getting Homebridge working. I am now able to add homebridge to HomeKit. The only thing I did differently was I added Homebridge to HomeKit using my iPhone instead of my iPad. I don't know why that made any difference.

    I have now run into a problem adding a pi camera to HomeKit. I tested the camera with the sample python script on the official Pi site so I know it works. I installed the camera into homebridge following the instructions here. When I launch homebridge, I get "v4l2-ctl failed to open /dev/video0". Anyone have a suggestion on what to do? Thanks in advance.
     
  3. BillGates1969 macrumors 6502

    BillGates1969

    Joined:
    Sep 11, 2008
    Location:
    Bournemouth
    #3
    Does this stop HomeBridge from running?

    Is the Pi camera on the same pi that is running HomeBridge?
     
  4. wotfan thread starter macrumors newbie

    Joined:
    Apr 27, 2011
    #4
    Thanks for the reply. Yes the error prevented HomeBridge from running and yes I am running Homebridge on the same pi as the camera. I do have another HomeBridge on HomeKit that is running on a Mac Mini but that only has some virtual switches on it.

    I have been playing around with this since I last posted and have made some progress. I found that the reason I was getting that error message was that I wasn't loading the bcm2835-v4l2 module after I rebooted the pi. From the instructions I thought that I only had to do it once during the install. Now that it is configured to automatically load every time the pi boots I no longer receive the error.

    Homebridge runs with only the normal warnings and I am able to add it to HomeKit. For some reason the camera is not loading into HomeKit though. The switches I configured using the dummy switch plugin are added to HomeKit but not the camera.

    Any ideas?
     
  5. BillGates1969, Mar 29, 2018
    Last edited: Mar 29, 2018

    BillGates1969 macrumors 6502

    BillGates1969

    Joined:
    Sep 11, 2008
    Location:
    Bournemouth
    #5
    Unfortunately not :(

    I run homebridge on a Pi3, but use only external plugins (Nest, WeMo, TPLink, Netatmo, MQTT, Sonoff-Tasmota, etc). I do know that the logs have helped me loads of times.

    CD to /var/log and run a tail -f on the daemon.log to see what is happening to HomeBridge as it is running.



    EDIT: I seem to remember something on the NPM plugin page for the Nest that mentions the nest cameras and needs additional installs in the Pi to get it to work. I know you don't have a Nest cam, but i seem to remember there is something needed to be installed on the Pi to stream any video
     
  6. wotfan thread starter macrumors newbie

    Joined:
    Apr 27, 2011
    #6
    Thanks for the reply. I am going to try a fresh install of the OS tonight since I have played with so many things I may have made it worse. I'll check out the logs if/when I run into problems. Thank you for the info.

    Right now I am trying to use the raspberry pi's add on camera with homebridge. I have tested the pi camera with a python script so I know it works. I am not getting any error messages so I am not sure why it isn't working in homebridge. Hopefully the fresh install combined with the info you provided will do the trick.

    Thanks again.
     
  7. BillGates1969 macrumors 6502

    BillGates1969

    Joined:
    Sep 11, 2008
    Location:
    Bournemouth
    #7
    One last thing - I am not sure if you have checked the GitHub page for the plugin

    https://github.com/moritzmhmk/homebridge-camera-rpi

    If you look under issues, there maybe some help there.

    Good luck :)
     

Share This Page