hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
552 stars 51 forks source link

"External port pool ran out of ports" error when attempting to unbridge camera in homebridge-camera-ffmpeg #934

Closed rvs007 closed 4 years ago

rvs007 commented 4 years ago

Description A clear and concise description of what the plugin is doing.

Attempted to add a "unbridge": true, parameter to the cameras in the plugin Homebridge-camera-ffmpeg to speed up query/response time for multiple cameras, but met with an "External port pool ran out of ports. Fallback to random assigned." error in log, and the unbridged cameras doesn't appear when trying to add manually to HOOBS.

Expected behavoir Please let us know what the plugin is supposed to do.

Unbridged cameras should appear when trying to add accessories manually in the HOME.app.

Plugin name Please let us know what the plugin name is. We need to be able to find it on NPM.

homebridge-camera-ffmpeg

Please report the issue to the plugin developer We like to help the community, however some issues are out of our control. Please report this to the plugin developer and include a link here.

The plugin developer suggested I report the external port pool error as that doesn't appear to be related to the plugin.

Version Please include the version of HOOBS you are using.

HOOBS 3.2.9 Node 12.16.2

Did you upgrade Please let us know if you upgraded from a previous version.

Pervious version If you upgraded, please let us know your previous version.

Did you orginally upgrade to HOOBS 3 from HOOBS 2.1.1? Did you perform an upgrade from HOOBS 2.1.1? Some things are different.

What device are you using? Please let us know the device you are running HOOBS on.

If this is a custom install, what's your operating system? Please let us know what operating system and version you are using. Ex. Fedora 30 or macOS Catalina.

Raspian 10 (kernel 4.19.97-v7l+) on Rasberry Pi 4

Post your config This can be found in the interface, Configuration -> Advanced or you can get it via SSH cat ~/.hoobs/etc/config.json

