In Valid Logic

Endlessly expanding technology

Archive for November, 2006

A day of hacking later…

without comments

After a day of hacking on my idea, I now have some results.

For starters, think I am going to go the AVR route as opposed to PIC.  In checking out the current state of things, AVR seems to be the hot new kid on the block, and PIC is kind of limping, in my opinion.  Their online community is horribly outdated.  The big player that used to be PIClist is now old, out dated, and broken.

While the mini controllers will likely take me some time to get some of the parts and begin hacking on it, I decided to dive into writing the master controller software that will run on the PC.  I have to admit, I am somewhat disappointed… I thought it would be harder, but I already have it working.  Granted, right now it just a coding API, though will add the ability to save/load scripts and maybe, if I really get bored, code a GUI to do the layout.  But as it is right now, have some simple coding looking like this:

static void Main(string[] args)
{
    Sequence sequence = Sequence.Create();
    Device device = sequence.CreateDevice("10.0.0.1");

    LightDurationEvent light1 = sequence.CreateEvent<LightDurationEvent>(device);
    light1.StartTime = 0;
    light1.Channel = 1;
    light1.Duration = 1000;

    LightDurationEvent light2 = sequence.CreateEvent<LightDurationEvent>(device);
    light2.StartTime = 500;
    light2.Channel = 2;
    light2.Duration = 1000;

    LightDurationEvent light3 = sequence.CreateEvent<LightDurationEvent>(device);
    light3.StartTime = 1000;
    light3.Channel = 3;
    light3.Duration = 1000;

    LightDurationEvent light4 = sequence.CreateEvent<LightDurationEvent>(device);
    light4.StartTime = 1500;
    light4.Channel = 4;
    light4.Duration = 1000;

    sequence.Execute();
}

Can also add other event types, such as an AllLightsEvent, which will turn all lights on or off.  Also going to work on making it more extensible, so I can have different types of devices that handle different events… ie, maybe I have a device that controls a servo motor or something.  We’ll see.  Right now, most of the implementation details are up to the events.  When Execute is called, it turns the events into a series of commands (ie, turn light on at 0ms and turn it off at 1000ms… 2 commands).  The commands are basically comprised of when they happen, which device the command goes to, and the raw byte[] for the command.  The byte[] is what is actually sent to the device over the network, so allows we to send just about anything to it.

The one thing I haven’t got working is broadcasting… I send the commands using UDP, so can do broadcasting/multicasting.  The packets seem to send ok (though not actually running a packet sniffer), but the problem was I couldn’t get my test receiver to receive broadcast messages.  Ohh well, no biggie right now.

One thing I should mention… I love generics in C# 2.0… so love them.  The “sequence.CreateEvent<LightDurationEvent>(device)” would otherwise have been “sequence.CreateEvent(typeof(LightDurationEvent), device) as LightDurationEvent”.

Going forward, have two concerns:

  • Should I change from UDP to TCP?  Losing packets with UDP could suck, but I think the overhead to handle that in TCP might be too much too.
  • Timing… can see timing becoming an issue when it goes along with music.  Say I turn a light on for 100ms, then turn it off.  I will be on more than 100ms… there the delay with the PC processing, sending over the network, and the mini-controllers acting on the command.  Probably very minute, but when there is a long series of commands, closely tied to music, wonder if it would cause them to get out of sync.  Moving to a dedicated master controller (non PC) may be better option eventually.  Less going on, so likely would be easier to calculate the clock costs of the code and compensate with adjusting the timing between commands.

Written by krobertson

November 30th, 2006 at 11:49 pm

Posted in Archive

Xmas Light Mania 2007 (yes, 2007)

with 3 comments

Since Christmas is now upon us, it is time for that age old tradition: Christmas lights!  When I was younger, my dad and I used to deck out the house with tons of lights.  It was always a lot of fun (for me, maybe not him… he always pulled that “I’m too old for this blah).  Now my dad doesn’t do nearly as much, since all their kids have moved out.  Since Trish and I just in an apartment, we can’t do much at our place, though that doesn’t keep me from dreaming of the day or enjoying other displays.

To get myself in the mood for 2006, I was checking out the computerized light show to TSO’s “Wizards in Winter” from last year.  I was showing it to Trish and then she said the fateful words that ignited a fire: “we should do something like that.”

And thus, my quest to have something for the 2007 Christmas season shall begin.  Why 2007?  Because next year, we’ll be in a house instead of an apartment, and the displays are quite elaborate, so can take time to develop.  Also, I am going to go the geekier route: do it yourself!

