Project Concordia – Update

Where I’m at: 

  1. Concordia.Hub:  A nodejs application that provides the UI dashboard of events and status of the home automation system.  Currently working items are:
    • Google OAUTH authentication
    • Dashboard written in VUE.js
    • Event API to store device data
    • Alexa Skill to read back sensor data by zone
  2. Alexa Skill:  A skill to interact with Amazon’s Alexa voice assistant.
  3. Concordia.Android:  An android application to monitor notifications from the hub as well as send call and message data to the Hub.
  4. Concordia.Sensor (TODO:  change to Concordia.Device):  A generic platform to configure ESP8266 sensor devices to interact with Concordia.Hub
  5. Concordia.DeviceManager:  A serial .Net application to configure the Concordia Device

Where I’m going:

  1. Open Source:  I plan to open up the source code under the MIT license for anyone that may leverage it for their own use.
  2. Continue development on each aspect above.  While the proof of concept pieces are complete, there is a lot that can be improved upon in both features and usability.
  3. RF:  I plan to create sensors that can communicate over RF where wifi is overkill or not possible due to other limitations.
  4. 3D printing enclosures:  I now own a 3D printer, so I plan to build custom enclosures using TinkerCad and eventually EagleCad.

The birth of Project Concordia

Concordia is the Latin word for “harmony,” literally “with (one) heart.”

I have a terrible problem of not feeling my phone vibrate when I receive a text or an email.  My plan is to build a dashboard for my car/work/home that will provide me with all the pertinent information in one place.  This will grow to include home automation and health tracking data.

The ecosystem will be several autonomous systems that are joined with a single “heart” in the cloud.  The first step will be building an alert system for incoming/missed calls and texts.  I plan to run the dashboard on an android tablet, so I’d like to use websockets to push notifications to the dashboard.  To accomplish this, I’ll build an android app that listens for incoming calls and texts and alerts the cloud app, which will in turn push a notification to the dashboard.

This will be an open-source project with the MIT license.

Now what?

So after 2.5 years of dedicating most of my free time to school and family, I now have time to look at what projects I’d like to explore.  Here’s my current list in no specific order:

  1. Create a ZoneMinder video alarm system for outside my home
    • Motion detection
    • Email alerts
  2. Create an Android tablet dashboard to show
    • Emails
    • Texts
    • Weather
    • Calendar alerts
    • News headlines
  3. Angular 2
  4. React
  5. Create an Android app to block calls
    • Not in my zip code &&
    • Not in my address book &&
    • Not in my outgoing call list &&
    • Not in my outgoing text list
  6. Work on my recipe collection to eventually publish a cook book
  7. Setup an educational instance of Linux for my 8 year old

Setting up a Django project with an ORM connected to an existing MySql instance

1.  Install Python:

I had to add the following to my %PATH% variable


2.  Install Django:  pip should have been installed with python so type

pip install Django==1.7.7

**Django comes with it’s own light-weight web-server, so there is no need to install one for development.

I’m going to follow for the following steps.

3. Create the project:  Run the following command in the directory you wish to use for development.  It will create the project.

$ startproject CourseOptimizer

4.  Install the C++ .0 python compiler at:

5.  Add the MySql libraries

pip install MySql-Python (I spent about an hour before I found out it's very difficult to get it to work on windows)

pip install PyMySQL

To use it, you must go to the django directory, exactly in this directory
and do a search and replace of MySQLdb with pymysql
in the two files "" and  "

6.  Connect to database:  In the file, change the DATABASES variable to:

 'default': {
 'ENGINE': 'django.db.backends.mysql',
 'USER': 'XXXX',
 'HOST': '',
 'PORT': '3306',

7. Scaffold the database schema for a Django site:

$ python migrate

8. Verify it runs:

$ python runserver

Go to

9. Create your first Models:

$ python startapp CourseCatalog

10. Map the legacy database to the of the CourseCatalog app:

$ python inspectdb > coursecatalog/

11. Open a python shell and verify the data has been mapped:

$ python shell
>>> from CourseCatalog.models import Course, Specialization, SpecializationCourse   # Import the model classes we just wrote.

# No questions are in the system yet.
>>> Course.objects.first().coursename
It should return the first row in the database's coursename

12. Create a view:

In the CourseCatalog/ file add the following and save:

from django.shortcuts import render
from django.http import HttpResponse

from CourseCatalog.models import Course

def index(request):
 course_list = Course.objects.all()[:5]
 output = ', '.join([p.coursename for p in course_list])
 return HttpResponse(output)

13. Map the view to a route

Create a file CourseCatalog/ file add the following and save:
from django.conf.urls import patterns, url

from CourseCatalog import views

urlpatterns = patterns('',
 url(r'^$', views.index, name='index'),
In the CourseOptimizer/ file add the following and save:
 url(r'^coursecatalog/', include('CourseCatalog.urls')),

14. Create a template directory and index.html template

The template structure is /App/templates/App/index.html, so in this instance, create /CourseCatalog/templates/CourseCatalog/index.html and add the following:
{% if course_list %}
 {% for course in course_list %}
 <li>{{ course.coursename }}</li>
 {% endfor %}
{% else %}
 <p>No courses are available.</p>
{% endif %}

15. Run the server and verify you get a list of courses

The template structure is /App/templates/App/index.html, so in this instance, create /CourseCatalog/templates/CourseCatalog/index.html and add the following:
$ python runserver
Browse to and see the courses

A simple static page web server using node js


I’m building a SPA using AngularJS, and Chrome doesn’t allow Angular to load the html partials because of cross origin request errors.  Firefox works, but I just prefer to develop using Chrome, so I needed to host the SPA somewhere.  IIS seemed like overkill, so I turned to Node which turned out to be very simple.

  1. Assuming you have node and NPM installed, install connect and serve-static with NPM
    $ npm install connect serve-static
  2. Create a server.js and place it in the same directory as the entry point of your SPA
    var connect = require('connect'); 
    var serveStatic = require('serve-static');
  3. Start the web server
    $ node server.js
  4. Browse to your SPA entry page:


That’s it!  I really love some things about Node, and the simplicity of setting up a web server is one of those things.

How to add polygon search capabilities to Apache SOLR


This is another post to document for myself how to add polygon search capabilities to solr since I do it very seldomly.


  1. >wget
  2. >sudo unzip -d jts-1.13
  3. >sudo cp lib/* /var/lib/tomcat6/webapps/solr/WEB-INF/lib
  4. Add the following field type to your solr schema:
    <fieldType name=”location_rpt” class=”solr.SpatialRecursivePrefixTreeFieldType”
  5. Add a field of type “location_rpt” to index the lat/lng data:
    <field name=”geo” type=”location_rpt” indexed=”true” stored=”true” multiValued=”true” />
  6. Restart Solr
  7. Index the data in solr
  8. Query to ensure you have the ability to search a polygon:*%3A*&fq=Geo:%22Intersects(POLYGON((-84.113824%2034.085196,-84.003009%2034.146633,-83.856827%2034.032769,-84.188127%2033.993178,-84.113824%2034.085196)))%22+&wt=json&indent=true