BrandonJoffe / home_surveillance

Home surveillance system with facial recognition
1.23k stars 385 forks source link

Cannot get to work beyond a few minutes, seems to encounter errors as soon as motion is detected #51

Open mondjef opened 6 years ago

mondjef commented 6 years ago

here are the errors I am seeing on the console...the ip addresses I do not recognize, I assume one is the ip address of the docker container instance.

Exception happened during processing of request from ('192.168.0.70', 45884)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
    self.wfile.close()
  File "/usr/lib/python2.7/socket.py", line 279, in close
    self.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------

Exception in thread Thread-132:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_socketio-1.4.2-py2.7.egg/socketio/server.py", line 458, in _handle_eio_message
    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
  File "/usr/local/lib/python2.7/dist-packages/python_socketio-1.4.2-py2.7.egg/socketio/server.py", line 400, in _handle_event
    r = self._trigger_event(data[0], namespace, sid, *data[1:])
  File "/usr/local/lib/python2.7/dist-packages/python_socketio-1.4.2-py2.7.egg/socketio/server.py", line 426, in _trigger_event
    return self.handlers[namespace][event](*args)
  File "/usr/local/lib/python2.7/dist-packages/Flask_SocketIO-2.6-py2.7.egg/flask_socketio/__init__.py", line 196, in _handler
    ret = handler(*args)
  File "WebApp.py", line 340, in panic
    HomeSurveillance.trigger_alarm()
  File "/host/docker/home_surveillance/system/SurveillanceSystem.py", line 873, in trigger_alarm
    r = requests.post('http://192.168.1.35:5000/trigger', data={"password": "admin"})
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post
    return request('post', url, data=data, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 378, in send
    raise ConnectionError(e)
ConnectionError: HTTPConnectionPool(host='192.168.1.35', port=5000): Max retries exceeded with url: /trigger (Caused by <class 'socket.error'>: [Errno 110] Connection timed out)
BrandonJoffe commented 6 years ago

hey @mondjef,

unfortunately I didn't add functionality in the gui to change the IP address of the alarm interface (or simply turn it off), which in my case was the raspberry pi.

The IP address 192.168.1.35, was the IP address of the raspberry pi on my network and does not exist on your network :). It looks like it attempted to trigger the alarm (r = requests.post('http://192.168.1.35:5000/trigger)) which raised an exception after the max number of attempts to connect exceeded.

mondjef commented 6 years ago

this is what I was thinking but was not sure and had not went into the code much yet. I will look to disable it at least in the code and see if I can get to work well. I may just roll my own using yours as an inspiration and guide but was thinking using the new DNN modules of OpenCV to do the face detection part as I am not using a respberry pi and have a little more resources to work with. Thanks for the reply and thanks for creating this in the first place as I am sure its provided a lot of inspiration to others like myself.

edit: just realized that you used Openface which is already using DNN in its implementation...