11h Blog

The blog of 11h

February 27th, 2010

11h Blog Finally Back Online

AUBURN, WA — The blog located at http://blog.11h.net is finally back online again after nearly 4 months of downtime.  The cause of the extended outage was a first time homebuyer’s purchase, which required the moving of the 11h.net datacenter from a one-car garage at a condo to a two-car garage in a house.  Additionally, problems with the server prompted the administrators to set up operations from scratch.  The work of moving into the house plus setting up the servers from scratch combined to result in the delays of the 11h sites from coming up in a timely fashion.

“I guess it didn’t really matter,” says Brian, the administrator of 11h’s Auburn facilities.  “Social networking is all the rage anyway now a days.  Blogs seem to be going the way of Myspace — just abandoned all over the Internet.  I actually feel bad because we lost our 2nd place pagerank on Google for the ‘Who knows what tomorrow will bring’ post.  Maybe googlebot will feel sympathy.”

April 12th, 2009

Reelight SL-120 circuit theory and making it flash flasher

I noticed the other day that my front, white, Reelight SL-120 had a crack in the plastic. Since it was partially cracked and needed to be fixed I decided to take it apart to see how it operated.

Reelights work through magnetic inductance. Two magnets on the spokes of the wheel spin around and briefly pass by the light. The light has an iron core that meets the magnets as they pass by. The iron core is wrapped with enamel coated wire. As the magnets pass by the iron core, the collapsing magnetic field creates and electric current that travels through the wire. The electric current in the wire travels to a capacitor where the energy is stored. The energy in the capacitor is then used to power a 555 timer circuit to flash the two white LEDs.

Simple right?

But what if you wanted to make your Reelight SL-120 flash a little faster?

First we need to look at the LM555 datasheet to figure out all the elements of the circuit and how Reelights has implemented the circuit.

It looks like the SL-120 uses an Astable waveform. The frequency is 2.2 Hz (roughly – I counted the number of pulses over 60 seconds).
The astable equation looks like
2.2 Hz = 1 / T = t1 + t2.
t1 = 0.693(Ra + Rb)C
t2 = 0.693(Rb)C

Looking at the Reelight SL-120 I see that 560k is Ra and 56k is Rb but the cap is un-marked. Damn. Gotta do this the hard way…
2.2 Hz = 1/0.45
0.45 = 0.693(Ra + Rb)C + 0.693(Rb)C
0.45 = 0.693(616)C + 0.693(56)C
0.45 = 426.89C + 38.8C
0.45 = 465.69C
C = 0.000966 (roughly 1uF)

If we wanted to make the lights flash more often, we would need to change Ra.

For fun I threw a 100k resistor on top of the 560k resistor. What happens is that Ra is now 84.85 [1/(1/560 + 1/100)] so the frequency would be:
1/(0.693(84.85 + 56)0.001 + 0.693(56)0.001) = 7.33 Hz

January 30th, 2009

Timestamp in Linux using ftime for millisecond timing

I am working on an embedded project at the moment that prints debug messages to a serial console.  Interestingly, it seems that some of the prints are arriving out order from the actual flow of the software when they originate from the same thread.

To debug the printing problem and to add another, better layer, of debugging to the project I added a time stamp to a preprocessor definition for the existing printf() macro.

Here is the existing print macro:

#define debug_print(fmt, arg)          printf (fmt, arg)

To add a time stamp we need to use the timeb struct from sys/timeb.h.  Since a struct is used, we need to give it a focus. Otherwise we’ll get compile errors. It will need to be put in a false do while loop.

#define debug_print(fmt, arg) \
  do { \
    struct timeb tp; \
    ftime(&tp); \
    printf("%ld.%d: " fmt, tp.time, tp.millitm, arg); \
  } while (0)

Now, in your program you need to make sure sys/timeb.h is added and then use the new print macro.

#include <stdio.h>
#include <sys/timeb.h>

#define debug_print(fmt, arg) \
  do { \
    struct timeb tp; \
    ftime(&tp); \
    printf("%ld.%d: " fmt, tp.time, tp.millitm, arg); \
  } while (0)

int main() {
  while(1) {
    debug_print("This is dbg print and a number: %d\n", 10);
    usleep(10000);
  }
  return 0;
}

Enjoy!

December 16th, 2008

Engineering scholarship opportunities!!! Or just a terrible mailing list?

