Using the ThinkVantage LED on an x300

Short version: I figured out a way to control it that will actually work on modern systems. Read below to see how to get full control of it (even more control than you get from the other LEDs, including 3 different blink modes).

After googling and digging through some resources such as this thread, I had come up empty-handed, since the /proc/acpi/ibm/ecdump interface is deprecated and no longer included in the thinkpad-acpi driver. The solution: a fancy new program called “ec_access“, which uses the sysfs embedded controller interface, rather than the deprecated procfs one.

Just one problem: it’s not enabled in the kernel by default. I’ll leave you to figure out how to compile a custom kernel for your distro, but the config option that needs to be enabled is “CONFIG_ACPI_EC_DEBUGFS”. This will expose /sys/kernel/debug/ec/ec0/io, which ec_access uses. While you’re at it, you may also want to enable “CONFIG_THINKPAD_ACPI_UNSAFE_LEDS”, which will give you control over the orange and green battery LEDs.

Once you’ve got the kernel working, and can confirm that /sys/kernel/debug/ec/ is present on your system, compile ec_access.c.

Now, you should be able to run “ec_access -w 0x0c -v 0xXY”, where Y is the LED number (“d” in the case of the thinkvantage LED), and X is one of the following:

  • 0-7: LED off
  • 8-b: LED on solid
  • C: Slow, heartbeat-like pulse
  • D: Smooth, slow pulsing
  • E: Faster blink
  • F: LED on solid

Now, you can use this LED in scripts or whatever you need it for. Unfortunately, I haven’t taken time to look at how one would modify thinkpad-acpi to support this LED (or even why its existing tpacpi::thinkvantage LED interface doesn’t seem to work for this).

Known issue: The LED doesn’t seem to run at full brightness when it is set to solid. It is visibly brighter when put in one of the blink modes.

Mini-review: Intel 7260HMW

I bought this to replace a Wi-fi card in my laptop (Thinkpad X300) since the standard card had flaky Linux support. The 7260HMW is a half-length miniPCIe card with 2xU.FL connectors.

Good:

  • 802.11ac support
  • Good Linux drivers, works out of the box on Debian testing
  • Built-in Bluetooth 4.0

Bad:

  • General signal strength is rather poor (happens on both Linux and Win7 so it’s not a driver issue)
  • Only 2 spatial streams supported, only 2 antennae. If you currently have 3/4 spatial stream 802.11n equipment, this card won’t be able to get top performance from those.

Other:

  • If your laptop has a Bluetooth LED in addition to Wi-fi like on many Thinkpads, this card won’t interact with it. In fact, having multiple BT cards (this card+builtin BT) can even cause the LED to not even work with the builtin BT if you choose to leave it installed (Easy enough to remove on my X300 but difficult on my W510).
  • The Wi-fi LED will just be on solid, rather than on+blink on activity. Does this on Win7 and Linux, and none of the settings in /sys/class/leds/phy0-led/trigger seem to get the desired behavior.

Using the Sierra MC5725’s GPS on Linux

After not being able to get this card’s GPS to do anything, I forgot about it for a while. Now that I’ve had some time, I revisited it and was able to get it working. Read on to see how.

Read the rest of this entry »

Major MVpyBot Refresh

I have rewritten most of MVpyBot. New features:

  • It has a GitHub page
  • The GitHub page also has some good documentation for admins, users, and developers
  • Improved module architecture (unfortunately, modules will need to be rewritten but this isn’t hard)
  • Code in general is much less of a clumsy hack
  • Proper error reporting (no more having to guess what’s wrong/enable debug mode)
  • New implicit authentication mode, designed for IRC servers where nicknames are already authenticated (such as twitch.tv)

Head on over and try out the new version.

Installing OpenWRT on a Firebox X550e

I recently came into possession of a Firebox X550e Core that was thrown out due to a bad power supply. Turns out OpenWRT (or almost any OS for that matter) is pretty easy to install on this thing. Read on for some photos and a how-to.

IMG_0274s

Read the rest of this entry »

An RGB LED for your RSPro

As I mentioned in my review, the Routerstation Pro only has a single user-programmable LED. However, it has 7 GPIO lines that can easily be attached to more LEDs. Read on for instructions and pictures.

Read the rest of this entry »

Review: RouterStation Pro + SR71A

After finally deciding to replace an aging WRT54GL, I decided to not get a typical poor-performing home router and go for a more professional product. The RouterStation Pro fit my needs perfectly, with its expandability and performance being far beyond most home routers. Read on for the review and pics.

Read the rest of this entry »

MVpybot stuff

Just a few minor fixes, new version should be in SVN.

Major MVPyBot Update

The bot now supports “hot reloading.” The bot can now reload itself without losing connection due to a new wrapper.

You need to run ‘mvpybot.py 0′ because start.py is broken now. Substitute the zero with a different server number if you want to connect to a different server.

MVpybot Major Update

There is a somewhat-major bot update in the works. The plugins system has been completely redone. Instead of plugin files being used for whatever functions can be found in them, they now have to explicitly register functions. Here is an example, the rewritten ping plugin:

#!/usr/bin/python

def register():
 registerfunction('ping', ping)
 addhelp('ping', help_ping)

def ping():
 outstuff=''
 print "ping called"
 if (len(cmd)<2):
  return('PRIVMSG %s :Incorrect usage. Syntax: ping (4|6) <address>.' %(channel))
 else:
  if cmd[1]=='4' or cmd[1]=='6':
   if cmd[1]=='4':

    output=syscmd(['ping','-c','5','-i','0.2',cmd[2]])
    outsplit=output.split('\n')
    outparts=outsplit[-3:-1]
    for part in outparts:
     outstuff+='PRIVMSG %s :%s\n' %(channel,part) 

   if cmd[1]=='6':

    output=syscmd(['ping6','-c','5','-i','0.2',cmd[2]])
    outsplit=output.split('\n')
    outparts=outsplit[-3:-1]
    for part in outparts:
     outstuff+='PRIVMSG %s :%s\n' %(channel,part)
  return(outstuff)
  else:
   return('PRIVMSG %s :Error: protocol must be either 4 or 6' %channel)

def help_ping():
 return('PRIVMSG %s :Pings an internet address. Usage: ping (4|6) <address>.' %(channel))

A plugin’s register() function is called when the plugin is loaded. It can use registerfunction(), addlistener(), and addhelp(). You can use each function as many times as you want, in case you have multiple functions and/or listeners, or if you want to include help with your plugin.

Read more to find out how to use the new plugin features.

Read the rest of this entry »