gozoinks / homebridge-camera-ffmpeg-ufv

UniFi Video plugin for Homebridge
https://www.npmjs.com/package/homebridge-camera-ffmpeg-ufv
Other
76 stars 20 forks source link

Can't Re-add Cameras to Home app #16

Closed thesteev closed 6 years ago

thesteev commented 6 years ago

Hi,

I was a happy user of this plug-in until I spent the past weekend on a wild goose chase trying to restore the LIVE feeds in the Home app.

I didn't realize that in a recent update to the Unifi NVR, Ubiquiti added a new setting for the NVR to turn on RTSP at a centralized preference, with it off by default, causing the LIVE feeds for my cameras to stop working.

During my many various steps trying to troubleshoot the issue, I removed one of the cameras from the Home app, and can't get it added back.

To make things worse, I removed my Homebridge from the Home app, and have since removed all the cameras to re-add them and now none of the cameras seem to be available for adding.

I was able to add all of my other Homebridge accessories back to the Home app when I repaired the Homebridge with the Home app earlier today.

When I check the console for the Homebridge, I can see the cameras are active but it doesn't appear to work, as you can see from the excerpt below.

[2018-3-19 03:27:23] [UniFi Video (ffmpeg)] Published 9 camera accessories. [2018-3-19 03:27:23] Frontyard Right is running on port 44277. [2018-3-19 03:27:23] Patio is running on port 44225. [2018-3-19 03:27:23] Frontyard Left is running on port 35845. [2018-3-19 03:27:23] Porch is running on port 35171. [2018-3-19 03:27:23] Garage Path is running on port 46343. [2018-3-19 03:27:23] Backyard Unfinished Path is running on port 46677. [2018-3-19 03:27:24] Backyard Stone Path is running on port 43865. [2018-3-19 03:27:24] Backyard Left is running on port 37707. [2018-3-19 03:27:24] Backyard Right is running on port 38145.

Any suggestions what I'm doing wrong?

jnanes commented 6 years ago

I am having this exact issue. A camera timed out during the add, and now it will not show back up regardless of what I do. Any tips? I turned RTSP off an back on for that camera, rebooted camera, phone, homebridge, and ubuntu OS it is running on. I also renamed the camera in Unifi NVR

jnanes commented 6 years ago

Found this on a ubnt forum and it fixed it for me!

In the homebridge root directory (where your config.json file is), there are accessories and persist directories.

In the accessories directory is a file called cachedAccessories that describes all the accessories homebridge publishes, including their names and UUIDs (among other things).

In the persist directory are several files, two for each accessory: AccessoryInfo-.json and IdentifierCache-.json.

Once you delete an accessory from HomeKit through your iOS device, delete it also from homebridge:

Stop homebridge Rename (or just delete) the accessories/cachedAccessories file In the persist directory, find the files that refer to your affected cameras and either move them out of that directory or just delete them Restart homebridge Go back to your iOS device and (with any luck) re-add the missing cameras

jnanes commented 6 years ago

LOL so I am kind of losing my mind on this, got some more cameras and after killing/relaunching homebridge, homebridge could see the cameras, but iOS would not show them. I than tried the above, and removed my existing cameras from Homekit/homebridge. Now I cannot get any cameras to show up in Homekit, none are detected at the add accessory screen. They are shown in Homebridge however.

adrum commented 6 years ago

@jnanes Try changing the name of the camera. The original homebridge-camera-ffmpeg project uses the name as a unique identifier. Awhile back, I looked into a way to use the bridge.username property in combination with the camera name, which would provide uniqueness to only that pairing of homebridge username and camera name.

It's a real pain when try to have a production install of cameras and a test environment of cameras. Anyways, give that a try and let me know if it helps.

jnanes commented 6 years ago

Austin, I actually was able to get the m to show up. I was on a separate subnet, i had created to deal with another home bridge issue, which caused this issue.

The other issue I am fighting is that I cannot view my live streams, if i am on the same LAN as my Homebrdige/Unifi NVR. If I am on LTE, or on a different wifi network it works fine, but on my own LAN the streams time out and do not load.

Thanks,

Jesse Nanes

On May 4, 2018, 2:18 PM -0400, Austin Drummond notifications@github.com, wrote:

@jnanes Try changing the name of the camera. The original homebridge-camera-ffmpeg project uses the name as a unique identifier. Awhile back, I looked into a way to use the bridge.username property in combination with the camera name, which would provide uniqueness to only that pairing of homebridge username and camera name. It's a real pain when try to have a production install of cameras and a test environment of cameras. Anyways, give that a try and let me know if it helps. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

adrum commented 6 years ago

Make sure the iOS device and your homebridge instance are on the subnet. mDNS/Bonjour has trouble functioning across subnets (which is probably what you ran into earlier). There's a way you can do it with more complex networking equipment, but definitely not your off the shelf home router.

jnanes commented 6 years ago