There is a company called Light-O-Rama that makes the hardware and software for the computerized displays.  They have a nice video collection of people using their products.  They are a little expensive though.  I know I would one day love to have one of the very elaborate displays, so some things like their 128 channel package run $2,500.  Even their base 16 channel controller is $330 each, or 8 channel for $220 each, and the software is $100.  Even their hobbyist kits (minus the enclosures) are $210 for the 16 channel and $100 for the 8 channel.  Being the geek I am, I know I could build my own for far cheaper, and have far more fun doing it.

My idea?

Almost the same as how they are doing them.  Design a very simple mini-controller device that uses a series of solid state relays to turn different channels on/off.  It would be controlled by an embedded processor and receive commands over ethernet.  Using a network, the range of lights is easily scalable.  Also, to avoid the overhead of using a full TCP/IP stack, would likely drop down to using UDP or maybe even raw ethernet headers.  The mini-controllers would receive very basic “toggle channel 1″ or “toggle channel 2″ commands, so there isn’t a lot of processing.

The show would be controlled by a main controller that issues commands to all of the mini-controllers.  Initially, it would be a PC, though I could eventually move it out to an embedded device working along side a hardware MP3 decoder for synchronization, and a RTOS (Real Time Operating System) for issuing the commands.

For the software, I’d write some sort of storyboard software.  Similar to how video editing software works, would have something like “turn on channel 1 at 2000ms for 100ms, turn on channel 2 at 2050ms for 100ms”, etc.  Maybe even one day software that lets me design it along side the MP3.  Then the program would translate the series of sequences into a single series of commands.  I’d like the timer like feel of “turn on for 100ms” rather than having to think of it like “turn on at 2000ms, turn off at 2100ms”.  But the translator would look at the storyboard and come up with the needed commands.  Have it see “sleep 2000ms, turn on 1, sleep 50ms, turn on 2, sleep 50ms, turn off 1, sleep 50ms, turn off 2″.

My goal would be to have the hardware and software designed for Christmas 2007 and have just a very basic display.  No music, but some computerized sequence that just loops.

Though there are a few design details on my mind:

  • Biggest question of all: shall I go PIC or AVR?  Both have free C compilers, both have cheap development kits with ethernet (~$50), both have active hobbyist communities.  Still torn here.
  • Will be dealing with AC current… prototyping and dealing with AC current?  Not looking forward to it.  Hope I don’t electrocute myself or burn the place down.
  • Going to need a sealed enclosure for the device, so would need to figure that out as it will greatly affect how the hardware comes out.
  • PIC or AVR?  Damnit!

Written by krobertson

November 30th, 2006 at 10:12 am

Posted in Archive

Helps to listen to the words

without comments

On my way back from getting lunch today, was listening to the radio and couldn’t help but laugh about some of the songs people say mean something to their relationship without really paying attention to what the song is about.  The DJ had received a request by email from a guy deployed to Iraq.  The guy wanted the DJ to call his wife to let her know she should listen.  He wanted the DJ to play this song that heard when they first met at this concert, because it meant a lot to them.  Sounds sweet enough, huh?

The song he wanted played was called “Lips of an Angel” by Hinder (lyrics), which sounds like it might be a nice song, and if you’ve heard it, it does have a seemingly sweet melody.  The problem?  Listen to the lyrics.  It is about a guy being tempted to cheat on his girlfriend with his ex.  Yeah, nice song to be “meaningful to your relationship”.  The lyrics talk about how he can’t be too loud on the phone because his girlfriend is in the next room, and how she makes it hard for him to be faithful… really nice stuff, huh?

I used to always chuckle when people would request “B.Y.O.B.” from System of the Down (lyrics).  With a name like B.Y.O.B., they probably thought it was about beer or partying.  No… its quite anti-war and anti-Bush.

So that is my tip for the day…

Written by krobertson

November 28th, 2006 at 2:34 pm

Posted in Archive

Introducing Comsax – COMmunity Server Attachment eXporter

with 4 comments

A couple of weeks ago, I wrote a little utility for Community Server that would export attachments that were saved in the CS database to the filesystem, allowing you to shrink your database.  I coined it Comsax for Community Server Attachment Exporter.

 The usefulness of the program includes:

  • Get files you thought were long lost out of the database
  • Shrink the size of your database
  • Make it easier to perform antivirus and backups of your CS attachments

The features of Comsax include:

  • Export the attachments to their original filename
  • Export the attachments to the CS attachment file structure
  • Point it to your CS directory, and it will read your configured installation locations from the communityserver.config
  • Remove the attachments from the database once the download is done

