BrandonJoffe / home_surveillance

Home surveillance system with facial recognition
1.22k stars 384 forks source link

Alarm System #31

Open vahid-dan opened 7 years ago

vahid-dan commented 7 years ago

Hi;

I was wondering if the alarm system is fully implemented and operable. Has anyone used it so far? @BrandonJoffe @mathieuduperre @gauravkaila

Thanks, Vahid

BrandonJoffe commented 7 years ago

Hi Vahid,

the implementation is currently a proof of concept, you could wire it up to your alarm panel using a raspberry pi. However, there is lots of work to be done before it can be considered "fully implemented".

I did not include any security measures or encryption of any kind, so someone sniffing packets on your network could potentially gain full control of your alarm system.

I would like to spend some time on this when I get a chance, also feel free to work on it if you have any ideas.

Cheers, Brandon

vahid-dan commented 7 years ago

Brandon,

Thanks for your quick response. I'd like to use it for a demo. So the security issues are not my concern. A simple alarm system that can send an email as soon as a specific person has recognized, would be enough for my demo. Does the current implementation do this?

Thanks again; Vahid

BrandonJoffe commented 7 years ago

Yes it does :)

There is also a free app you can download and integrate into the system called instapush which will send you push notifications as appose to email notifications. I originally integrated it into the system but landed up taking it out for my thesis.

Currently, the email notification includes an image snapshot of the event that occurs.

Brandon

vahid-dan commented 7 years ago

Nice! I couldn't find any instructions for enabling the alarm system. On the RPi, I suppose I need to setup docker, clone the repo and run rpi-alarm/alarmAPI.py. That's it? I'd love to give it a shot.

Thanks a lot.

Vahid

BrandonJoffe commented 7 years ago

You don't actually need docker thankfully.

All you'll need to do is install flask on the RPI and maybe one or two other dependencies. Other than that you should be able to run rpi-alarm/alarmAPI.py and use the respective GPIO pins for the alarm panel integration.

You may have to adjust the code a little to suit your particular needs.

Keep me posted with your progress.

Brandon

vahid-dan commented 7 years ago

Hi @BrandonJoffe;

Thanks for your explanation. I installed flask on the RPi and after fixing a few indentation problems in the code, ran rpi-alarm/alarmAPI.py. This is the error I got:

 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
alarmAPI.py:49: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(pin, GPIO.OUT)
 * Debugger is active!
 * Debugger PIN: 772-382-386
/usr/local/lib/python2.7/dist-packages/werkzeug/filesystem.py:63: BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem: Will use UTF-8 as filesystem encoding instead of 'ANSI_X3.4-1968'
  BrokenFilesystemWarning)
127.0.0.1 - - [28/Mar/2017 15:09:11] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1994, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1615, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1630, in finalize_request
    response = self.make_response(rv)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1725, in make_response
    raise ValueError('View function did not return a response')
ValueError: View function did not return a response
127.0.0.1 - - [28/Mar/2017 15:09:12] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [28/Mar/2017 15:09:12] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Mar/2017 15:09:12] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [28/Mar/2017 15:09:13] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [28/Mar/2017 15:09:13] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

Note that I didn't touch any GPIO pins. I don't need to integrate any alarm device. I just need the email alerts. Any idea?

Thanks, Vahid

vahid-dan commented 7 years ago

Hi @BrandonJoffe;

Do you think it is something we can fix easily?

Thanks, Vahid

BrandonJoffe commented 7 years ago

Hey @vdaneshmand,

sorry for the delay.

What OS and which raspberry PI are you currently using?

Brandon

vahid-dan commented 7 years ago

Hi @BrandonJoffe,

I am using the latest Raspbian on a RPi 3.

Vahid

BrandonJoffe commented 7 years ago

Hi @vdaneshmand,

I didn't encounter this issue when I was testing on the RPI 3 also with the latest Raspbian.

Unfortunately, I can't try replicate the error at this time, as I do not have the raspberry Pi at my disposal anymore.

Please let me know if you make any progress.

Brandon

yurir commented 6 years ago

Hi @vdaneshmand, Did you succeed to run alarm system?

vahid-dan commented 6 years ago

Hi @yurir;

I didn't put a lot of effort into that. No success.

Vahid

vhosakot commented 6 years ago

I saw the BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem error too. After digging the code, I saw that this error is harmless and just a warning in /usr/local/lib/python2.7/dist-packages/werkzeug/filesystem.py:

        warnings.warn(
            'Detected a misconfigured UNIX filesystem: Will use UTF-8 as '
            'filesystem encoding instead of {0!r}'.format(rv),
            BrokenFilesystemWarning)

So, I would not worry about the BrokenFilesystemWarning: Detected a misconfigured UNIX filesystem warning.