Saturday, December 17, 2016

Hamburg Hacker Friday - MotionEyeOS

Many thanks to JörgC for taking the initiative to organize our Friday afternoon get-together.

Here my quick notes, tipps to setup a security camera with Raspberry:


MotionEyeOS - Hardware Recommendations

  • get the Raspi3
  • 8MP cam modules side by side
    (infrared pic on right - without the filter)
    • Wifi already onboard
      (no need to buy a Wifi dongle)
    • more CPU Performance (RPI1 was constantly at 90+% load, RPI3 only 25%)
  • get the new 8MP camera modules (I bought one for day and the InfraRed for night shots)
  • power cord, SD Card, and a suitable case

MotionEyeOS - Basic Installation

  • download image from https://github.com/ccrisan/motioneyeos/releases
    (it makes a difference...e.g. the RPi 3 Image is configured to use the 4 CPU cores)
  • write the Image to SD Card
    (Win32DiskImager https://www.heise.de/download/product/win32-disk-imager-92033.
    On Win10 make sure to launch with admin rights - shift-ctrl-click)
  • connect Raspi with LAN cable first, check IP address on your WLAN router
  • browse to \\ip-address\ and login with user admin (no password)
  • Basic configuration
  • MotionEyeOS configuration
    • Hostname
    • secure user+password (admin + viewer)
    • Wifi credentials
    • Resolution/Framerate (on RPi you can safely go to max Settings)
    • Do not use "automatic brightness" (did not work at all for me...)
    • now properly shut down
  • Now power up without LAN cable (should connect to your wifi, check on your Wifi router)
    • set fixed IP address for your MotionEyeCam
      (caution: LAN and WLAN have different MAC addresses...)
  • Access the recorded pictures/vids via Web-GUI, per FTP or per fileshare (\\ipaddress\)
  • More configuration
    • Email notification
    • upload to Dropbox or Google Drive
    • carefully tweak the sensitivity of the Motion detection...
    • create mask for motion detection (e.g. for trees or other "false triggers")

MotionEyeOS - Advanced Config

MotionEyeOS - Next Steps

  • use GPIO pins to launch actions when motion is detected (siren, LEDs, 1000-W-Laser...)
  • create scripts to automatically download/process the Pictures
  • create script to provide daily digest (with timeline and thumbnails)
  • add InfraRed lighting for better night shots

Further Reference



Good luck and fun with your new toy!

Sunday, December 4, 2016

My first steps with AWS Lightsail

It is Sunday evening, it is quiet in the house.
Perfect time to play with my new toys.

I just spun up my own virtual server on Amazon AWS Lightsail.
Just amazing how fast and easy that is...literally takes just a few minutes:
  • go to AWS Lightsail (with a valid AWS account)
  • pick your instance Image (plain OS with/without stack like Wordpress, NGINX...)
  • choose the plan (I picked the 5US$ one)
  • select a Name for your instance
  • click on CREATE
  • around a minute later you can access your own VPS via SSH in the browser. Whoa!


As I wanted to setup a simple web server and reverse Proxy I chose to manually install NGINX (the pre-packaged Comes with PHP and many other goodies I don't need. yet.).
  • install NGINX (sudo apt-get install nginx)
  • update the HTML pages in the default Location 
  • install GOACCESS.IO to analyze the web logs
  • setup a cron-job to update the GOACCESS html report every 10 minutes
  • create a DNS-record in my own Domain (aws.gemelli2day.com)
  • boom - ready: my own static Website hosted on my own virtual private Server!
After a few hours I can see the activity in the Lightsail Dashboard. It is alive!


And what took the longest? Exactly, the Content:

Picking a new HTML5 template and adding some text/content.

Setting up a reverse proxy with NGINX and port forwarding to another NGINX instance...

Finetuning the subdomain/Proxy configuration...

Let's see how this works out...maybe time to retire my Homepage that is still hosted on Google App Engine.

But then...Hosting a few static pages (and reverse proxying)


What's next?

Now, what else can I do with this little Server? My own Proxy/VPN to circumvent geo-fencing?

Terminating my ADS-B experiments....for good reason

I've been running my own ADS-B logger for some months now and I learned many things. And while I am excited about the "endless" possibilities, I have started to reach some limits with my experiments:

The Limits of Radio Reception

Hamburg Low Altitude out of range...
Yes, I was surprised how much reception I did achieve with that tiny antenna on my USB dongle. But it became very clear that I missed most of the arriving/departing flights over Hamburg at low altitude. To improve coverage I would have had to install a bigger antenna or simply joined/used the data feed from FR24.com or adsbexchange.com. And yes, I was too cheap to go for a 1090 amplifier/filter or that famous FR24 dongle.


The Limits of the Free-Tier on AWS RDS


I did upload my aggregated ADS-B data to a free Amazon mySQL instance (free tier, free for one year). Great learning experience, but as the data accumulated the CPU utilization did go up. I would have had to clean up the data, or to switch to a bigger instance. Again, I was too cheap to go spend money on a bigger DB that would essentially host only my data.

The Limits of my own Attention Span

The other effect I experienced was the lack of new challenges.

Yes, the ADS-B logging worked fine, the mySQL upload as well, the analytics with cartodb.com is fun.  So where do I go from here?

At work, I have access to full 2 years of FR24 data and some powerful analytics tools. That allows me to tinker and explore with massive aircraft data - much much more than I could ever handle (the 2 week data set for testing alone has 200Mio entries).



My old Raspberry PI was re-purposed as a surveillance camera with the fabulous MotionEyeOS package. Highly recommended..sure beats all the commercially available products out there (especially when you use the new 8MP camera module on an RPi3).

And Amazon AWS? I deleted my RDS instance (before I forget and incur cost).  Now I'm experimenting with AWS Lightsail...articles to follow shortly.




Keep on learning...!