on my 4k (#1) I enabled UPnP. On the same network, in another Kodi (#2) instance I want to connect to osmc (#1). It looks good at first, #2 sees #1 and I can connect #2 to #1 but then it drops the connection. Restarting #1 cures the problem but only briefly.
I have been using UPNP Library sharing between RPi’s for over a year (both running OSMC). It’s very stable for me, especially since Kodi 17 I feel it is now mature.
(it’s just not well integrated in skins unfortunately, but you can customise that).
Even newly added content shows quickly on the UPNP client (this used to be an issue).
Perhaps you need to enable UPNP in your router? I did that.
On my old Zyxel router, UPNP Library didn’t work without that checkbox in my router enabled. But that was a very crappy router, perhaps on normal routers you don’t need to enable it.
I’m using an Asus router with advancedtomato. I normally would activate UPnP if I wanted to provide directories from an attached harddrive via UPnP. Since I don’t want this I don’t see much sense in activating it. But I might give it a try you never know