{
    "server": {
        "port": 8080,
        "autostart": 10,
        "home_setup_id": "X-HM://xxxxxxxxxxxxxxxx",
        "polling_seconds": 5,
        "origin": "*"
    },
    "client": {
        "default_route": "status",
        "inactive_logoff": 60,
        "theme": "hoobs-dark",
        "locale": "en",
        "temp_units": "celsius",
        "country_code": "CA",
        "postal_code": "xxxxxxxxxxxxxxxx"
    },
    "bridge": {
        "name": "HOOBS",
        "port": xxxxxxxxxxxxxxxx,
        "pin": "xxxxxxxxxxxxxxxx",
        "username": "xxxxxxxxxxxxxxxx"
    },
    "description": "",
    "ports": {},
    "accessories": [
        {
            "accessory": "Pihole",
            "plugin_map": {
                "plugin_name": "homebridge-pihole",
                "index": 0
            },
            "name": "Pihole",
            "ssl": false,
            "host": "localhost",
            "port": 80,
            "baseDirectory": "/admin/",
            "time": 300,
            "reversed": false,
            "logLevel": 1,
            "auth": "xxxxxxxxxxxxxxxx"
        }
    ],
    "platforms": [
        {
            "platform": "SmartThings-v2",
            "plugin_map": {
                "plugin_name": "homebridge-smartthings-v2"
            },
            "name": "SmartThings-v2",
            "direct_port": 8000,
            "local_commands": true,
            "temperature_unit": "C",
            "validateTokenId": false,
            "disableErrorReporting": false,
            "logConfig": {
                "debug": false,
                "showChanges": true,
                "hideTimestamp": false,
                "hideNamePrefix": false,
                "file": {
                    "enabled": true,
                    "level": "Good"
                }
            },
            "app_url": "xxxxxxxxxxxxxxxx",
            "app_id": "xxxxxxxxxxxxxxxx",
            "access_token": "xxxxxxxxxxxxxxxx"
        },
        {
            "platform": "Nest",
            "access_token": "xxxxxxxxxxxxxxxx",
            "plugin_map": {
                "plugin_name": "homebridge-nest"
            },
            "email": "xxxxxxxxxxxxxxxx",
            "password": "xxxxxxxxxxxxxxxx",
            "name": "Nest"
        },
        {
            "platform": "Envisalink",
            "host": "xxxxxxxxxxxxxxxx",
            "deviceType": "DSC",
            "password": "xxxxxxxxxxxxxxxx",
            "pin": "xxxxxxxxxxxxxxxx",
            "suppressZoneAccessories": false,
            "suppressClockReset": false,
            "partitions": [
                {
                    "name": "Alarm"
                }
            ],
            "zones": [
                {
                    "name": "Front Entrance",
                    "type": "door",
                    "partition": 1,
                    "zoneNumber": 1
                },
                {
                    "name": "Garage Entrance",
                    "type": "door",
                    "partition": 1,
                    "zoneNumber": 2
                },
                {
                    "name": "Motion Sensor",
                    "type": "motion",
                    "partition": 1,
                    "zoneNumber": 3
                },
                {
                    "name": "Patio Door",
                    "type": "door",
                    "partition": 1,
                    "zoneNumber": 4
                },
                {
                    "name": "Basement Windows",
                    "type": "door",
                    "partition": 1,
                    "zoneNumber": 5
                }
            ],
            "plugin_map": {
                "plugin_name": "homebridge-envisalink"
            }
        },
        {
            "platform": "HarmonyHubWebSocket",
            "plugin_map": {
                "plugin_name": "homebridge-harmony"
            },
            "name": "Harmony Hub",
            "hubIP": "xxxxxxxxxxxxxxxx"
        },
        {
            "platform": "Ring",
            "plugin_map": {
                "plugin_name": "homebridge-ring"
            },
            "refreshToken": "xxxxxxxxxxxxxxxx",
            "avoidSnapshotBatteryDrain": false,
            "sendCameraMotionNotificationsToTv": true,
            "sendDoorbellMotionNotificationsToTv": false,
            "hideCameraSirenSwitch": true,
            "hideCameraMotionSensor": true,
            "hideInHomeDoorbellSwitch": true,
            "hideDoorbellSwitch": true,
            "hideAlarmSirenSwitch": true,
            "hideUnsupportedServices": true,
            "showPanicButtons": false
        },
        {
            "platform": "Camera-ffmpeg",
            "plugin_map": {
                "plugin_name": "homebridge-camera-ffmpeg"
            },
            "name": "Camera FFmpeg",
            "cameras": [
                {
                    "name": "Street",
                    "unbridge": true,
                    "videoConfig": {
                        "source": "-i rtsp://xxxxxxxxxxxxxxxx/live",
                        "stillImageSource": "-i rtsp://xxxxxxxxxxxxxxxx/live -vframes 1 -r 1",
                        "vcodec": "h264_omx"
                    }
                },
                {
                    "name": "Porch",
                    "videoConfig": {
                        "source": "-i rtsp://xxxxxxxxxxxxxxxx/live",
                        "stillImageSource": "-i rtsp://xxxxxxxxxxxxxxxx/live -vframes 1 -r 1",
                        "vcodec": "h264_omx"
                    }
                },
                {
                    "name": "Backyard",
                    "videoConfig": {
                        "source": "-i rtsp://xxxxxxxxxxxxxxxx/live",
                        "stillImageSource": "-i rtsp://xxxxxxxxxxxxxxxx/live -vframes 1 -r 1",
                        "vcodec": "h264_omx"
                    }
                },
                {
                    "name": "Garage",
                    "videoConfig": {
                        "source": "-i rtsp://xxxxxxxxxxxxxxxx/live",
                        "stillImageSource": "-i rtsp://xxxxxxxxxxxxxxxx/live -vframes 1 -r 1",
                        "vcodec": "h264_omx"
                    }
                },
                {
                    "name": "Study Room",
                    "videoConfig": {
                        "audio": true,
                        "debug": false,
                        "maxBitrate": 2000,
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 15,
                        "maxStreams": 2,
                        "source": "-i rtsp://xxxxxxxxxxxxxxxx/unicast",
                        "stillImageSource": "-i https://xxxxxxxxxxxxxxxx/cgi-bin/currentpic.cgi",
                        "vcodec": "copy",
                        "additionalCommandline": "-fflags +genpts+discardcorrupt"
                    }
                },
                {
                    "name": "Main Floor",
                    "videoConfig": {
                        "audio": true,
                        "debug": false,
                        "maxBitrate": 2000,
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 15,
                        "maxStreams": 2,
                        "source": "-i rtsp://xxxxxxxxxxxxxxxx/unicast",
                        "stillImageSource": "-i https://xxxxxxxxxxxxxxxx/cgi-bin/currentpic.cgi",
                        "vcodec": "copy",
                        "additionalCommandline": "-fflags +genpts+discardcorrupt"
                    }
                }
            ]
        },
        {
            "platform": "myQ",
            "plugin_map": {
                "plugin_name": "homebridge-myq"
            },
            "email": "xxxxxxxxxxxxxxxx",
            "password": "xxxxxxxxxxxxxxxx",
            "name": "myQ"
        }
    ]
}

