From 00bd2259a3afc65f9aa1b1afb65a5b0f1e09fa52 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 8 Aug 2023 18:34:44 -0400 Subject: [PATCH] Midly improve dlink support. Fix for probing an undefined array --- web/includes/monitor_probe.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/includes/monitor_probe.php b/web/includes/monitor_probe.php index 8acd8d527..26cad16e7 100644 --- a/web/includes/monitor_probe.php +++ b/web/includes/monitor_probe.php @@ -531,18 +531,20 @@ function probeFoscam($ip, $username, $password) { } function probeDLinkInternational($ip, $username, $password) { - if ($username === null) $username = 'root'; + if ($username === null) $username = 'admin'; if ($password === null) $password = ''; $cameras = []; $camera = array( 'ip' => $ip, - 'Name' => 'DLink Camera', + 'Name' => 'D-Link Camera', 'Manufacturer' => 'D-Link', - 'mjpegstream' => 'http://'.$username.':'.$password.'@'.$ip.'/video.cgi', + 'mjpegstream' => 'http://'.$username.':'.$password.'@'.$ip.'/image/jpeg.cgi', 'monitor' => array( 'Manufacturer' => 'D-Link', 'Type' => 'Ffmpeg', - 'Path' => 'http://'.$ip.'/video.cgi', + 'Path' => 'rtsp://'.$username.':'.$password.'@'.$ip.'/live1.sdp', + 'User' => $username, + 'Pass' => $password, 'Host' => $ip, 'Width' => 640, 'Height' => 480, @@ -844,6 +846,7 @@ function probeNetwork() { continue; } $macRoot = str_replace(':', '', substr($mac, 0, 8)); + if (!isset($cameras[$mac])) $cameras[$mac] = []; #ZM\Debug("Got $macRoot from $mac"); if (isset($macBases[$macRoot])) { ZM\Debug("Have match for $macRoot $ip ".$macBases[$macRoot]['type']);