Thursday, June 28, 2012

Hot Texas Summer Hybrid Hack

Well, specifically for a 2009 Honda Civic hybrid.  And it's too simple to really consider a hack, but here goes.  When you pull up to a stoplight or stop sign, the car will usually shut off the gas engine and, also, the A/C.  With 100+ degree heat here, you need the A/C, particularly for those LONG lights in rush hour traffic on the way home.  Now the A/C "shutting off" in this Civic isn't as drastic as the A/C shutoff of the "original hybrid" Honda Insight models (as they've been described to me, where the blower/fan shuts off, too) from the early 2000's, the blower/fan is still running in my car when this happens, but the A/C stops cooling.  And things get warm, and fast.  I discovered that if you momentarily release the brake pedal almost to the point where the car is going to start rolling, but not quite, the gas engine kicks back on and you can reapply the brake pedal and sit at the light in comfortable coolness.

Take THAT, summer (and fuel efficiency)!

Wednesday, June 27, 2012

Near Field Communication (NFC) Coming to the New iPhone?

Some buzz has been going around this week about hints that the next iPhone will support Near Field Communication (NFC).  So far, NFC hasn't caught on big in the US, but this could certainly help.  Most of the things we've been told we'll be able to pay for with our smartphones (but, up until now, have been limited to the same things you could buy from your computer browser or the handful of things you can purchase-via-text and have the charge applied on your phone bill) will be possible with NFC.  Think along the lines of waving your phone in front of the soda machine to pay for your drink, paying tolls with a wave of your phone, transferring files to a colleague's phone without having to send an email, etc.

Here's a good, up-to-date list of NFC capable/rumored/retired phones...

Monday, June 25, 2012

Cliff Hanger Flashback

I sat down with my kids this evening to watch the Lupin the Third: The Castle of Cagliostro DVD I had bought for my daughter, who is now very interested in anime.  The opening sequence of the main character and his associate running out of Monaco casino (with cash they had just robbed) left me stunned: I remembered seeing that *exact* same sequence in an old laserdisc-based video game back when I was my daughter's age!!!  Specifically, at the Circus Circus casino in Reno, Nevada.

If you're not familiar with Circus Circus, back in the early 80's it was one of the few places kids could go and play games in Reno.  The first floor was usual, adult gambling.  The second and third floors had carnival midway type games, video games, and a restaurant, from what I remember.  Anyway, around the time Dragon's Lair and Space Ace were popular, we happened to be out in Reno for a SUGI convention my dad was attending.  We (my mom and brother and I) had tagged along and spent time playing games at Circus Circus, which is where I encountered Cliff Hanger.  I played it a bit, I recall getting from the casino to the car, and navigating traffic, not sure if I got beyond that, but it was a fun game.  And I never saw it again, ever.

Even though the gameplay of the handful of laserdisc games which came out in the 80's was somewhat stilted, I always enjoyed how cool it was to "play" a cartoon...

Friday, June 15, 2012

LED-Embedded Wristbands Part of the Show

Saw this article/video concerning a Coldplay concert where the wristbands they handed out to the audience contain LEDs which, at time, blink-in-sync with the music.  Neat idea.  I'd enjoy tearing down one and seeing what kind of micro and communications they used...

Monday, June 11, 2012

Little Victories with My Dymo Letratag "Tape Jam"

So my wife mentioned to me that our little, handheld Dymo Letratag label printer was stuck claiming a "Tape Jam" error.  She and I both looked at it, no tape to be seen jammed.  I poked around online a bit for any advice, all of which I found said "remove jammed tape" (and, sometimes, "clean the head and roller with a cotton swab dipped in alcohol").  I went ahead and cleaned it with the cotton swab, which it probably needed anyway, but no dice: "Tape Jam".  So I tried to manually move the roller with my finger., wondering if the gears were bound in a position that the motor couldn't turn them, triggering the "Tape Jam" error: it wouldn't budge.  Now these consumer-grade label printers are not expensive.  These companies appear to make their money selling the thermal label "tape" cartridges (like printer ink cartridges or razor blades).  So to throw this away and go buy another for $15 or $20 isn't a big deal.  But I like a challenge...

I went ahead and grabbed a small screw driver, removed the 4 AA batteries, and dug in.  After getting every screw I could find out, the motor driving the roller was still pinned in a fairly-inaccessible spot (between the plastic housing and circuit board).  But I could see that the motor uses a worm gear to drive the roller (which explains why I couldn't move the roller manually with my finger!).  I could not physically reach the worm gear (which ruled out me manually turning it with my finger), but I could clearly see it.

After a moment of consideration, I grabbed 2 AAs, wired in series, and two lengths of wire.  I connected one end of each wire to a battery, and then momentarily touched the other ends of the wires to the motor contacts (which were barely accessible to me).  The motor turned!

I (carefully) slapped the whole thing back together, and it was back to working fine!  Assuming the problem was "bound gears", I wonder if I had replaced all 4 AA batteries with fresh ones if the device would have given the motor enough power to "break" the bind...  I'll try that next time!

Wednesday, June 6, 2012

Need to Quickly Generate Some Specific Packets? Scapy!

I came across Scapy a couple of years ago via a coworker.  This Python-based software makes it incredibly easy to craft one (or thousands of!) network packet(s), which makes Scapy one of my favorite tools to "go get" when I'm in need of some specific packet crafting.

Let's say I need to create and send an IP packet to a machine at 1.0.0.2 with the "more frags" flag bit set in the header:


root@dev1:~# scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No route found for IPv6 destination :: (no default route?)
INFO: Can't import python Crypto lib. Won't be able to decrypt WEP.
Welcome to Scapy (2.0.1)
>>> mypkt = IP(dst="1.0.0.2")
>>> print mypkt
E@xç
>>> mypkt.display()
###[ IP ]###
  version= 4
  ihl= None
  tos= 0x0
  len= None
  id= 1
  flags=
  frag= 0
  ttl= 64
  proto= ip
  chksum= 0x0
  src= 1.0.0.1
  dst= 1.0.0.2
  options= ''
>>> mypkt.flags = 0x01
>>> mypkt.display()
###[ IP ]###
  version= 4
  ihl= None
  tos= 0x0
  len= None
  id= 1
  flags= MF
  frag= 0
  ttl= 64
  proto= ip
  chksum= 0x0
  src= 1.0.0.1
  dst= 1.0.0.2
  options= ''
>>> send(mypkt)
.
Sent 1 packets.

Cool, huh?

Scapy also has an easy-to-use packet processing function called sniff.  You can pass it an interface to sniff on, a filter (ala tcpdump filter verbiage) to only look at certain packets, and a callback function to send matched packets to.  If one wanted to, say, process LLDP packets on interface eth0 with a function called packetProcess(self, pkt), you could do so by calling sniff like this:

sniff(prn = packetProcess, store = 0, iface = "eth0", filter = "ether proto 0x88cc")

This will call packetProcess for each LLDP (i.e. packets with ethertype 0x88cc) packet seen on eth0.  Note that I say "seen" rather than "ingressing" since sniff() will pickup both ingressing *and* egressing packets on that interface. Also, the "store = 0" above tells Scapy to not store the packet itself, just forward a copy of it to the callback function.

Saturday, June 2, 2012

Dev Kit (and Tools) Pricing Disparities

I find it interesting (and, at times, frustrating) when I come across a vendor who wants to charge $500-$1500 for a development kit, particularly when it's a dev kit for an inexpensive microprocessor.  Of these I've run across, it's never been the case of "well, this kit has all sorts of things which warrant the high cost".  I've seen small startups, who need 4 or 5 dev kits, change their design/architecture decision because of exorbitant dev kit prices (seriously simple math: 5 x $1500 > 5 x $150).  Also, when the dev kit price is high, it makes one wonder what other costs may be lurking ahead (additional toolset license costs, nickel-and-dime structure for purchasing code/stack modules, etc.).  Certainly vendors with lower dev kit costs can have other fees, duh.  It's just a bit much to swallow paying a lot for a dev kit when the microprocessor device will cost you $10 or less.  And with the tools, I absolutely *love* it when a vendor has a free version for me to use that allows code of several KB in size to not require a license.  I think Motorola/Freescale did really well when, back in the day, they started offering CodeWarrior in a model like this.  Tactics like these make products more accessible to small startups, to poor college students, to the professional developer interested in tinkering.  Make no mistake, I'm *happy* to pay for good tools and advanced dev kits once my company has made a decision.  But it can be difficult these days to try and get approval for $1500 to buy a board to "try out" a candidate microprocessor, particularly when there's a suitable candidate with a $100 (or less) dev kit.  I'm just sayin'...