IoT: Internet of Things

Lately I’ve been playing with Internet of Things type technologies. Started with Raspberry PI’s but got turned onto ESP8266 microprocessors. They can run a lite-weight version of python called micropython. Basically it lets me run a cheap sensor platform anywhere I can get power for about $20. I’ve got the code for the pi and the esp8266 in this repo. Most of the esp8266 chips come with at least one LED on the board you can blink, so I wrote a library to blink morse code.

Docker

Doing a lot with Docker at work, I’ve decided I need to bone up on the skills on the side projects. This tutorial was extremely simple and if you understand what’s going on under the covers – it’s pretty amazing. You’re basically spinning up two fully functional virtual servers and running a complete web application on them.

I’m hoping it’ll speed up some of the plans I have for RateWings.com and allow me to be a little more “dangerous” with the things I’m trying – while being able to get back to stability and also potentially have someone other than myself work on the site. There’s an API in my future.

Kindle on Android screen sleep timeout

I can’t prove it, but I think the latest version of the Kindle app on Android changes the way the screen sleep timing works. It presented to me on my android moto-x with a recent update to Kindle, v4.3.0.44 and if I didn’t read fast enough the screen would dim in anticipation of going to sleep. It was annoying because it would do it right as I was getting to the end of the page, and I couldn’t find a setting in the app itself to prevent this. There is an android permission android.permission.WAKE_LOCK that allows an app to stop a screen from going to sleep – and I suspect the Kindle app had this previously but the developers decided to remove it. The solution was to update the android settings-> display -> sleep setting to something higher (5min in my case.)

RDC to Win 2008

When trying to RDC (i.e. terminal services connection) to a server I started getting the error:

The remote computer disconnected the session because of an error in licensing protocol

Spent a while figuring out exactly what I had to turn ON to get it working when in fact it was something I had to turn OFF.

The problem was I had installed the “Remote Desktop Services” role thinking it would enable RDC connections, when in fact this is a much more complicated beast that I think wants to enable the server to serve up tons of desktop sessions to many users vs. the single connection administration activity I needed. This new functionality comes with yet another licensing scheme from Microsoft and googling for a solution sent me down this path many times.

The solution: Remove the “Remote Desktop Services” role, and go to Start ->Control Panel->System and Security->Allow remote access . Doing this you find the familiar Remote Desktop settings and things work like I expected.

Give Camp New England 2011

I spent last weekend doing coding as a charity for non-profits as a part of New England Give Camp 2011.  The short version: 100+ volunteer developers get together and help 20+ non profits with all their technology/website needs for an entire weekend. 

The longer version of the story details how little sleep happens, how much amazing work can get done in a single weekend and learning where the tires really hit the pavement. That story also has to showcase the people who put this thing together and worked so hard before the event to make it happen.  The things the sponsors provided were exactly what was needed.  The venue (Microsoft’s 1 Memorial Drive office) was also a big piece of the story.  100+ very true uber-geeks with laptops and the WiFi was 100% on and super fast the entire weekend.

I didn’t know the event existed until my friend Chris from VT asked if he could spend the night.  Serendipitously my wife and kids were out of town for the weekend and my plans involved mostly lawn work.  So I contacted some other friends I found out were going and got myself signed up.

My team created a companion pet memorial site for the Maine Society for the Protection of Animals.  We also did some training on how they could use their drupal based website to publish new articles without burdening their already over-worked web-master, freeing him up to do more creative/compelling things with their site. I’m a little bummed we didn’t “launch” the additions to the site over the weekend, but we did get it running on their development server, and I’m confident they’ll be pushing live at which point I’ll update this post.

The end of the weekend involves each team presenting what they’ve done and it became very clear how much work really happened.  The whole thing was an eye opener on many levels.

I’ll do it again if the family commitments allow.

CSS style lost on validation in ASP.NET, ie only

In the process of upgrading the style of an existing ASP.NET web application I incorporated the 960.gs grid system style sheets. Along the way I created a single style sheet with 4 @import directives, so I didn’t have this list of CSS files on every page, just one <link href…> tag that included a single CSS file with the @imports.
During testing it was uncovered that while using the app in IE 7, when a validator failed and generated a message (like “Bad email address” etc) during the postback process a large majority of the style on the page would be absent – making it look pretty bad.
Turns out the problem is the @import directives not being obeyed during the 2nd rendering of the page.
I moved all the CSS into a single file (which will help with performance in the long run) and the problem goes away.

Crowd Lights

I was at a Phish concert this October and was amazed at how many little screens I could see – mostly taking pictures or video of the band, but also people checking the set list or texting their friends that they were at the concert.  I realized that I could control these screens with an app – and how kewl it would be to synchronize some sort of a light show utilizing each screen as if it was a single pixel on a huge display.

I started work on the app the next day – and quickly realized there were a number of ways to pull it off.  Balancing how much time I had between putting the kids to bed and my own head hitting the keyboard vs. when I wanted it to be done drove a lot of decisions.  How much money I wanted to put into the project also forced me to build it a specific way.  In the end the architecture of the final application is as complex as it needs to be, but no more.

