Author Topic: Marina Security System  (Read 2816 times)

HeneryH

  • Full Member
  • ***
  • Posts: 229
Marina Security System
« on: November 30, 2014, 02:00:15 PM »
I'll be trying to design a security and access control system for a small 11 slip marina.

Goals:
  • Access control to property via sliding chain-link fence gate.
  • Access control to secure areas such as storage and community room.
  • RFID Access control
  • Keypad Access control
  • Remote Web Access cotnrol
  • Gate Open sensor
  • Motion Sensors for property
  • Video surveillance with 48 hr buffer and triggered event long term storage.
  • Water sensors for boats

I'll diary my progress and update this first post with finalized design details.  I see other threads here with similar material and I will be copying/reusing ferociously!

Update - Nov 30, 2014
RFID reader is sensing the cards and sending the Card ID out as a text string over RFM69 message.
OLED Mot is sensing the message and displaying it.

Next, configure a Gateway to interact with a Raspberry Pi which will need to verify the card and send a message back to the door/gate to open it.
« Last Edit: November 30, 2014, 04:38:05 PM by HeneryH »

HeneryH

  • Full Member
  • ***
  • Posts: 229
Re: Marina Security System
« Reply #1 on: November 30, 2014, 03:47:30 PM »
I'll start with the RFID sensor.

There are probably a million ways to go with this but I started with a bunch of Moteinos and the following kit from AdaFruit:



It comes with an Arduino library and sample code at https://learn.adafruit.com/adafruit-pn532-rfid-nfc/arduino-library

Of note, using the sample code with the Moteino, pin #2 is already used by the Moteino Transceiver so you'd need to remap RFID pin #2 elsewhere like 7.

Source code with initial commit for sample code and my changes as edits is at https://bitbucket.org/HeneryH/arduino/src
The sketch was basically gluing the sample Node.ino and RFID.ino sample code together.  The sample RFID code read the RFID tag and printed its details out to the serial monitor.  For this, I converted the 7 byte card ID to a string of hex and sent it out the RFM69.

I used an OLEDMot to test the received codes and display them.

Video of card scan at:  https://plus.google.com/105004766110606181878/posts/3uPQWJL8vRF

« Last Edit: November 30, 2014, 03:53:49 PM by HeneryH »

HeneryH

  • Full Member
  • ***
  • Posts: 229
Re: Marina Security System
« Reply #2 on: December 01, 2014, 12:35:59 PM »
Using Felix's blog post about configuring the gateway and raspberry pi.

http://lowpowerlab.com/blog/2013/10/07/raspberrypi-home-automation-gateway-setup/

The only changes so far are that I am using Samba for file access and a newer version of Nginx.


Felix, note the following very minot comments to your blog post
Quote
  • The mkdir for /var/www/default fails because /var/www isn't there yet.  Maybe put a -p option on the mkdir.
  • Somehow, the -days in the ssl encryption section got converted to a long-dash or something. I had to retype that dash manually.
  • Same problem with the dash getting converted to something else with the following two:
    node –v   (0.10.12)
    npm –v    (1.2.32)
    sudo rm –rf ~/sources
  • There were permission problems tying this in all one line that I couldn't figure out. I broke it into two.  sudo echo -e "USERNAME:`perl -le 'print crypt("PASSWORD","SALT")'`" > sudo /var/www/default/.htpasswd
  • I ran the mkdir below as root but then the npm failed with permission problems.  I'm new to npm but for now just chown'ed the directory back to pi:pi. Updated screenshot attached.
    sudo mkdir ~/moteino
    cd ~/moteino
    npm install serialport
  • Link to socket.io.js is wrong
« Last Edit: December 01, 2014, 02:07:06 PM by HeneryH »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Marina Security System
« Reply #3 on: December 01, 2014, 01:58:24 PM »
I appreciate your feedback. I know others had issues with copy-pasting the commands. Sometimes it's a dash, sometimes a newline, sometimes permissions.
I have to revisit this tutorial with newer sources, I've planned to to this with a new Pi that I got, just it wasn't that critical priority and time is always so limited... but hoping I will have time soon.

HeneryH

  • Full Member
  • ***
  • Posts: 229
Re: Marina Security System
« Reply #4 on: December 01, 2014, 02:25:02 PM »
Almost there.

Any ideas on this error?

pi@raspberrypi ~/moteino $ node chat.js &
[1] 2433
pi@raspberrypi ~/moteino $
/home/pi/moteino/chat.js:9
io.configure(function () {
   ^
TypeError: Object #<Server> has no method 'configure'
    at Object.<anonymous> (/home/pi/moteino/chat.js:9:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

HeneryH

  • Full Member
  • ***
  • Posts: 229
Re: Marina Security System
« Reply #5 on: December 01, 2014, 03:04:41 PM »
Almost there.

Any ideas on this error?

pi@raspberrypi ~/moteino $ node chat.js &
[1] 2433
pi@raspberrypi ~/moteino $
/home/pi/moteino/chat.js:9
io.configure(function () {
   ^
TypeError: Object #<Server> has no method 'configure'
    at Object.<anonymous> (/home/pi/moteino/chat.js:9:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

Ah, frickin version hell.  I'm starting to see what Felix was talking about with versioning. 

 io.configure doesn't exist anymore


Up to this point, blindly copy/pasting from the blog worked fine.  Looks like due to versioning I will need to actually spend some time learning socket.io which isn't the worst thing in the world.  I'll report back once I get it running again.
« Last Edit: December 01, 2014, 03:39:06 PM by HeneryH »