Open EE Meter, Part 2

February 18, 2016

Turns out the code and tutorial that I worked through a couple of weeks ago were just one of three repos on github.  The other Matt (Golden) updated their code page which now looks like this:


I had only downloaded and run the tests for the first of the three, eemeter.

The second, oeem-client, I was able to set up without any problems, following the steps in the README. I ran the app and only then did it stumble, complaining of no host supplied for the datastore, which makes sense since I was not yet running any datastore.

The third, oeem-energy-datastore, started out equally simple but then failed because of a missing environment variable (DJANGO_LOGFILE, easy enough to define) and a couple of minor bugs in, which I fixed. Turns out they are not using setup anymore: just migrate, createsuperuser, and runserver.

For other random environment errors, I needed outside help, or rather, inside help from the lead developer on the project, Phil Ngo. First he said checkout develop, not master (why didn’t I think of that?) and he sent me the contents of his postactivate scripts for oeem-client and oeem-energy-datastore. Using his as examples, I was able to set up my own to work for my devbox, which is similar but not identical to his.

This all worked (even the obsolete setup, with my fixes) and I ran the datastore, which just shows a django admin list of tables. Next, following directions from Phil, I created a connection between the client and the datastore by creating a Django OAuth Toolkit application (in the datastore admin) and a Django OAUth Toolkit access token in the client.

Now the oeem-client application, which failed before due to the lack of a datastore, works!

What exactly is running?
How does eemeter relate to the client and datastore?
Can I load some fake data?



Comments are closed.