Thursday, June 25, 2009

wireless drivers that support Mesh Point mode

Here's a little script that I developed to query your Linux PC for information about mesh-capable wireless drivers, if any. It prints the relevant phy names, MAC addresses, and driver name. It just requires a recent version of iw. For example:


$ ./lsmesh.sh
phy1 00:1f:c6:20:c1:71 rt73usb
phy0 00:ff:f3:a0:24:bd ath5k


You then know what phy to use with iw (and what driver supports your device, if you're curious). Here's the script:


#!/bin/bash

PHYS=`iw list | grep Wiphy | cut -d ' ' -f 2`

for phy in $PHYS; do
iw phy $phy info | grep "mesh point" >/dev/null
if [ "$?" = "0" ]; then
MAC="`cat /sys/class/ieee80211/$phy/macaddress`"
DRIVER="`ls /sys/class/ieee80211/$phy/device/driver/module/drivers/ 2>/dev/null | cut -d ':' -f 2`"

echo "$phy $MAC $DRIVER"
fi
done

Thursday, June 11, 2009

Libertas GSPI driver in 2.6.30

The Libertas GSPI driver that I worked on is now mainline, as part of Linux kernel 2.6.30. While this is definitely good news, there have been subsequent improvements to the driver they'll land in upcoming kernels.

If you're planning to use this driver (which supports SPI-interfaced Marvell 88w8686 cards), please also take a look at:
  • this patch to remove the use of GPIO Chip Select in the driver. If you're using a Blackfin-based system, you'll need to configure your SPI controller to use GPIO-based Chip Select but that can be done in your board config and didn't belong in the libertas_spi driver!
  • this one with endianness fixes, especially needed for big-endian systems (ex: PowerPC)
  • this one with a fix for IEEE Power Save mode
...or, better yet, pull the driver from wireless-testing if possible so that you're working with the latest.

Wednesday, March 18, 2009

BMW repair: your charcoal canister and you

I wanted to comment on something that I keep seeing: cars where the owner or previous owner has disconnected the charcoal canister. If you haven't seen one recently, it's the little can that normally sits under the battery tray on your BMW Bavaria, 3.0CS, 2002, etc. and maybe in other places on cars like the E12 5-series. It has two lines that plug in to it. Here's one that, of course, was removed for no good reason:


The fuel tank ventilates into a small plastic expansion tank in the trunk. From this tank, there is a blue plastic tube that runs through the length of the car and into the engine bay and then into the charcoal canister. From there, a second tube runs to your air cleaner (or intake manifold on fuel-injected models), where the fuel vapor from the expansion tank is eventually burned by the engine. The charcoal in the canister serves two purposes: first, it stores the hydrocarbons from the fuel tank ventilation while the engine is not running (that is, while engine vacuum isn't pulling the vapor into the air cleaner or manifold), secondly, it is a safety mechanism: a backfire in your intake won't make it back into the fuel tank.

Now sure, after many years, the canister looks pretty nasty (mostly due to battery acid eating away at it). Replacements are readily available new (example: "activated carbon filter") and they're not that expensive. I've seen the damn thing disconnected by the previous owner of every car I've owned or helped a friend buy and there's never much of an explanation offered as to why:
  • Sometimes the owner is confused, the last one handed me the car's original Zenith carburetors in a box and in there was the canister. He asked me, "what is this thing anyway? I took it out".
  • Sometimes it's "I was taking out the smog equipment and this seemed part of it".
The canister does not decrease the performance of your car or otherwise cause you problems. It's not part of the EGR system or some other smog stuff that causes the engine to burn exhaust gases.

On the 2002 we have, as a bonus, the fuel tank vent tube was plugged with a bolt by some previous owner -- that's really bad, as pressure in the tank will then keep building up with nowhere to go.

If you're really set on the idea of taking all this stuff out, or you have nowhere to connect the line because you've converted to Weber side drafts and have no air cleaner to speak of, look at how it was done on European-market cars: they simply ran the vent line from the expansion tank down under the rear bumper, but there was still a vent line. On even earlier cars, there was no expansion tank but the fuel filler cap or neck were vented to the outside.

Please also consider this when you complain of fuel vapor inside the car. Perhaps this small set of tubing that is supposed to vent out the fuel tank into the air cleaner is no longer hooked up, venting fuel vapor into the engine bay? Or did someone disconnect the line at the expansion tank, causing vapor to leak into the trunk?

In addition, on later cars like the E12 528i and E28 five series, there is a thermal/vacuum-operated switch in-line with the tubing from the canister on its way to the intake manifold. This additional step keeps the fuel vapor from being burned before the engine is warmed up (and then is able to burn it better), which decreases emissions. This is probably overkill for early cars that never had it, but that's what it's for in case someone is wondering.

(thanks to Tony and Keith on the SSR list and to john_a on the 2002 FAQ message board for additional details).

Sunday, March 15, 2009

Vespa Ciao wiring repair

I'm doing some minor repairs on a 1976 Vespa Ciao, which is a cool little 50cc moped. I was quite happy to find out about Zippy Moped, who stock a lot of parts for the Ciao.

The wiring on this Ciao had deteriorated over the years and showed some poor-quality repairs. One of the previous owners also lost the bracket that hangs over the engine and holds the foot rest cover and, I suspect, keeps the wiring away from the hot engine casing.

Here's what I've learned about Vespa Ciao wiring so far:
  • the electrical system is 6V AC. Don't forget to put your multimeter in AC voltage mode before measuring since you normally use DC. For example, I wanted to know if the ignition feeder coil and condenser circuit were actually pulling 6V across the ignition coil so I disconnected the coil and measured the voltage (with respect to the engine casing) while pedalling.
  • electricity is generated by a magneto that consists of the flywheel, which has magnets on the inside, and two 'feeder' coils that sit underneath it. One coil is for the 'lighting' circuit (front and rear lights, horn) and the other connects to the ignition coil through a condenser. The main shaft that the flywheel spins on actuates the ignition points, which can be adjusted through a little window that's normally closed off by a rubber cover.
  • the wiring is really simple but not very robust: a burnt-out tail light can be enough to kill the ignition and putting a 12V bulb in the tail light (as was done by some previous owner) is really bad. If in doubt, unplug both brake light switches from the handle bars and, on each one, short their two leads together to bypass the tail light entirely. The correct 6V bulb is available.
  • near the engine, in general, the ignition wiring is purple and the lighting wiring is blue. There's a red wire which is the lighting circuit ground and a black wire which is the ignition circuit ground. There are several wiring diagrams available but none of them seemed to match this Ciao and that seems to be fairly normal.
  • You need a special tool to remove the flywheel, and you need to do that to get to the 'feeder' coils and condenser. It's not very expensive and you can get it from Zippy Moped Parts.
  • The clutch mechanism has two sets of shoes, one of which is only used for starting the engine. The engine should start easily with the decompression lever pressed, mine doesn't and the starting shoes do look worn. It does start when I pedal a little, so I think it needs new starting shoes.
Beside wiring repairs, I wound up installing a missing bracket and decompression cable, air filter, and fuel filter. I also replaced a broken carburetor elbow piece for the throttle cable. The Ciao now runs pretty well (and reliably) but the carburetor needs adjustment and I need to fix a fuel leak that I accidentally caused while replacing the fuel filter.

Friday, February 27, 2009

Front suspension and a little engine work on the BMW 2002

The new yellow 2002 runs and drives pretty well but the front timing cover oil leaks are pretty bad and the front suspension didn't feel too great, so we decided to do a bit of work (and take photos as we go).

On closer inspection, the motor seemed to leak pretty badly from some combination of the lower front timing cover, possibly the oil pan, and the distributor cover on the back of the head. We're not ready to rebuild the motor yet, but we figured it's worth pulling it and replacing all of the gaskets outside the car where everything is easy to reach.

Attempting to pull off the front bumper revealed that the front suspension was quite damaged. The exhaust side of the subframe was slightly twisted and bent upward at where the bumper bracket sits and the control arm on that side had a good dent in it. The bushings looked tired and we have a lot of steering play anyway, so we decided to drop the front subframe with the engine out and replace everything.

Aron found a good used front subframe that, as a bonus, came with a bigger sway bar and several good spare parts attached:


We pulled it all apart, ordered new control arms, steering links, ball joints, bushings, and other components and then Aron cleaned up the actual subframe and sent it out to get painted. We also went ahead and pulled the engine and then Aron dropped the front subframe. Here's what that looks like, after years of oil leaks:



And here's our "new" one, coming together with nice new components:


Next, we'll clean up the engine bay and replace all of the seals on the motor (along with the water pump and the timing chain and guides for good measure) and then reassemble everything.

Saturday, January 17, 2009

one more option for embedded Linux WiFi hardware

There's now one more 802.11b/g wireless chipset available to use in your next embedded Linux system. Thanks to the Blackfin folks at Analog Devices, we now have a driver for the Marvell '8686 chipset using a GSPI interface suitable for many embedded applications. We also fixed an alignment bug in the core driver so that things work on CPUs such as Blackfin and AVR32. Embedded WiFi modules with this chipset are available from several vendors. The new driver, libertas_spi, is available in wireless-testing and coming to a future kernel (2.6.30, most likely).

GSPI is very easy to interface as it consists of a normal SPI bus, an IRQ line, and one GPIO line that acts as a chip select signal (as such, be sure to enable CONFIG_GENERIC_GPIO in your kernel config in order to build the new libertas_spi driver). The GPIO-style chip select is different from a typical SPI chip select in that the chip select stays asserted for an arbitrary number of SPI bus transactions.

Wednesday, January 7, 2009

draft-802.11s mesh in the 2.6.28 kernel

The 2.6.28 kernel, released on Dec. 25th '08, brings several nice improvements to the draft-802.11s mesh support in mac80211:
  • mesh support in the ath5k driver, which supports most Atheros 802.11b/g hardware.
  • mesh parameters can now be adjusted through nl80211 via the iw user space tool instead of using debugfs.
  • initial work on MPP support -- this will allow Mesh Point interfaces to be bridged with other interfaces.
  • several bug fixes and improvements as well as some reorganization of the code.