Comsax does require that you are able to connect directly to the database, so SQL Server either needs to be publicly exposed (ie, you can access it from Enterprise Manager or SQL Management Studio) or that you run it from the server.  Since it works directly with SQL, it may be best to run it locally to prevent any issues with SQL timeouts.

Also, if you aren’t able to connect directly to SQL or anything, you might ask your hosting provider if they could run it for you.  Some of the Community Server friendly hosts would most likely have no problem.  Running the application is pretty straight forward.

And as a final note, while the screenshot shows it is using Aero Glass, it is fully compatible with XP/2003, just no fancy display.  I was messing around with some Aero development while writing it (as a side note: implementing Aero through standard WinForms sucks… more on that soon).

Unfortunately, Comsax isn’t yet available.  This is merely a teaser because I like torturing people before a holiday weekend.  It will be available next week, after I do some testing against large databases.

Written by krobertson

November 22nd, 2006 at 11:38 am

Posted in Archive

A first… a do nothing vacation

without comments

Next week is going to mark a milestone first occurrance.  Next week is the first time I’ll be taking a vacation and doing nothing.  In the past, whenever I have taken a vacation, it has always been to go somewhere or do something, full of plans, travel, and everything.  I’ve never taken a vacation and just done nothing.  Stay at home, sleep in, play Xbox, catch up on little projects, stay hidden on IM.  Yes, it sounds great!

Though the one problem with my work and a do nothing vacation is that I can only hold out so long.  Take a developer who loves to code and is passionate about their projects, then tell them they can’t work on them for a week.  Torture!  I know I’ll likely end up doing some work here and there, but the nice thing is that it is at a casual pace, and I could mess around with the things I wouldn’t normally have time to get to (like maybe update my blog to CS 3.0 and a new skin).

Written by krobertson

November 22nd, 2006 at 10:57 am

Posted in Archive

BlogMailr update last night

without comments

Rob had posted to the BlogMailr blog that last night, we pushed out a set of updates.

The most notable changes include a fix for an issue where only the first attachment would be submitted to a blog, and also some improved error logging.  The error logging is geared towards tracking down the two major remaining items we’ve been working on: posts being submitted multiple times, and issues with adding certain blogs.  The error logging will capture more details about what happened and some of the data that was used to help us reproduce and diagnose the problems.

We hope to get those nailed down shortly, and then we have some cool new feature enhancements that we’re looking to get out there.

Written by krobertson

November 22nd, 2006 at 9:01 am

Posted in Archive

Should have got a NAS device a long time ago

with 3 comments

Last week, my new Network Attached Storage device (NAS, for short) finally arrived.  I got the diskless version of the Infrant ReadyNAS NV.  Let me tell you, I should have gotten one of these a long time ago.  It is beautiful.

I had been going back and forth for a while as far as what I should do for my storage needs.  My old RAID card was not going to have Vista drivers (it may for Longhorn Server, but not Vista itself as of yet).  What I was after was:

  • Expandable storage… didn’t want to be limited to X sizes, or need to purchase some big monolithic thing
  • Redundancy… I have stuff I don’t want to lose.  I don’t want something like a HD failure to screw me, no matter how reliable the disks are supposed to be.  Will never get 100%, but RAID helps against the single point of failure possibility.
  • Shareable… my wife is always downloading music, wanting the music I already had, asking where some photos were, etc.
  • Didn’t want a dependence on a single system.  If I was sharing music, didn’t want to have to have my PC on for my wife to use them.  Didn’t want files to be inaccessible when I’m monkeying around with the systems, such as when the MP3s were inaccessible when I was toying around with Vista RC1 on my media center PC.

When I was trying out Vista RC2, I had moved my RAID card and drives over to my virtual machine server, though found that to be more of a pain than a convenience.  I don’t keep the VM server on all the time, since I don’t need it all the time.  It adds to extra heat, noise, and power consumption, so I only turn it on when I need it.  Though it takes a few minutes to boot up and be all ready, so if I just needed to reference some project document from a few months ago, it would be a pain.

Now with the NAS, I just access it over the network, and its all in a little box that sits behind my monitors on my desk.  The Infrant is especially nice.  Uses X-RAID, so the arrays are expandable.  It has a nice web interface, plenty of security options, FTP and web accessible, full monitoring (it will even email me if a drive gets too hot).

Written by krobertson

November 20th, 2006 at 2:28 pm

