After going months without a lot of time for working on my hobby projects, I finally had a few free days to work on debugging my embedded Bluetooth stack for the Propeller. I got it working well enough to demo a Serial Port Profile device, implemented using only a Propeller Demo Board and a $2 USB Bluetooth dongle:
Posts Tagged ‘usb’
Propeller Bluetooth Stack Demo
July 25th, 2010It’s Alive: Bit-banging full-speed USB Host for the Propeller
April 1st, 2010I’d like to make a more detailed post about this once the project is a bit further along… but for now just a brief description and a couple teaser photos
This is one of those things that people have said was impossible, and I’ve wanted to try it for a while. I finally found an excuse. I wanted a way to build more cheap wireless networked devices. You can get bluetooth and wifi adapters that are microcontroller-friendly, but it’s a niche market so you’ll pay a lot. I wanted a way to use the $2 bluetooth dongles and $10 wifi adapters you can easily find online or at your local electronics shop. But these devices are all USB, and USB host controllers aren’t yet common on small hobbyist-friendly microcontrollers like the Arduino and Propeller. So, I decided I’d see if it was possible to implement a USB host controller entirely in software on the Parallax Propeller microcontroller.
Turns out that it is. This still needs more development before it’s generally useful, but it’s already showing potential. Of course there’s a long list of caveats on something that pushes the limits of both the Propeller and the USB spec, but none of them should be deal-breakers for most applications.
If you’re interested in helping with or following the project’s development, there’s a thread on the Parallax forums. The latest source code is in my usb-host Subversion repo.
Announcing vusb-analyzer 1.1
December 3rd, 2009The Virtual USB Analyzer is a graphical tool for analyzing USB sniffer logs. It can do some basic protocol decoding, and it has a graphical timeline view which helps to visualize the latency and concurrency characteristics of USB traffic.
This release only adds a single feature, but it’s one that many people have probably been waiting for: support for Linux’s built-in usbmon sniffer tool.
With usbmon, tracing all USB traffic on your system is as simple as cat’ing text from a sysfs node to a file. It doesn’t have quite as many features as VMware’s low-level capture logs, but for most users (especially users debugging Linux USB drivers) this should be more than sufficient.
If you aren’t familiar with usbmon, the first thing to read is Documentation/usb/usbmon.txt from your kernel sources. That will tell you the basics, including how to capture raw data from the kernel. There are a few other simple front-ends for making this data more human-readable. If you’re using vusb-analyzer, those tools aren’t required. Just save the raw data to a file with a .mon extension, and hand that to vusb-analyzer.
This feature was a patch contributed by Christoph Zimmermann. Without his contribution, I no doubt would have procrastinated this release for many more years
“Luggable” power pack
June 9th, 2009Paul and I are leaving on a cross-country train trip next week, for Jen and Shawn’s wedding in Colorado. I’m sure the view will be great, and I’m bringing a handful of books- but Paul and I are geeks and we need our electro-doodads. If only we had a way to run our Nintendo DS and PSP for the ~30 hours that the trip will take…
I sifted through my stockpile of junk, and came up with this:
It’s kind of like a mega-size Minty Boost, or a heftier version of the Kensington power pack. The Minty Boost weighs in at about 6 Watt-hours, depending on the AA cells you use. The Kensington pack is rated at 7 Watt-hours, with a Lithium Ion battery. This brick occupies the middle-ground between the Minty Boost and a car jump-start battery, weighing in at 84 Watt-hours. It should run and charge a Nintendo DS for at least 30 hours.
It’s built almost entirely from junk that I had lying around the house: (Your house may vary.)
- 12 Volt 7 AH Lead-calcium battery
- Aluminum box, in my stockpile of project enclosures
- Receptacle end from a cigarette lighter extension cable
- DC-DC converter from an old Nokia phone charger (for a phone I no longer use). Swapped a resistor with a trimmer pot for 5V output.
- USB sockets from a dead 4-port hub
- Heavy duty wires and quick-disconnect plugs from a dead UPS
- Odds and ends: Switch, mounting hardware, fuse holder, wire nuts, foam weather-stripping, JB-Weld epoxy, heat shrink tubing, LED, resistors
Parts I had to buy at the local Fry’s:
- 10 Amp fuse (Pack of five for a few dollars)
- 12V 1 Amp lead-acid battery charger ($20)
- Cigarette lighter plug for the charger ($2)
Now here’s hoping that nobody thinks it’s a “hoax device”…
P.S. I’m still working on the Robot Odyssey DS port and in fact there are some interesting bits of UI working now- but I haven’t quite reached another blog-worthy milestone yet.
Virtual USB Analyzer
January 12th, 2009From late 2005 to early 2007, I worked on the USB virtualization stack at VMware. We ran into all sorts of gnarly bugs, many of which were very hard to reproduce or which required access to esoteric or expensive hardware. To help with debugging problems both internally and with customers in the field, we added logging support to our virtual USB stack. Starting with VMware Workstation 5.5, if you set the right hidden config option we’d start dumping the contents of all USB packets to a log. It was a USB sniffer (like USB Snoopy), but built into the virtual hardware.
To make it easier to analyze the resulting logs, I started working on a GUI tool that could navigate through these giant log files. This tool proved to be really useful within our team at VMware, and we’d often ask customers on the beta forums to generate log files that we could analyze. I called this tool vusb-analyzer.
Well, it’s been a while, but I’m proud to now have the opportunity to release vusb-analyzer as open source software under the MIT license. This isn’t just a code dump- I removed the tool from our internal repository today, and all future development will occur in the open, in a Subversion repository on Source Forge.
Currently, vusb-analyzer is most useful for analyzing logs captured by VMware products. Indeed, this is a convenient way to debug USB drivers. You can attach your USB device to VMware Workstation, VMware Fusion, or the free-as-in-beer VMware Player, and it can transparently save a plaintext log of all USB packets that pass through. Debugging a driver in a VM is really convenient, and I find it quite useful, but I understand it’s not for everybody. If you already have a favorite USB sniffer tool, it’s easy to extend vusb-analyzer with a log format plugin so it can read other formats. We already did this once, to add support for the logs generated by our favorite hardware USB analyzers.
I hope vusb-analyzer turns out to be useful for the open source community, particularly to those who are working on Linux device drivers. To get started, visit the project’s web site:
http://vusb-analyzer.sourceforge.net
Besides the usual introduction and download links, there is also a detailed tutorial with lots of shiny screenshots
Whirlwind update
March 19th, 2006CIA
EXPLAIN SELECT is your friend. Added a few indices, eliminated a filesort and a temporary table. Now the front page is super-speedy. Hopefully this will control some of the minor growing pains that I’ve been seeing in the last couple months.
Of course, this is no substitute for some real designed-in scalability and maintainability. I finally updated the to-do list to include these “deep changes”. In theory I’m currently working on Caterpillar Daemon, but I honestly haven’t had the right combination of time and motivation lately to make a whole lot of progress on it.
I should probably set up trac for CIA. At the least, it’s about time we had a mailing list and a bug tracker. The main stumbling block for this actually is that I have no idea what to call such a server. trac.cia.navi.cx is a bit unwieldy. I’d love to have a good second-level domain for CIA, but nobody has come up with a suitable name for one as of yet. Any ideas? cia.gov is probably taken.
Sorry, I’m a little behind on email. Take a number…
Life
Complicated… with a distinct sense of deja vu from almost exactly a year ago.
I’ve had Donnie Darko (the soundtrack and the movie itself) stuck in my head for about a week now. Very tempted to put in an Amazon order with that and a couple other favorite movies of mine that I haven’t bothered purchasing yet.
Jen, David, and Kendra are coming in less than a week!
Music
I forgot how much I like Mogwai.
I finally did some re-wiring such that I can easily route audio to my living room speakers from either the TV, DVD player, HTPC, video games, laptop, or Rio. The Rio cradle also has Ethernet again, including my lovely hack (schematic) to work around a bug in their Ethernet transceiver.
I’m still amazed by how much wiring I’ve been able to stuff into a TV stand that’s exactly the minimum size to hold my subwoofer, DVD player, and 42″ plasma.
Beer
A few weeks ago I finally got around to trying David‘s favorite beer, Black Butte Porter. I’m still quite a Guinness fan, but now this may very well be my favorite beer too.
SVLUG
Well, I finally accepted Paul’s nomination for Vice President. Despite my total lack of motivation this weekend, I’d like to start out by helping fix up the increasingly decrepit web site. We’d like to just stick a wiki in there- we’d have introductory content and event schedules posted by core volunteers, but the rest of the site would be more of a general purpose forum for Linux users and other forms of open source nerds in the bay area.
Looking farther ahead, I’d really like to do my part to make SVLUG appeal to open source hackers, rather than just people who use Linux for the sake of using Linux. I should write more on this soon…
USB
Since some clown seems to think I’m a USB-obsessed lunatic, I might as well have a section just for this.
There are lots of exciting USB-related happenings at VMware lately. They should be sneaking into a release later this year, and I’ll finally be able to talk about all the coolness without totally ruining the surprise for you non-VMware folks. For VMware folks, I helped give a tech talk on Wednesday covering our recent USB work.
On a whim today, I thought I’d try getting my old wireless thermometer system working again. I’ve had all the equipment in a box since I moved to California, just waiting for me to set it up. Well, that’s not entirely true… the original system used this awkward combination of MySQL and rrdtool that I’d really love to replace with a clean integration into our Cacti setup.
All hopes of that were dashed away as I gave up on just getting my laptop to talk to the receiver module. I’m not sure whether it’s a new version of SDCC breaking the firmware, or a new Linux kernel that’s a little more picky, but the firmware is dying in an infinite loop the first time my laptop tries to read its device descriptor. I’m tempted to use the USB analyzer at work to debug this.
February 22nd, 2006
Well, it’s been a while since I’ve updated. Nothing on its own recently has inspired me much to write, but I have some smallish things to mention.
I have a new laptop on the way! My 700 MHz Pentium III with 192MB of RAM was just getting too clunky for day-to-day use. I recently ordered a Thinkpad T43 with 2GHz CPU, 1GB RAM, and SXGA+ 14.1″ display. It shipped Monday, and I can’t wait to start using a Real Computer.
At work, things were stagnating a bit for the past few days. I have three fairly large changes all blocking on code reviews, and no really solid projects in progress. Well, today that changed- I got some new hardware, and began on a really exciting Top Sekret project. If it goes well, you’ll find out eventually.
Life? Not bad at all… I had a really enjoyable three-day weekend. David, Jen, and Kendra are visiting during their spring break, in less than a month. Plans for that week-long adventure are starting to gel, and I can’t wait.
[Update: The Top Sekret project in this post would eventually become VMware Fusion 1.0. I was working on USB at the time, and I did the original port of VMware's USB stack to Mac OS.]