They are both on the same subnet now, the cameras appeared and I can view the thumbnail, but streams will not load Live when connected via WiFi, on the same lan. Again - if I drop off WiFi, or use someone else’s network, it works perfect. There would be nothing on my Lan blocking LAN to LAN traffic . I’m stumped

Thanks,

Jesse Nanes

On May 4, 2018, 4:26 PM -0400, Austin Drummond notifications@github.com, wrote:

Make sure the iOS device and your homebridge instance are on the subnet. mDNS/Bonjour has trouble functioning across subnets (which is probably what you ran into earlier). There's a way you can do it with more complex networking equipment, but definitely not your off the shelf home router. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gozoinks commented 6 years ago

I'm having trouble visualizing the interactions between all your moving parts and how your setup looks now. However, if it's working remotely, that tells me homebridge and the plugin are successfully retrieving the stream from the camera and relaying it to your iPad or AppleTV (whichever is acting as your homekit hub), which is successfully able to relay it to your device when outside the network.

I wonder if there might be any reason your AppleTV/iPad thinks your mobile device is on a different subnet; that might cause it to attempt to relay the stream outside of the network via Apple's iCloud VPN, instead of directly to your device.

jnanes commented 6 years ago

Sorry if I complicated or confused things in my explanation.

I am currently running a basic standard network, 1 subnet, no vlans and can only access the streams remotely. I don’t have anything config’d on the network that would attempt to relay the stream outside my network via apple’s iCloud VPN.  Is there any additional info I can provide to help troubleshoot this?

Thanks,

Jesse Nanes

On May 4, 2018, 5:46 PM -0400, John Burwell notifications@github.com, wrote:

I'm having trouble visualizing the interactions between all your moving parts and how your setup looks now. However, if it's working remotely, that tells me homebridge and the plugin are successfully retrieving the stream from the camera and relaying it to your iPad or AppleTV (whichever is acting as your homekit hub), which is successfully able to relay it to your device when outside the network. I wonder if there might be any reason your AppleTV/iPad thinks your mobile device is on a different subnet; that might cause it to attempt to relay the stream outside of the network via Apple's iCloud VPN, instead of directly to your device. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gozoinks commented 6 years ago

Ah, so no AppleTV? No iPad? If you can access the streams through home app from outside the LAN, then -something- is acting as a home hub…

jnanes commented 6 years ago

Yes I do have two apple TVs sorry I didn’t specify that :)

Thanks,

Jesse Nanes

On May 4, 2018, 6:21 PM -0400, John Burwell notifications@github.com, wrote:

Ah, so no AppleTV? No iPad? If you can access the streams through home app from outside the LAN, then -something- is acting as a home hub… — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jnanes commented 6 years ago

Doubt you are interested but if you wanted to look at my setup I can get you connected with something easily .

Thanks,

Jesse Nanes

On May 4, 2018, 6:21 PM -0400, John Burwell notifications@github.com, wrote:

Ah, so no AppleTV? No iPad? If you can access the streams through home app from outside the LAN, then -something- is acting as a home hub… — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jnanes commented 6 years ago

@gozoinks I troubleshot this further and found somehow my Ubuntu VM running homebridge had two IP's assigned. 10.5.5.3 & 10.5.5.116 - I removed the 2nd and it is now working on my LAN and Remote. Thanks for the responses and sorry for any time I wasted.

Looking forward to any future releases and appreciate all your hard work on this project!!!!

thesteev commented 6 years ago

So I tried jnanes instructions from April 29th and the cameras didn't return. I'm still stumped. When I removed the Homebridge and re-added it, all of the other accessories were able to be re-added without issue. @gozoinks, any thoughts for how to get these to work again?

gozoinks commented 6 years ago

@thesteev I don’t think you’re doing anything wrong. It sounds like something between HomeKit and homebridge.

If you’ve deleted the homebridge cache files and it didn’t help and you’re seeing the cameras in your homebridge log, then I think everything with the plugin is probably working correctly and the issue lies either with homebridge or between homebridge and HomeKit.

gozoinks commented 6 years ago

You might try the latest version, which pulls more detail from the cameras and might help to get past some sort of “HomeKit is ignoring a previously-seen UUID” type issue.

thesteev commented 6 years ago

The latest version of this plug-in or the latest version of Homebridge?

thesteev commented 6 years ago

The reason I ask is that I had upgraded to the latest version of Homebridge earlier in the evening yesterday before trying to reset the cache.

The latest version of this plug-in is from December 2016. Are you going to be putting out a new release any time soon?

jnanes commented 6 years ago

I too am interested to know latest version of which @gozoinks :)

Thanks for all the work on this, mine is working now and I love it, but would like to ensure I get updated, I see commits but not sure how to update or if I can till you release.

gozoinks commented 6 years ago

Github was a few commits ahead of npm. I've updated the npm package.

Pursue these connection issues in the UBNT forums, if you would, unless you have identified something keeping this plugin from working. And thank you!

thesteev commented 6 years ago

Just FYI, I was able to re-add them back to the Home app after applying your update. Great job—and thank you!