I’m a, or was, a proud member of IEEE for the last eight years.  The beginning of the ninth year is off to an incredibly rocky start.
In the last year I have received more junk mail on behalf of IEEE.  Most of it was from travelers insurance.  Some of it was life insurance nonsense…  Nothing more than recycle bin fodder.  Then the IEEE Spectrum magazine started to lag behind the times.  And not just lag a little – Make: magazine was beating them to new and interesting stories by six months or more.  At one point in time I would read Spectrum from cover to cover as soon as I got it.  Now… They aren’t as interesting and go unread for months.

Monday evening starting around 17:00 someone sent an email to ieee-oregon@ieee-or.org and ieeeoregon@LISTSERV.IEEE.ORG which set off a storm of replies, replying to everyone in the mailinglist, asking to be “removed” or “unsubscribe.”  The really intersting comment was from one individual who [replied to the list and] said “Sending “unsubcribe” messages to this list has no effect, beyond demonstrating thoughtlessness.  No human operator is standing by 24×7 waiting for your unsubscribe message – it is robot software, mindlessly rebroadcasting everything you send to it.”

I was a bit shocked at this statment.  Could there really be an engineer this oblivious?  I guess he answered that one all on his own.  Sending unsubscribe will unsubscribe you from mailing lists; on a mailing list that was set up correctly or run by proper software.  I guess IEEE doesn’t have that software.

If someone had not been nice enough to post the some-what obfuscated link to remove your [illegally added] email from the IEEE Oregon chapter this nightmare of emails would probably continue.

If you have found your email address illegally added to the Oregon IEEE mailing list you can remove it here:

http://listserv.ieee.org/cgi-bin/wa?SUBED1=IEEEOREGON&A=1

November 20th, 2008

please insert correct map disc

Well, I made that error appear because… I’m an idiot.

That’s an error that can be displayed on a Toyota/Lexus MFD after changing the map region in a service menu.  I managed to select one that’s not for the disc I have.  This setting stays in flash in the navigation unit, which has a battery backup.  In order to ‘re-set’ the navigation unit, it must be dismantled and a board that has the battery must be disconnected.

My many thanks to htmlspinnr from priuschat who described the processes perfectly.

Pull NAV ECU:

  • Remove rear plastic cover by pulling plastic retaining clips/pins. I found two flathead screwdrivers helped with this.
  • Remove 4 8mm/philips screws, 2 on each side retaining ECU.
  • Remove 4 harness connectors at front of driver’s seat.
  • You’ll need to spread bracket just a tad in order to dislodge the ECU from the bracket.

Open NAV ECU, perform “fix”:

  • Remove 8 screws from the bottom of the ECU.
  • Cover is held in place by 1 tab on each side that fits around a small bump on the top cover. Using a small flathead screwdriver, spread the cover at the bump. The ECU cover should then tilt up and come right off.
  • With the plugs at the front, the left board is the NAV logic, and the right appears to be the AVC-LAN interface and power supply. There is a ribbon cable separating the two. These boards should lift right out, as the cover screws are holding them in place.
  • At whichever location is easiest, lift the retaining clip at one end of the ribbon cable connecting the power supply board to the “logic” board, then gently pull the ribbon cable free. This effectively disconnects the battery backup from the ECU.
  • I also spotted a black momentary switch on the power supply board. This may also be a reset/backup power interrupt, however being a multi-layer board, I couldn’t easily follow the traces to double-check. For safe measure, I press and held this for a few seconds as well.
  • Re-insert the ribbon cable, ensuring that it’s aligned correctly. Push the retaining clip back down to secure the cable.
  • Replace the boards, ensuring that the boards fit onto the alignment tabs. The power supply board was a bit tricky here.
  • Replace the cover. I found that securing the screws over the power supply board first helped to keep it aligned as mine wanted to pop out of place.
  • Replace the ECU, reversing the steps of removal.
  • Power on. You’ll see on the NAV screen: Loading application, do not power off.
  • I then saw the “Agree” screen. Success!

Interestingly, when I re-applied power to the navigation unit, the default GPS location was 1374 Pennsylvania Ave NW.

November 19th, 2008

New laptops, BBC, IT Crowd, iTunes backup

I am currently preparing for a data migration from my current laptop to either the same laptop with a re-freshed Windows XP install or a new laptop with a fresh Windows XP install.  The IT guy helping me with a failed forced update patch had the same reaction to my system as Derek did to Chip’s system and suggested that I migrate.

The only real thing I care about on my laptop is my iTunes (yeah go ahead, make fun of me) library.

