Friday, December 30, 2016

Ispy and off premises storage using AWS S3

Nice little windows program for surveillance using webcams.   Offloading snapshots and videos to s3 storage using s3cmd and monitoring video directory structure with inotify.  Windows storage is set to save files on windows samba mount provided by linux vm running on same windows machine (inotify does not work with network drives).  Good enough for now, but need to better organize uploads.  Perhaps by webcam and need to filter out thumbnails.

My script:

Web commands working with ispy:

Tuesday, December 20, 2016

Rasperry Pi 2 - boot from USB

Change boot device in cmdline.txt to /dev/sda2:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes fsck.mode=force rootwait

Still boots from SD Card first, but USB is supposedly faster.  Nice article here on the full procedure:

https://www.stewright.me/2013/05/install-and-run-raspbian-from-a-usb-flash-drive/

To write image to usb drive, use this command from within linux VM:

> $ sudo dd if=raspbx-22-09-2016.img of=/dev/sdb

7626752+0 records in
7626752+0 records out
3904897024 bytes (3.9 GB) copied, 1875.02 s, 2.1 MB/s


Sunday, December 18, 2016

Django - JSON API for incoming POST

Need a way to bring in a POST with JSON data and django appears to be workable.  sqlite and webserver built-in for quick prototype.  I'm now able to receive an SMS and log the JSON data.

Installing Django:

   14  wget https://bootstrap.pypa.io/get-pip.py
   16  python get-pip.py
   28  pip install Django
   90  pip install sh

python manage.py runserver 0.0.0.0:8000

Tuesday, December 13, 2016

False Alarms

Getting false alarms from the garage reed switch.  Fairly reliable, but every now and then it gets tripped.  Need to narrow down which one is tripping - 9:51 is false alarm:

12/05/2016 05:43:35 AM alarm tripped 0xAF
12/12/2016 09:51:35 AM alarm tripped 0x9F
12/12/2016 08:36:31 PM alarm tripped 0x9F
12/13/2016 09:29:15 AM alarm tripped 0xCF