Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

Saturday, February 7, 2015

The Q API

I wrote about the Q and my thoughts about it at a general level recently.  I've also been tinkering with making it actually do interesting things via the API that it exposes.

The API is part of a beta firmware update, and it shows.  For example, right now the command to get a list of connected light bulbs locks up the device and requires a reboot.  I'm sure that will get fixed, and fortunately I can just read the serial numbers off of the physical bulbs themselves in the meantime.  But it does mean that it's basically impossible to write a consumer application to the API right now.

The API


The API that the Q exposes is pretty simple: it listens on a UDP port for messages in JSON.  It then returns nothing, a string, or JSON data.  It's a bit warty; anything communicating with it needs to expect different formatted data depending on the action.  I'd prefer to see it always return JSON, including when it doesn't understand the request.  Unfortunately, it never returns anything if there is an error and some commands don't get a success confirmation or even acknowledgement.  So it's possible that you think something has failed when it has succeeded or vice-versa.   I really hope that changes.

It's also not as well documented yet as I'd like.  There are fields that are entirely explained right now.  For example, the API to control the lights themselves contains fields like "effect", "matchValue", and "iswitch" which are undocumented.  So far I've determined that setting effect to "9" makes the bulb do what you say, a few other values (e.g. "8") makes it turn white no matter what color is specified, and anything else seems to have no effect at all but receives an "ok cmd!" response from the Q station.

Tinkering quickly


While it's possible to write a C, Python, Perl, etc. program as a harness to play with the Q, that's more work than I wanted to go through to just poke at it.  Plus I'm lazy and want to just do things from Bash wherever I can.

Since the Q just expects JSON messages on a given UDP port, it's possible to use netcat to do this without writing anything extra.  As an example, this will simply ping the unit and determine if it is working:

$ echo '{ ping" }' | nc -u 10.1.10.182 11600 -q 1
belled,MQ1AC43700000669,172.16.0.1,1