Post your log You can get the log from the intercafe. This is in the Log section.

11/29/2020, 11:16:45 AM Loaded plugin 'homebridge-camera-ffmpeg'
11/29/2020, 11:16:45 AM [11/29/2020, 11:16:45 AM] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg'
11/29/2020, 11:16:45 AM Loaded plugin 'homebridge-envisalink'
11/29/2020, 11:16:45 AM [11/29/2020, 11:16:45 AM] Registering platform 'homebridge-envisalink.Envisalink'
11/29/2020, 11:16:45 AM Loaded plugin 'homebridge-harmony'
11/29/2020, 11:16:45 AM [11/29/2020, 11:16:45 AM] Registering platform 'homebridge-harmony.HarmonyHubWebSocket'
11/29/2020, 11:16:45 AM Loaded plugin 'homebridge-myq'
11/29/2020, 11:16:45 AM [11/29/2020, 11:16:45 AM] Registering platform 'homebridge-myq.myQ'
11/29/2020, 11:16:45 AM Loaded plugin 'homebridge-nest'
11/29/2020, 11:16:45 AM [11/29/2020, 11:16:45 AM] Registering platform 'homebridge-nest.Nest'
11/29/2020, 11:16:45 AM Loaded plugin 'homebridge-pihole'
11/29/2020, 11:16:45 AM [11/29/2020, 11:16:45 AM] Registering accessory 'homebridge-pihole.Pihole'
11/29/2020, 11:16:46 AM Loaded plugin 'homebridge-ring'
11/29/2020, 11:16:46 AM [11/29/2020, 11:16:46 AM] Registering platform 'homebridge-ring.Ring'
11/29/2020, 11:16:46 AM Loaded plugin 'homebridge-smartthings-v2'
11/29/2020, 11:16:46 AM [11/29/2020, 11:16:46 AM] Registering platform 'homebridge-smartthings-v2.SmartThings-v2'
11/29/2020, 11:16:46 AM Loading 7 platforms...
11/29/2020, 11:16:46 AM [SmartThings-v2] Initializing SmartThings-v2 platform...
11/29/2020, 11:16:47 AM [11/29/2020, 11:16:47 am] [SmartThings-v2] INFO: Homebridge Version: 2.6
11/29/2020, 11:16:47 AM [11/29/2020, 11:16:47 am] [SmartThings-v2] INFO: SmartThings-v2 Plugin Version: 2.3.4
11/29/2020, 11:16:47 AM [11/29/2020, 11:16:47 am] [SmartThings-v2] INFO: Checking Package Version for Updates...
11/29/2020, 11:16:47 AM [Nest] Initializing Nest platform...
11/29/2020, 11:16:47 AM [Envisalink] Initializing Envisalink platform...
11/29/2020, 11:16:47 AM [Envisalink] Configuring Envisalink platform,  Host: xxxxxxxxxxxxxx, port: undefined, type: DSC
11/29/2020, 11:16:47 AM [Envisalink] Generated UUID xxxxxxxxxxxxxx for accessory ID envisalink.1
11/29/2020, 11:16:47 AM [Envisalink] Generated UUID xxxxxxxxxxxxxx for accessory ID envisalink.1.1
11/29/2020, 11:16:47 AM [Envisalink] Generated UUID xxxxxxxxxxxxxx for accessory ID envisalink.1.2
11/29/2020, 11:16:47 AM [Envisalink] Generated UUID xxxxxxxxxxxxxx for accessory ID envisalink.1.3
11/29/2020, 11:16:47 AM [Envisalink] Generated UUID xxxxxxxxxxxxxx for accessory ID envisalink.1.4
11/29/2020, 11:16:47 AM [Envisalink] Generated UUID xxxxxxxxxxxxxx for accessory ID envisalink.1.5
11/29/2020, 11:16:47 AM [Envisalink] Starting node alarm proxy...
11/29/2020, 11:16:47 AM [Envisalink] Zone Config: 5
11/29/2020, 11:16:47 AM [Envisalink] User Program Config: null
11/29/2020, 11:16:47 AM [Envisalink] Node alarm proxy started.  Listening for connections at: 0.0.0.0:4026
11/29/2020, 11:16:47 AM Initializing platform accessory 'Alarm'...
11/29/2020, 11:16:47 AM Initializing platform accessory 'Front Entrance'...
11/29/2020, 11:16:47 AM Initializing platform accessory 'Garage Entrance'...
11/29/2020, 11:16:47 AM Initializing platform accessory 'Motion Sensor'...
11/29/2020, 11:16:47 AM Initializing platform accessory 'Patio Door'...
11/29/2020, 11:16:47 AM Initializing platform accessory 'Basement Windows'...
11/29/2020, 11:16:47 AM [Harmony Hub] Initializing HarmonyHubWebSocket platform...
11/29/2020, 11:16:47 AM [Harmony Hub] HarmonyPlatform Init
11/29/2020, 11:16:47 AM [Ring] Initializing Ring platform...
11/29/2020, 11:16:47 AM [Camera FFmpeg] Initializing Camera-ffmpeg platform...
11/29/2020, 11:16:47 AM [myQ] Initializing myQ platform...
11/29/2020, 11:16:47 AM Loading 1 accessories...
11/29/2020, 11:16:47 AM [Pihole] Initializing Pihole accessory...
11/29/2020, 11:16:47 AM [Harmony Hub] WARNING - configureAccessory - TV accessory added in your bridge from cache, if another plugin is exposing a TV accessory this one might not be visible in your remote widget
11/29/2020, 11:16:47 AM [Ring] Configuring cached accessory xxxxxxxxxxxxxx Front Door
11/29/2020, 11:16:47 AM [Ring] Configuring cached accessory xxxxxxxxxxxxxx Hallway
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Porch] Configuring cached bridged accessory...
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Backyard] Configuring cached bridged accessory...
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Garage] Configuring cached bridged accessory...
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Study Room] Configuring cached bridged accessory...
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Main Floor] Configuring cached bridged accessory...
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Street] Configuring cached bridged accessory...
11/29/2020, 11:16:47 AM [11/29/2020, 11:16:47 am] [SmartThings-v2] INFO: Fetching SmartThings-v2 Devices. NOTICE: This may take a moment if you have a large number of device data is being loaded!
11/29/2020, 11:16:47 AM [11/29/2020, 11:16:47 am] [SmartThings-v2] GOOD: Refreshing All Device Data | Source: (First Launch)
11/29/2020, 11:16:47 AM [Nest] Fetching Nest devices.
11/29/2020, 11:16:47 AM [Harmony Hub] DidFinishLaunching
11/29/2020, 11:16:47 AM [Harmony Hub] (Harmony Hub)INFO - Loading activities...
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Street] Configuring unbridged accessory...
**11/29/2020, 11:16:47 AM External port pool ran out of ports. Fallback to random assign.**
11/29/2020, 11:16:47 AM [Camera FFmpeg] [Street] Removing bridged accessory...
11/29/2020, 11:16:47 AM Street is running on port 37335.
11/29/2020, 11:16:47 AM Please add [Street] manually in Home app. Setup Code: xxxxxxxxxxxxxx
11/29/2020, 11:16:47 AM Bridge is running on port 51826.
11/29/2020, 11:16:47 AM server bound
11/29/2020, 11:16:47 AM actual connected
11/29/2020, 11:16:47 AM Login Request Response: 3
11/29/2020, 11:16:47 AM login requested... sending response...
11/29/2020, 11:16:47 AM sendcommand 005user54
11/29/2020, 11:16:47 AM Command 005 Acknowledged
11/29/2020, 11:16:47 AM Login Request Response: 1
11/29/2020, 11:16:47 AM successfully logged in!  getting current data...
11/29/2020, 11:16:47 AM sendcommand 00191
11/29/2020, 11:16:47 AM Command 001 Acknowledged
11/29/2020, 11:16:47 AM Zone 001 is restored
11/29/2020, 11:16:47 AM [Envisalink] System status changed to:  {

Additional context Add any other context about the problem here.

mkellsy commented 4 years ago

I think you need to set the port pool for non-bridged cameras.

...
"ports": {
    "start", XXXX,
    "end", XXXX
},
...
rvs007 commented 4 years ago

Thanks... I've found the issue with the cameras not being added in the Home app. I had to change the camera name to something else, then it would show up to be added. Issue has been resolved.