I posted a request on facebook looking for beta testers and had about a dozen friends and family lined up to play with an early version of the app.  Distributing it to them without publishing it on the google app market was problematic,  but eventually I had them all reporting back that the app worked.

A month after the inception of the idea it was done – but I needed to obfuscate the code, that is: Jumble it up so it couldn’t be downloaded and reverse engineered too easily.  This took way longer than I wanted it to because I had to learn a few new technologies I’d never used before.

This final hurdle surmounted, I released the application on Sunday.  You can install it on your droid with this link to the market page.

The iPhone version should be done in a few weeks.  Yet another set of new technologies to learn, but building the app the same way (with the exact same light show being displayed) will be easy.  *UDPATE* The iPhone version has gone live on the App Store.

Here’s a video demonstrating the final product:

Manchester Bar Camp 2010

I attended a free conference in Manchester on Saturday called Bar Camp Manchester.  It’s basically a bunch of software people getting together to help each other out with presentations and round table discussions.  It’s proven to be the best vehicle for cross-discipline information dissemination I’ve found every time I’ve attended.

The first session I went to was one I requested – I wrote a post-it note reading “iPhone Dev” and put it on the wall and a very experienced iPhone developer  grabbed it and stuck it in the 10am time frame there by volunteering to run the session. 

The session turned out to be not only iPhone dev – but alternitives designed specifically for my problem: What platform do develop for?  I walked out looking into wrapping an HTML5 solution in a simple browser app for each platform I want to deploy to, possibly using the Sencha Touch framework that was demoed in the session.

The next session was given by the developer of the Visual ID’s project and ranged from anthropology to color blindness and opened my eyes to a much better way of generating icons for folders holding tons of files.  One of the sites mentioned in the session was ScribbleThink.

During the annual Drop Your Pants session, where people are encouraged to describe projects they have been thinking about and let the room critique and suggest ways to get it done using the skill sets and knowledge of this very unique group, I describe my desire to have wi-fi addressable thermostats in my house.  The group pointed me to the sites Alarm.com  and the Invention Submission Corporation.  Other topics discussed in this session were other peoples ideas and the group gave equally good advice on how to further them.

The Gorilla Projects session generated some great ideas on how to make Manchester, NH a better place.  One was declaring the official hash tag of the city to be #MHT.  I immediately tweeted this.  I can’t think of a more official group to make this declaration.  Also discussed was generating QR codes for bus stops pointing to web based scheduling information.  I mentioned this article in wired in response to a suggestion of 311 service for MHT.  Collecting photos of the Mills and putting QR codes at the spots they were taken was also discussed.

In the HTML5 session I learned about CanIUse.com and the HTML5Shim, and am pretty sure I’ll be pushing the technology in my next projects at the 9-5. 

The last session was a 2 part discussion of SEO techniques and general “good ideas” for websites and social campaigns.  A lot of this was not so much new to me, but hearing it all put together in a cohesive discussion was useful.  It generated some definite actions I’ll be taking for some side projects I’m working on.

The after-conference was right down the hall at a nice little restaurant whose name I can’t remember – nor can I find them online.  I admit I wish the original suggestion to go to Milly’s Tavern was followed.  I was looking forward to bragging that I am the Mayor – which of all the people in the world probably would have mattered to this group more than any.

If you’re presentation is listed above and you want credit/mention let me know and I’ll add whatever link to you you’d like.

MySQL \G formats results in rows

Using the \G qualifier at the end of a MySQL select statement will format the results with the column name and column value in each row of your result.  This makes it MUCH easier to read a single row of a table that has many columns.

Example:

mysql> select * from routines where routine_name=’myRoutine’ \G

*************************** 1. row ***************************
     SPECIFIC_NAME: myRoutine
   ROUTINE_CATALOG: NULL
    ROUTINE_SCHEMA: myDatabase
      ROUTINE_NAME: myRoutine
      ROUTINE_TYPE: PROCEDURE
    DTD_IDENTIFIER: NULL
      ROUTINE_BODY: SQL
ROUTINE_DEFINITION: NULL
     EXTERNAL_NAME: NULL
 EXTERNAL_LANGUAGE: NULL
   PARAMETER_STYLE: SQL
  IS_DETERMINISTIC: NO
   SQL_DATA_ACCESS: CONTAINS SQL
          SQL_PATH: NULL
     SECURITY_TYPE: DEFINER
           CREATED: 2010-10-08 22:36:55
      LAST_ALTERED: 2010-10-08 22:36:55
          SQL_MODE: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER
   ROUTINE_COMMENT:
           DEFINER: root@127.0.0.1

I’m posting this in my blog because it’s a trick I have lost and found at least twice, and don’t want to forget it again.  This particular time I had to go to the #mysql channel on IRC to get my answer.  I always seem to have a hard time describing this trick well enough for google to find me an answer.