(This is using my Q's IP address.  You'll want to replace 10.1.10.182 with your unit's IP address.)

The "-q 1" parameter to nc tells it to disconnect after nothing is sent for one second.  Once I had this in my command history, it was a bit more convenient than hitting ^C to end the connection.

I've also used this to change a bulb's color:

$ echo '{ "cmd":"light_ctrl", "r":"155", "g":"20", "b":"255", "bright":"100", "sn_list":[ { "sn":"MD1AC44200001127" } ], "iswitch":"1", "matchValue":"0", "effect":"9"}' | nc -u 10.1.10.182 11600 -q 1
ok cmd!

(Again, my Q's IP address and my light bulb's serial number won't work for you, so be sure to change those.)

netcat allows simple interaction with the Q to interactively play with the API without having to bother with writing a full script and deal with sockets yourself.

Tuesday, August 7, 2012

Making the most of job fairs

Last week I complained a bit about my experiences at an employment meetup, and a few days later ended up in a similar situation.  But this one went better, and I've been thinking about why.  I have some suggestions for both organizers of events as well as attendees.

I attended the Boston Startup School demo day for their class of 2012.  (As an aside here, the Boston Startup School is a really cool idea that seems to be doing great things!  If you're in the area and interested in entrepreneurship, I definitely recommend checking them out.)

Anyway, this event was like the meetup I attended in that it had the goal of connecting people looking for jobs with people looking for employees.  But I get the feeling that here everyone on the 'looking' side will end up with a job within a month at the most.  I've been rolling that around in my head for a few days and I think there are a few reasons this worked better.

One reason is that Boston Startup School had quality students and had obviously taught them a ton.  There was nobody there that I felt would be a bad hire for a startup.  Less selective events don't have this advantage, but I think there are still some things to learn and apply anywhere.


For organizers: structure!


The good

The demo day event was structured as a sort of reverse career fair.  All of the graduates did a one-minute pitch to the crowd and then got off the stage.  (And I do mean one minute!  This is the sort of thing that can drag on very easily, and to Boston Startup School's credit they kept it tight.)

After that, everyone mingled and chatted.  The prospective employers were given a book with the names and faces of all the presenters and some space to take notes.  That was extremely helpful to me, as I was able to track down the people I'd written good things about during their pitch and talk to them further.

Having a program planned out ahead of time that let people know who was there and when to expect to start to mingle and chat was key to this.  The companies soaked up the pitches and went straight for the people they wanted to talk to.  I ended up having several great talks and scheduled followup discussions right then and there.


Room for improvement: structure for unstructured discussion

Here's the thing -- unstructured discussion is great.  Having people mingle and talk is going to get things to happen... eventually.  But you can make unstructured discussion easier by structuring the space itself.

I wasn't able to easily identify the people I wanted to talk with in the crowd.  I had to wander around aimlessly, picture book in hand, until I found someone I recognized.  Then I couldn't let them out of my sight until I got the chance to talk to them -- I'd never find them again otherwise.

The job-seekers were grouped into a small number of 'tracks' during their pitches; why not have areas of the room for those tracks to congregate in?  Or maybe give each of the job-seekers a distinctive article of clothing to wear.  If they each had a bright pink hat, I'd at least be able to narrow down the number of faces I was comparing to my notes.


For participants: be identifiable!

The people I was able to find and speak with quickly were easily identifiable.  And I was surprised by how easy this was to do (and embarrassed that I hadn't thought of some of these things myself!).


Branding

The simplest but most effective thing I saw was having a personalized name tag.  Everyone had a black and white sticker on their chest with their name on it, but some people had made their own with brightly colored marker.  Having "JEFF" in bright red and blue on your name tag makes you stand out across the room in a way that "Jeff Smith Jr., Weyland-Yutani Corporation" in Times New Roman doesn't.

If nobody else has a name tag, even better!  You'll stand out more.  Don't worry about looking silly; at least people are looking at you.


Have a 'hook'

One of the graduates had the best technique for getting conversations started that I have ever seen.  He used maybe 20 of his 60 seconds to tell a brief story about his life, but left out the ending!  He described being on a train in Sibera, unable to speak Russian, and having a halting conversation with a man who gave him the best advice of his life.  He ended his presentation by saying that if anyone wanted to know what that advice was to seek him out afterward.

It's cheesy.  Definitely.  But at the very least it's something to open a conversation with.  ("What did that man say to you, anyway?")  This guy was totally mobbed the entire time the discussion period was going on.


Be practiced

As I said in my previous post, the only way to get better at talking to strangers is to practice.  Find a way to get out of your comfort zone and keep at it.  It's hard -- very hard, sometimes -- but it's a skill that can be learned.


Get to it!

I'm glad I had the opportunity to compare these events.  Having them so close together was a lucky break for me.  I hope this helps people make the most of job fairs on both the planning and attending sides... I know I'll be doing things differently in the future myself.

Monday, July 30, 2012

Lots of IT jobs in Boston (or "How not to network")

I attended a meetup last week for IT professionals, recruiters, and job-seekers in the Boston area.  For me it was a combination of wanting to start networking a bit more actively and maybe seeing if there were any PHP programmers who might fit in at Libboo.

The good and the bad...

My first observation was that there were far more people looking to hire than there were people looking for jobs.  This is good news if you're out looking!  At least this week in Boston.  (I'll have to wait to see if this is a trend or just coincidence.)

But my second observation was that most of the people there really didn't know how to make the most of an event like this.  (This applied both to the job-seekers as well as the prospective employers, which surprised me a bit -- I think of recruiters or managers as being generally more outgoing.)

It turned out that the organizer of the event was running late and couldn't get there to start things off.  So most people were sitting or standing around by themselves, sort of staring at the walls and waiting for someone to come along and connect them with what they wanted.

Don't do that.

Don't be that person.  If you wait around for someone else, you aren't in control of what you get... if you get anything at all.

I know it's difficult to start talking to someone.  Believe me, I really do.  I'm the biggest introvert that I know, and have been all my life.  I still would rather stay home or hang out with a very small group of good friends than go out to a noisy club.  I get exhausted dealing with people, even when I'm having a good time.

But if you're like me, you've heard this advice before.  Again, I know.  I heard it all the time too.  "Just go start talking to people!"  Or maybe, "They're just as nervous as you, you know."  None of those things helped, and frankly I suspect there are a lot of people who really like meeting new people and feel energized afterwards.  Having people lie to me or make the problem sound trivial always hurt more than it helped.

So what does help?

I can't speak for everyone.  (Even if I could, I wouldn't want to.  That's way too many new people to meet.)  But what worked for me was putting myself in a situation where I was forced to be social and outgoing.  I got a job as a Sales Engineer.  (That's someone sitting more or less between sales and engineering; participating in the sales process and meetings but keeping more to the technical aspects of a sale.)

And you know what?  It was hard.  Really, really hard.  I was uncomfortable and stressed and unhappy.  But it got easier, and the more I did it the easier it got.  I still don't jump out of bed every morning wanting to go out and talk to a hundred strangers, but now I'm comfortable enough doing it that I was able to get people talking at a meetup.

I don't know that I'd recommend changing jobs to everyone, but do something that pushes you past your comfort zone.  It will be hard at first, but sticking with it makes it easier.  Join a club, take a class, see a professional if you have to, but forcing yourself to learn and improve these skills will compensate you far more than the discomfort it causes.  (And these things are learnable!  Some people seem to be born knowing how to make small talk and put others at ease.  But the rest of us can learn with enough effort.)