Posted in Archive

Best domain search tool, for sure

without comments

Was reading this morning’s Daily Grind, which has a link to PCNames, an AJAX enabled domain search sites.  It is very cool… definitely my site for checking domain availability.  Far better than dealing with the horrid UIs of GoDaddy or any of other registrars.  Be sure to check it out!

Written by krobertson

November 17th, 2006 at 10:04 am

Posted in Archive

Vista x86 RTM on MSDN!

without comments

Since my download is now done, figured it is save to post about it.

After lunch, decided to hop onto MSDN real quick and spotted that the Vista x86 RTM had been posted just a half hour earlier.  So I ran on over and started my download!

Just finished a minute ago, going to burn it to DVD, and then probably will install it a little later this evening.  Got to finish up some work first.

Written by krobertson

November 16th, 2006 at 3:40 pm

Posted in Archive

A music service and player to fit my needs

with 2 comments

Lately, I’ve been looking at the market for mp3s players.  I’ve yet to buy one before, so I’m not yet committed to any of the services out there.  However, I’m finding it difficult to fit a service + player to really fits what I’m looking for.

In the player, there are a few things I want or plan to use it for:

  • Video support… use it when I travel to watch a movie or some shows recorded on my Media Center
  • 30gb… enough space to fit enough of whatever I need
  • Some way to interface it with my car, even just an FM transponder… that way I can take a better play list than my limited CD holder and 6-disc changer when I go to the Bay Area (where the radio stations suck)
  • Good battery life

I will tell you right off the bat that the iPod/iTunes is out of the question.  I had turned my wife onto iTunes and was going to be getting here an iPod Nano… iTunes awakened the inner music lover in her, leading to a lot of recent purchases, and some of the songs are ones we already have as regular mp3s or on CD that she just didn’t know about.  This kind of got me thinking.  iTMS is not for us.

What I want is a subscription service.  Flat rate, covers all our musical tastes, various spurges, and everything.  In my opinion, there are several advantages:

  • When you “buy” a song, you never actually own it.  You lose it, have to buy it again.  So don’t view buying a song as getting anything tangible.
  • No need to build up your musical library with hundreds of dollars.  It is all right there.  It evolves with.  It handles your splurges for the days when you feel like 80s music.
  • Like entertaining guests?  Always have the music you need for the occasion.  No need to buy anything else.
  • Have songs you like listening to only once in a while, and never often enough to want to “buy”?  It is there whenever you want it.
  • Have a wife who “buys” odd songs and goes on buying sprees?  No extra costs as a result.

So I have my heart set on a subscription service above all.  That completely eliminates any Apple product.

Now, what about the Zune that came out yesterday?  Don’t think it will be my answer.  For starters, it uses it own Zune Marketplace, which only works with the Zune.  My wife would prefer a smaller player, about the size of the iPod Nano.  Can’t get that with Zune Marketplace.  Then I would need to pay for two subscription services.  No thanks.  The Zune looks cool, but I don’t buy the whole “social” aspect.  Having wi-fi is not really a selling point for me.  So what advantage does it have?  It certainly doesn’t have compatibility.  On top of the Zune Marketplace let down, it also requires its own software.  Why not build on WMP11?  No… had to create their own Media Player-ish program just for the Zune.  I downloaded it and tried it… not impressed.  First, it doesn’t support Vista (hello?  brand new device doesn’t work on their own brand new OS?) and even on XP, it was sluggish and locked up on me.  It seems Microsoft took a Toshiba player, made it incompatible with everything else, slapped together their own software, and went to market.  In my opinion, they should have:

  • Taken the Toshiba player (yeah, it looks good… works for a first gen)
  • Made it compatible with PlayForSure
  • Not write their own software for it, and never thought of Zune Marketplace
  • Had it rely on WMP11 and Urge for the subscription service (especially since Urge is integrated with WMP11)

So this brings me to what my final decision will likely be.  I will likely go with Urge, since it is right there in WMP11, which I already have.  It works on Vista no problem.  I think it may even work through Media Center.  It supports tons of devices.  And the devices range from regular palm sized to mini nano/pocket sized.  I can get one my size and my wife can have her smaller one.  I am leaning towards the Creative Zen Vision:M and think the SanDisk Sansa would fit my wife best.

Apple would have won if they had a subscription service… maybe someday.  And perhaps the second generation Zune will look better… the device itself looks stellar, but looks like Microsoft made some bad decisions on the other details.

Written by krobertson

November 15th, 2006 at 4:23 pm

Posted in Archive