In the process of the preparation for a new system I have been re-organizing my iTunes library to make it smaller so that the migration would not take so long.  I discovered that I have a number of duplicate songs and a lot of the songs that did not have proper metadata.  I assume that when I ripped the CDs (on my file server), my Perl script did not add the ID3 tags correctly which would explain why I added the songs again from another source (with proper tags).  Bugger.

Now, here I am, re-organizing my iTunes and watching the second show of IT Crowd season two.  I ended up listening to a song from my music that was un-tagged and realized that it was Delia Derbyshire from the BBC’s Radiophic Workshop.  She was most famous for her work in creating the Dr. Who theme song.

There was a youtube video that I saw of her doing reel to reel loops and mixing in the form of monome.  Only 40 some years earlier than when monome came out.

If there is someone that I would have liked to meet, it would have been Delia.  She’s awesome.

October 16th, 2008

excel trendline formula is inaccurate

While trying to create a graph with trendline to predict what a thermistor reading for a Prius’s radiator/engine temperature would be at certain temperatures I started battling MSFT’s Excel.

I created a chart with the known data collected about the voltage at the thermistor for  a list of temperatures.  I wanted a trendline to show the calculation so that I could use it to calculate the resistance of the thermistor at those temperatures.  However, after creating a chart and looking at the trendline formula’s calculation of known data, something was completely screwed up.

After some Google searches there was a link to Microsoft’s Help and Support website that indicated that “the trendline formula should only be used when your chart is an XY Scatter chart.” Great.  Well, at least I didn’t waste too much time on it and it was an easy fix.  However, why didn’t MSFT’s Excel team not grey out the trendline option for non-scatter charts?!

September 17th, 2008

it's the word, the word, the word…

Last week I was disparately looking for something good to listen to on the radio while I was driving around Atlanta, GA.  The radio stations in Atlanta seemed to have taken a horrible step in the wrong direction in the last 10 years… But I digress.

While pressing the radio’s seek button like frogger to avoid the massive number of rap stations I heard the end of some 70s sounding song with “It’s the word, it’s the word, it’s the word…”  Damn, why does that sound so familiar?

Right!  It was a sample in track two of “the word” from the Swordfish soundtrack by Paul Oakenfold.

Again, my music friend pointed that the chorus was from the movie sound track to Grease [the original].  It was from Frankie Valli – grease.  It was the last six seconds or so…

Paul Oakenfold – the word == Frankie Valli – grease

August 13th, 2008

Sending DHCP IP based on clients hostname

I’m working on a project where I need my DHCP server to send an IP address from a specific DHCP range if the hostname is a certain value otherwise it needs to send a normal IP address range.

I’m using Internet Systems Consortium DHCP Server V3.0.3 (ISC-DHCP).

To give a specific address range, we first need to detect if the DHCP client is sending the option 12 host-name and if so assign it to a class.

class “FooBar” { match if (option host-name = “foobar”); }

Once the client has a class associated to it we need to give it an address from a pool that doesn’t deny it.

subnet 192.168.0.0 netmask 255.255.255.0 {

Other DHCP settings here but make sure that the range is not specified; it overrides the pool settings.

pool {
allow members of “FooBar”;
range 192.168.0.90 192.168.0.99;
}

Otherwise we want the systems that don’t specify a hostname to get an address from the normal IP address pool

pool {
range 192.168.0.254 192.168.0.100;
}

Add more pools if needed

} # ending the subnet declaration

Pretty simple, hu?

UPDATE:

Thanks to a post I read by Bill Stephens of the PepsiCo Business Solutions Group, you can match a hostname using substr.  If your DHCP clients are named foobar-xyz you can use substr to match for foobar:

class “FooBar” {

match if ( substring(option host-name,0,6) = “foobar”);

}

(This would match the first 6 characters of the option 12 host-name)

May 20th, 2008

no network provider accepted the given path

I received the following error today when trying to open a samba share on a FreeBSD system from a clean Windows Server 2003 install:

“no network provider accepted the given path.”

“PC LOAD LETTER, what the fsck does that mean?!” I thought to myself. After some digging, I found that the default LAN Manager authentication level is set to NTLM response only and not LM & NTLM response.

Fix for the issue:

Administrative tools -> Local Security Policy -> Local Policy -> Security Options

Change: Network security: LAN Manager authentication level

From: Send NTLM response only

To: Send LM & NTLM responses