I am struggling with the configuration of the zoneminder configuration, and I suspect the origin lies in the zoneminder’s server running httpd AND zm on port 777, not port 80, but my HASSBIAN installation queries it on port 80.
equests.exceptions.ConnectionError: HTTPConnectionPool(host=‘lefanu’, port=80): Max retries exceeded with url: /zm//index.php (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7508d910>: Failed to establish a new connection: [Errno 111] Connection refused’,))
I have not yet configured a sensors.yaml or switch.yaml, and I don’t know if the absence of those files is germane, given the attempts to query port 80.
I tried both ports 777 and 80, but to no avail. I know the credentials are good, because I can log into the web interface. I also know the server running zoneminder is listening on both ports 80 and 7777 (see below):
root@LeFanu:/etc/apache2# telnet localhost 80
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
root@LeFanu:/etc/apache2# telnet localhost 7777
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
I also verified that iptables is configured to let connections from the HASSBIAN server on both those ports
-A INPUT -s 192.168.10.115/32 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -s 192.168.10.115/32 -p tcp -m tcp --dport 7777 -j ACCEPT
what version of zoneminder are you using?
are you still using the default path for zonemonder http://[IP:Port]/zm
is zoneminder setup with SSL?
equests.exceptions.ConnectionError: HTTPConnectionPool(host=‘lefanu’, port=80): Max retries exceeded with url: /zm//index.php (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7508d910>: Failed to establish a new connection: [Errno 111] Connection refused’,))
Also in the error message, you have posted note the // in the middle of the Max retries exceeded with URL.
I am using version 1.29; no ssl; and all paths kept to the defaults, including port 7777 at localhost. I am running ZM on one raspberry pi, running raspian jessie, which I patched to current levels Saturday (including the kernel). Let me know if I should post any logs in their entirety or just sections.
I tried to pass curl credentials, but I think I needed to embed/encapsulate/offset them somehow, and it was after ten pm when I got this far. As a point of reference, this was my written path for the install: ZoneMinder Wiki - Wiki - Raspbian
Until yesterday, Zoneminder only listened on port 7777, but I added 80 to /etc/apache2/conf/ports.conf and restarted apache. Then, once I realized telnet client was missing and I added it via apt-get, I was able to telnet to both 80 and 7777 – from localhost on the zoneminder and from the homeassistant user on the hassbian host referenced as ‘stoker’ in the zoneminder host (lefanu)'s iptables files.
Sounds like an authentication issue, try disabling the auth in Zoneminder and remove the username/pass from home assistant. I use my zoneminder without auth and HA is able to access it just fine.
I think I am going to restart zoneminder, then restart home assistant to see if I get a different outcome. Unless you don’t think that’s a useful diagnostic step?
(homeassistant) homeassistant@hassbian:~ $ grep -i connection .homeassistant/home-assistant.log
2017-11-29 20:06:20 ERROR (Thread-11) [homeassistant.components.zoneminder] Connection error logging into ZoneMinder
(homeassistant) homeassistant@hassbian:~ $ date
Wed 29 Nov 22:45:37 UTC 2017
That is sound advice, but those are literally the only two lines that come up in /home/homeassistant/.homeassistant/homeassistant.log when the system starts up; after that, nothing else shows up; perhaps the other output gets written to another log?
What I find interesting is that a) opt_auth is turned off in the ZM options; and I just reconfirmed I can telnet to the zm host on ports 80 and 7777. I think I need to look at the access and error logs on the zm host, but I’m not sure if the failure to connect is app-based or apache-centric.
and it’ll tell you if everything is alright with your zoneminder CakePHP installation. In my case, mod_rewrite wasn’t working and that was because I had AllowOverride None for the Zoneminder html directory in apache2/sites-enabled/000-default.conf … I fixed that, restarted apache2, and restarted HA and I can see my cameras.