I recently competed in a 36 hour hack-a-thon hosted my a conference put on by a magazine, and sponsored by a software vendor. The idea, as we understood it going into the event, was to develop some piece of software utilizing the software vendor’s product, to make something creative, usable and valuable.
The software vendor was OSISoft, who makes PI database systems. I am not as familiar with PI as the other members of my team, so I won’t go into detail about our system, but an overview was thus: take one product from PI – PI notifications – and tie it to another, separate product – PI Event Frames. Our idea was to generate event frames from PI notifications programmatically. The other side, the side I worked on, was a web application to visualize the PI data and event frames in a real-time display.
The idea, as the judges understood it, was to develop a creative idea related to “connected devices” and have some semblance of functioning code behind it. Long story short, we lost because another team had a better story for the magazine, and the judges didn’t have any technical knowledge of the software we were working with. The representatives from the software vendor were very impressed with our product and were excited to see it mature in the future. However, if you’re interested in hearing about the coding and hacking, read on!
We began coding around 6 in the evening, and finished around 9 am two days later (I think, it’s all a bit fuzzy now, due to lack of sleep). I was accompanied by 3 team members – our team lead, Bryan, who had experience with both PI and ASP.NET MVC/HTML5, Brandon and Farhanna, who both had experience with PI, and myself, who had experience with HTML5 and little experience with PI.
To keep our team on track with tasks, without being as formal as an issue tracker, we used Trello. for things like to-do, doing, done, and links lists. It was very useful for keeping everyone’s info all in one place, and synced, fast. We also utilized subversion for our source control, to keep everyone in sync with code. The PI server was hosted on one of our development machines, and the web server was on another.
For the most part, we were doing a lot of pair programming, but not by intent. Brandon and Farhanna were working on the PI notification set up, and event frame generation together almost the entire time. Bryan and I went back and forth from working individually to working together on the web server and client. We got quite a bit done on the first evening, and went to sleep around 3 in the morning (4 for us, since we were behind an hour).
For the duration of the event, coffee, water, red bull, fresh fruit, and snacks were provided by the vendors/hosts. These were absolutely essential to our productivity coding for 30 hours in 36 hours was a drain on the body and brain, and the fuel was crucial to staying productive and healthy. I stayed away from redbull, and only had a couple cups of coffee. I drank a lot of water and ate a lot of fruit and felt pretty good for the whole time, other than unavoidable exhaustion.
The “long form” hack-a-thon, different from a 4 or 5 hour event after work, was definitely a very different experience. We were able to create a working product from scratch during the event. The 100% focus on working on the single project for the duration of the event was a lot of fun and very educational. It’s easy to shift your brain away from something you’re learning when you’re not focused on it, but getting to stay in focus for so long really helps you get in the zone and hack out something awesome. I recommend doing something like this to anyone who codes or builds or hacks. It’s not something I could do regularly, but for a special event, it was a great experience.
Here’s the write-up from our project:
Team RoviSys (aka "3 Guys, a Girl, and a PI Server")
We came to the Hackathon with an idea based on a need of our customers: leveraging PI Notifications to generate Event Frames. We also wanted to build a compelling visualization of Event Frames using HTML5. Since the Connected World Conference is all about connected devices, we simulated three types of devices to feed data into PI: a Network Router, an Office Security System, and a Truck Monitoring System. We accomplished a lot in the approximately 36 hours we had for the competition, specifically:
- We built a simulator (code-named "Lynx") that could feed data from our simulated devices into the PI System, periodically triggering anomalies.
- The heart of the system is "Cougar," a program that registers for PI Notification events, and creates Event Frames when Notifications fire. The trigger value for the Notification is recorded in the Event Frame, as well as other relevant data. When the trigger condition for the Notification is no longer true, we close out the Event Frame, and log some final relevant data to the Attributes (such as the Maximum and Average value of the tag.)
- For the visualization, we built "Bobcat," an ASP.NET MVC 3 web service that calls into the AFSDK and converts the data to JSON. Bobcat includes an HTML5 display that shows a realtime view of the PI data, with Event Frames overlaid. It also includes a list of recent Event Frames, with detailed information provided.