Kickstarter!

It feels like it's been ages since I've updated my personal blog. That's likely because it's been ages since I updated my personal blog. I've been nose-down for most of the past two years working on the Model 01, our new keyboard.

 

The Model 01 is now on Kickstarter. Please back us today. Kaia and I are doing something kind of crazy — a coast to coast roadshow to support the campaign. You can find our plans on the Kickstarter page. If you're somewhere along our route, we'd love to say hi.

 

 

Advertisements
Kickstarter!

How to reboot an Arduino Leonardo / Micro into the bootloader.

One of the things we're building for the Keyboardio Model 01 is an interactive keyboard shell that I've provisionally named "quiche". 

Today, I implemented functionality to allow the user to reboot the ATmega32U4 inside the keyboard into the Caterina bootloader so the user can upload new firmware.

It took a lot more time than it should have to find the right magic incantations to get the bootloader to stay in firmware upload mode. (In the end, it was just a matter of looking at CDC.c inside the Arduino core.)

So that nobody else has to stumble through this as I have, I've pasted my solution below.


#include <avr/wdt.h>
// [...]
// Set the magic bits to get a Caterina-based device // to reboot into the bootloader and stay there, rather // than run move onward // // These values are the same as those defined in // Caterina.c uint16_t bootKey = 0x7777; uint16_t *const bootKeyPtr = (uint16_t *)0x0800; // Stash the magic key *bootKeyPtr = bootKey; // Set a watchdog timer wdt_enable(WDTO_120MS); while(1) {} // This infinite loop ensures nothing else // happens before the watchdog reboots us

Solutions that didn't work for for me included:

  • Writing raw assembler like:

asm volatile ("jmp 0x7800"); // This address also happens to be bootloader-size dependent

  • Tweaking MCUSR to try to convince the bootloader that an external reset had been initiated.

 

How to reboot an Arduino Leonardo / Micro into the bootloader.

Model 00

Image

The Model 00 is very similar to the Mark 13 I mentioned over at http://blog.fsck.com/2013/12/better-and-better-keyboards.html, though it (finally) uses a PCB I designed and had Seeed Studio make me 10 copies of (for $200, including FedEx Next Day shipping from China!) and has a shell made from stained, polyurothane-coated birch plywood rather than acrylic sheets. It's pretty close to a "final" layout for the keyboard we're hoping to Kickstarter.

So far, we've built out four of our 10 PCBs. Two of them are for us. The other two are being sent to unsuspecting beta testers tomorrow. (They won't get there in time for Christmas, but what can you do?) We're not 100% sure what we're doing with the other six, but if we sell any of them, we'll tell the keyboard.io mailing list.

Image
Image
Image
Image
Image

 
 
You can find more photos of the Model 00 on Flickr.
Model 00

Better and better keyboards.

It's been a while since I've written about my keyboard-building adventures….apparently, I haven't blogged about keyboards since April of this year. I've been too busy designing keyboards.

The first thing I should get out of the way is that you're going to be able to buy one. We're working hard to finalize a design and find manufacturing partners. If you want to know when we're ready to take your money, head on over to http://keyboard.io and sign up for our announcement list.

When I last wrote about keyboards here, I'd just completed my first fully homebrew design – the Mark 2 keyboard. From my phrasing, it was pretty clear that I intended to tell you about the Mark 3 that I'd already built.

Homebrew Mark 3 Prototype

Mark 3 Keyboard

The Mark 3 was an attempt to build the most compact, yet reasonably ergonomic keyboard I could. It was also the first time I got to drive the lasercutter myself. As such, the folks at Danger!Awesome had me use plywood rather than acrylic.

The keys were arranged in what's known as a 'symmetric stagger' It was quite compact. And I didn't like it at all. Among other things, the thumb keys just weren't as comfortable as I wanted.

mark 4 keyboard prototype

Mark 4 Keyboard

The Mark 4 was the first thing that started to feel right. It was also my first foray into TRON-style thumb keys. I loved them. And hated them. I got the angles and positioning wrong. And my brilliant idea of having two rows per-thumb was a total bust. They just made it harder to hit either row. But it looked cool. Man did it look cool.

Mark 5 Keyboard

Mark 5 Keyboard

The Mark 5, I finished just in time for Valentine's Day. A friend remarked that it looked kind of like a heart. So I made it look a lot like a heart. It was actually pretty good, but had a couple fatal flaws.

I was late for my lasercutting appointment when I decided to place the heart…and I misaligned it. I ended up having to dremel notches into a couple of the number-row keys in order to get everything to fit. The thumb keys with a shared central diamond seemed like a great idea when I was designing it, but in practice it was a pain to use. It was really hard to hit the top key in the diamond. For the keymap I was using at the time, that was the Control key. Emacs-using friends absolutely hated it. I got enough time typing on the Mark 5 that I finally started getting comfortable…except that I found my pinkies just sort of hanging out over the edges of the keyboard much of the time. It took a little while, but at Kaia's urging, I added an extra column for each pinkie on later models. This dramatically improved the usability and comfort for me.

A study for the Mark 6 Keyboard Prototype.

This was right around when my 3D printer finally showed up. I spent most of a month teaching myself the rudiments of 3D modeling with OpenSCAD. It took a lot of tweaking to be able to reliably generate keyboard 'plates' that would reliably seat keyswitches without being so tight they caused the switches to bind or so loose the switches popped out.

Mark 6 Keyboard

Mark 6 Keyboard

The interesting things about the Mark 6 were:

  • It was 3D printed. Each of the 'hand' plates took 3-4 hours to print. The bottom shell took about 12.
  • The key columns were splayed to better line up with where your fingers end up when you reach
  • It was tented — The middle of the keyboard was just slightly taller than either side.
  • It had a rather significant negative slope — the part of the keyboard under your wrists was higher than the part further away from you.
  • The keyplates were separate from the shell of the keyboard. This made it really easy to iterate on key layout separately from keyboard shape.

The things that sucked about the Mark 6 were:

  • The column splaying was far too wide. I could reach everything, but it wasn't particularly comfortable.
  • The negative slope was far too pronounced. It was just uncomfortable to use with the bottom of the keyboard flat on the desk.
  • I still hadn't added the extra columns Kaia had suggested.

Mark 7 Keyboard

Mark 7 Keyboard

The Mark 7 was a fairly straight forward iteration from the Mark 6. Neat things about the Mark 7 included:

  • Splitting the thumb and finger keys onto two different plates. This let me slightly change the angle between them.
  • Switching from a 5 key arc of thumb keys to a four key arc with a key above the arc and a new 'palm' key. The palm key, in particular, turned out to be pretty amazing. I use it to enable an additional layer of keys. Arrow keys live under HJKL. {}[] live under YUIO, and so on.
  • Slightly reducing inter-column finger splaying.
  • Finally adding the extra columns of pinky keys. These meant that the ` = ' – keys no longer needed to be hidden away on the second layer.

What didn't work so well in the Mark 7:

  • The keyboard shape was still pretty boxy
  • The inter-column finger splay was still too wide
  • The thumb keys were a bit too far away from the rest of the keyboard.

2013-07-23 11.20.05

Mark 8 Keyboard

The Mark 8 was my first attempt to make a thin keyboard. It was identical to the Mark 7, except it was printed as two pieces — a single key plate and a single bottom shell.

The biggest issues with the Mark 8 were that its shell wasn't structurally sound and that the front edge of the keyboard was sharp and ended up right in the middle of the user's palms.

2013-07-22 12.01.10

Mark 9 Keyboard

I spent a full week teaching myself how to design and 3D-print ball joints for the Mark 9. Two of those days were spent figuring out how to print all the parts of a ball joint as a fully assembled unit. Once I had it pretty well worked out, I realized that I was actually better off printing the two halves separately.

2013-07-18 18.33.09

Mark 9 Keyboard, in two pieces

Things that were really cool about the Mark 9:

  • It had a ball joint!
  • You could position the two halves independently!
  • It was thin!
  • It had rounded corners and edges!
  • It was the first keyboard I managed to print in ABS rather than PLA. As such, it just felt a lot nicer. Also, the colors were more exciting. (If pushed, I'll admit that the color choices were dictated by when I ran out of each spool of filament.)
  • I slightly reduced the inter-column finger splay. It was starting to feel reasonable.

Things that could have been better about the Mark 9:

  • It was basically impossible to use in my lap or tented on a desk — The balljoint didn't work well enough to use unless the keyboard was on a flat surface.
  • The cables I used between the two halves were too brittle and unwieldy.
  • It suffered from the same problem as every other 3D-printed keyboard I'd made to date – When I showed it to someone, they got really excited about the fact that I had a 3D printer. In contrast, whenever I showed someone one of the layered acrylic prototype keyboards I'd built, they got excited about the keyboard.

2013-08-30 22.56.12

Mark 10 Keyboard

The Mark 10. I don't have a lot to say about the Mark 10.

Things that sucked about the Mark 10:

  • While trying to print it, my 3D printer caught on fire.

Things that were great about the Mark 10:

  • I was forced to switch back to layering sheets of lasercut acrylic. While frustrating at the time, it was ultimately really, really good.

2013-09-18 01.40.18

Mark 11 Keyboard

I built the Mark 11 to take to XOXO. I'd had a lot of time to think and play since I'd made the Mark 9. And the Mark 9 just wasn't a usable keyboard for me. I procrastinated just a little bit too much and didn't have enough time to lasercut it myself. I ended up paying the nice folks at Danger Awesome a rush fee to get it cut within 24 hours after I emailed them my EPS files. Like the earlier lasercut keyboards, it was made out of stacked layers of acrylic. I went back to the completely-clear acrylic I'd used in the Mark 3, except this time I made the topmost plate thicker to better protect the key edges as I slid it in and out of my bag and to slightly raise the typist's hands into a more neutral position. The heart shape didn't work well with the palm keys — playing around a little bit, I cut out a medium arc around the palm keys. It looked a little bit like a butterfly.

In general, I really liked the Mark 11. It was the design in a while that I was actually able to use as my primary keyboard. People I showed it to also liked it. This made me pretty happy. The comment that most blew me away was "If you made a commercial keyboard just like this, you could sell it in the MoMA Shop."

There were a few things about the Mark 11 that didn't work:

  • It was really heavy. Really, really heavy. It turns out that a 9"x13" sheet of 1/2" thick acrylic is heavy. Who knew?
  • The sheet of acrylic that served as the keyplate started cracking pretty quickly. I'd seen that a little bit on earlier designs, but for whatever reason, the the Mark 11 was doing a pretty good imitation of a spiderweb.
  • The top layer of acrylic (the one in the butterfly shape) did a really good job of putting not one, but two sharp edges under each palm. On top of that, the positions I'd chosen for the screws that held the keyboard together put screws in a perfect place to bite into your palms.

2013-10-19 00.16.56

Mark 12 Keyboard

In an effort to cut down size and weight, the Mark 12 changed up the design just a little bit. I made the butterfly shape, now quite intentional, the outer edge of the keyboard. I did my best to keep the footprint the same size as an 11" MacBook Air. To help cut down on weight, I made the bottom layer of the keyboard a bit thinner. To better support the keyplate layer (and cut down on cracking), I made the electronics-wiring layer of the keyboard a full sheet with specific cutouts, rather than a wide outline. To further cut down on cracking, I changed most of the right angle cuts on the keyplate to gently rounded corners. (They may be somewhat out of vogue for web design, but rounded corners are really useful for lasercutting.) I moved the screws so they wouldn't bite into a typist's palms. To give it just a little bit more personality (and to make interlayer dust slightly less obvious, I cut the electronics-wiring layer out of translucent orange acrylic. After assembled, I softened the sharp edge under the typist's palms with a hand file. The layout didn't change much from the Mark 11. Just about the only thing I did was to tighten the inter-column finger splay just a bit more. Based on a study at Berkeley that claims any key spacing of 17mm or more doesn't increase error rate or typing pain for large-handed users, I tightened the baseline inter-key spacing to exactly 18mm. (I'd have tried 17mm, but knew that my current keycaps were just too big.)

The Mark 12 was good. Really good. I liked it. It felt nice to type on. It was fairly compact. It was totally manufacturable. The only real issues I had with it were that the palmrests were about half an inch too small for my hands and I'd misguessed on the lower bound of key spacing I could get away with — they would sometimes scrape against each other as I pressed them.

2013-11-01 19.04.55

Mark 13 Keyboard

I'm typing this on the Mark 13 keyboard. I feel more comfortable on it than on any other keyboard at this point. While I'd like the Keyboard.io Model 01 to have 17mm or 18mm key spacing, I bumped the spacing on the Mark 13 up to 18.5mm to improve the typing experience with the commodity keycaps I have access to. The Mark 13 also improved the palm rest shape and played around a little bit with the butterfly shape to make it slightly prettier. The biggest change in the Mark 13 is inside. I'm still using the same solder and wire-wrap technique I've been using for most of the past year, but the Mark 13 is the first keyboard powered by an Arduino Micro rather than a Teensy.

The Teensy is a fantastic prototyping platform. And there are several very, very nice opensource keyboard drivers available for it. As I've been starting to look at my options for putting the keyboard into production, I've been trying to figure out what I want to use for a microcontroller. The Teensy is based on the Atmel ATMega32u4. It's a neat little single-chip solution that has enough pins to drive a keyboard and a few other peripherals and has native support for acting as a USB device. Unfortunately, the Teensy's bootloader is proprietary. That means that if I wanted to ship a "Teensy-compatible" keyboard, I'd need to either actually put a Teensy inside the keyboard or license the Teensy bootloader. Neither of those felt right.

The Arduino Micro has very similar capabilities to the Teensy. It's based on the same ATMega32u4 microcontroller. It has a comparable (thought slightly reduced) pin count. It costs about the same amount of money. The differences are in the development environment, the bootloader and in the license. As an Arduino, it's programmable directly in the vanilla Arduino IDE. It even includes native support for 'emulating' a USB keyboard and mouse. The bootloader is an AVR109 compatible Arduino bootloader. It's free to use and modify. The hardware design is also free to use and modify. So, while an Arduino Micro is around $25, putting all the parts of a Micro on our PCB will cost considerably less. And it'll be programmable with the Arduino IDE.

There was one teensy little problem. (Sorry, couldn't resist.) Nobody had, as far as I could tell, ever released a full keyboard driver for Arduino. But Arduino C was, I was told, really easy to pick up. I hadn't actually written any C in well over 15 years and the closest to embedded development I'd ever gotten was writing Java for Android. But hey, how hard could it be?

I wrote the first fully functioning version of KeyboardioFirmware in an hour and a half. While watching a movie. While tipsy. It turns out that Arduino really is easy to develop for. Since then, I've added support for keyboard-driven mouse emulation, multiple keymaps, rudimentary macros and dramatically improved reliability and memory efficiency.

The big issues I have with the Mark 13 are that it's heavy and that acrylic scratches and cracks easily. It also traps dust between layers and shows fingerprints and smudges like you wouldn't believe.

So, you ask, if the Mark 13 is basically the keyboard I want to ship, what's next?

Well, none of the techniques and technologies I've been using to prototype are going to work for a production run.

I've been talking to a few potential production partners in Taiwan and China, but folks are being slow to engage.

It's time to learn about D4M. (Design for Manufacturing)

The first and most obvious issue to solve is the circuit board. To date, every single keyboard I've built has been hand wired key by key and diode by diode. My friends who are electrical engineers recoil in horror when I tell them that. "But Jesse, it's so much easier to just design and fab a PCB," they say. Truth be told, circuit board design terrified me. I had absolutely no idea where to start.

Most of the Maker movement seems to have standardized on CadSoft EAGLE. It's relatively user friendly. And I mean relatively. It's awful, obtuse and incredibly dated. But compared to other CAD packages, it's astonishingly clean and intuitive. It's free to use if you're building open hardware and your board size is below a few inches square. A commercial license of EAGLE that lifts these restrictions is a few thousand dollars. That wasn't really going to work for me.

Over the past year, I've tried to design a keyboard PCB every few months. It was never really all that pressing and I'd invariably give up in frustration after banging my head against the CAD software for a while. I tried gEDA, KiCAD, circuits.io, and a host of other packages that don't spring readily to mind. After some encouragement at a conference in early november, I gave circuits.io another shot. It worked great, up to a point. By the time I'd built a grid of about 20 keys, their webui was so slow that Chrome would throw the "Kill the naughty page?" dialog after every operation. But I'd designed enough of a circuit that I thought I might understand what to do next.

I decided to give Upverter a shot next. It was slightly less polished and friendly than circuits.io, but it coped just fine with the schematic for the entire keyboard. I even managed to get a basic PCB laid out. The problem came in when I was trying to move and angle the keys. Each change took some manual calculation and a relatively large number of clicks. It just wasn't quite done enough for this project. That said, Upverter was actually pretty nice to use. And when I tried to use their 'live chat' feature to ask some how-to questions about the product late on a Friday night, one of the developers walked me through my issues and helped me find workarounds for features they didn't have yet. This was for a user with a free account. I've since upgraded to a paid account. If Upverter can handle what you're doing, it's a great choice for circuit design.

From there, I decided it was time to give KiCAD another shot. Previous attempts at KiCAD failed for a variety of reasons:

  • I had no idea what I was trying to do
  • I was trying to use KiCAD in a Linux VM on a Mac, without an external 3 button mouse
  • I had no idea what I was trying to do

This time things were different:

  • I had the vaguest idea of what I was trying to do
  • I was trying to use KiCAD in a Linux VM on a Mac, with an external 3 button mouse

Starting with the matrix I'd designed in Upverter and the component definitions from KiCAD-Keyboard-Tutorial, I managed to piece together a keyboard schematic and PCB design. KiCAD's rotation and placement UI isn't a whole lot better than Upverter's, but it's better enough that I managed to actually get a board designed. All in all, it took me about 4 days. Much of that was tweaking and learning. When I tried redesigning the board from scratch, I had it done in about 4 hours. Lest you think "Ok, he now has a production PCB design. Where's my damn keyboard?" I should admit that the PCBs I've designed to date have a slot for a commercially produced Arduino Micro. The production PCB will need to have an Arduino Micro (including a few surface-mounted components) cloned onto it. I either need to further level up in circuit design or enlist some professional help.

Once I had what I thought was a reasonable board design, I exported Gerber and Drill files and started shopping them around to PCB prototyping houses. Most of these companies gave me a "quick quote" after I gave them a little bit of metadata and uploaded my Gerbers and drill files. With the exception of Seeed Studio, everybody had a process that involved me interacting with a sales person before my boards got made. Quotes I got back were all over the map. I think the most expensive I got back was a cost of $270 for a single prototype board and 50 for each additional copy. Most were on the order of $100 for the first board and $25 for each additional board with prices falling off the more I ordered. Turnaround times quoted to me ranged from "We can FedEx overnight the boards to you tomorrow, if you're willing to give us your firstborn child" to "How about we think about making them in two weeks and then put them on a boat?"

Pretty much everybody had an intro/prototyping offer that would have been a lot cheaper. And pretty much everybody said I wasn't eligible for it because my boards were way, way too big.

Golden Phoenix were the most responsive vendor and their sales person actually flagged a technical issue with the Gerber files I'd submitted to them. They weren't the most cost effective vendor for the quantity of boards I was ordering. That honor went to Seeed Studio's "Propagate" offering.

Seeed Studio's minimum order is 5 boards. As I ran the numbers, it turned out that getting 10 boards would be only a few dollars more than getting 5. So, for $150 in product cost and $50 in FedEx shipping, I have 10 prototype boards that are currently "In Production" and should soon be "Shipped". I have no illusions about having my first board design actually work, but I'm hopeful.

Once we have our PCB sorted out and our design finalized, we intend to do the whole Kickstarter thing. If you want to know when we're ready to take your money, head on over to http://keyboard.io and sign up for our announcement list.

Better and better keyboards.

Shanghai, late 2013. Day One. (The Electronic Component Market)

The Bund, As seen from Pudong

This was my third trip to Shanghai. The first one was in 1993. The second was in 2010. Things had changed less between the two most recent trips than between the first two trips. That’s hardly surprising.

The first time I flew into Shanghai, My dad and I flew into Hongiao Airport, took a taxi to the decaying Peace Hotel on the Bund and crashed out for 12 hours. Across the river was the Oriental Pearl TV Tower …and not much else.

When we woke up, we started making our way through the legions of blue-grey-suited pedestrians and cyclists thronging Nanjing Road.

We found ourselves in front of a crowded little dumpling place on a side street. After observing for a bit, we figured out the system: hand over some cash and get issued plastic tokens. Push your way through the crowd to the kitchen counter and hand over your tokens in exchange for delicious looking fried dumplings. We were starving. So we pantomimed that we wanted six dumplings. (Counting on your fingers in Chinese is different than in English. You can get to 10 on one hand.) We got our six tokens. They were an impossibly cheap 20 cents or so. We pushed our way up to the counter and handed them over. The cook started shoveling little greasy fried balls of pork and deliciousness into a paper bag. He didn’t stop at 6. He didn’t stop at 7. He didn’t stop at 8. Eventually we figured out that we’d bought six orders of four dumplings. Despite our best efforts, we only got through about 20 of them before sharing our bounty with a homeless guy in a park.

I remember wandering through dusty, sleepy department stores on Nanjing Road. I found the electronics counter tucked away on the 2nd or 3rd floor. A small box caught my eye. It looked a little like the Gameboy I’d left at home. I was delighted to discover that it was an unlicensed implementation of Tetris that I could almost fit in my pocket.

From Shanghai, we set out across what felt like a very broad swath of Eastern China by hard-seat train. My only memory of Shanghai’s main train station is one of low ceilings, signs showing that explosives and fireworks were prohibited on trains and big X-Ray machines for EVERY piece of luggage. The security staff gestured that we didn’t need to scan our bags and just waved us through.

The second time I was in Shanghai was Christmas 2010. Kaia and I flew into the giant super-modern PuDong airport. From there, we paid a pittance to take the Maglev train into downtown PuDong – the mega-city that the Chinese government built by fiat in what had basically been rice paddies on my first trip to Shanghai.

We stayed at what was nominally a new-construction Sheraton in Pudong. They upgraded us to a two-room suite on a high floor with a glorious view of the bridges spanning the river and the Bund.

At one point, I went looking for ‘interesting’ electronics. The recommendation I got put me at what I can only describe as an electronics fake market. I was looking for an interesting Android tablet or something. When I asked about Android phones, I was handed an ‘Android iPhone! Dual-SIM!’ – It looked sort of like an iPhone. The OS it was running was a dumbphone OS upgraded with ripped icons from iOS and support for a resistive touchscreen. The only Android 2.x tablet I was shown…did not boot. Nor did any of the 4 others they took out of plastic wrap to try to demo. Eventually, the salesperson apologized and said she couldn’t show me a working one. In general, though, there was relatively wide availability of high-end tech. When we visited the Super Brand Mall, Best Buy had the relatively complete, if uninspiring selection of gear you’d expect to find at a Best Buy. An underground Apple Store (that wouldn’t look out of place in New York or San Francisco) was situated in the next mall over. Across the street from the two malls was the Oriental Pearl TV Tower. Underneath the tower was a sort of awesome but incredibly kitschy museum of the history of Shanghai.

Locals were fairly brand-conscious. Sure, I was offered a fake Rolex, but the tout offering it had stationed himself in front of the Rolex shop on Nanjing Road, a few blocks from American Apparel’s China flagship store.

The phrase I use to sum up my impressions of late 2010 Shanghai is ‘Starbucks across the street from another Starbucks.’

But this was supposed to be my 2013 Shanghai travelogue.

IMG_20131114_064205.jpg

The view from the airport lounge where I scrambled to install Chrubuntu on my Chromebook.

I’m going to skip over the gory details of my IT setup for this trip — that’s a subject for another post. The very short version is that I arrived with a Google-flavored HTC One with my regular T-Mobile SIM and an ARM Chromebook running Chrubuntu. On my phone, I had access to Twitter and Foursquare. Both devices were signed into a throwaway Google account.

I arrived, somewhat bedraggled, at PuDong airport. I turned on my phone and was greeted by an SMS telling me that international data roaming in China would be rate-limited to EDGE speeds but would be free. Yay T-Mobile!

The next thing my phone told me was that in the 14 hours I’d been offline on my way to china, updates for a dozen or so Google apps had been uploaded to the Play Store. It was almost certainly a coincidence.

I decided that given how tired I was, I could treat myself to a taxi. I spent a few minutes stumbling around the arrivals hall of the airport looking for an ATM. A liveried driver hanging out at an official looking ‘Ground Transfers’ desk tried to convince me that she’d offer me a much better rate to the hotel than the hotel’s airport transfer service. She quoted a number approximately 3x what a cab was supposed to cost. When I told her what a cab cost, she looked a little disappointed, said ‘taxis are downstairs’ and wandered off.

IMG_20131115_163654.jpg

Dear San Franciscans – the Shanghainese have developed artificial fog technology and may soon put @carlthefog out of business

Stepping out of the airport, I walked into a wall of air. At least it felt that way. It was insanely smoggy. I didn’t find out until later that it had been ‘keep the kids and grandparents inside, halt construction projects and ban fireworks’ smoggy. The cab ride was uneventful. I’d printed a copy of the Chinese-language driving directions from the airport to my hotel during my downtime at the airport in Chicago.

IMG_20131115_160557.jpg

Some of the drive from PuDong to Shanghai felt like driving through a megalopolis. Some of it felt like driving through a post-apocalyptic wasteland.

I spent the trip splitting my attention between marveling at the endless tracts of buildings across PuDong, Friday afternoon traffic and an email conversation with Thomas Yao,the leader of the Shanghai Linux Users’ Group. I was pretty shattered, but Thomas talked me into going out for dinner with him later in the evening.

The cab pulled up at the Sheraton Hongkou, which I’d picked because it had an astonishing promo rate and was located across the street from a subway station on the Shanghai side of the river. What I hadn’t realized at the time was that it was a brand new skyscraper in an area that was otherwise completely un-redeveloped.

The Sheraton was…well, it was a very, very nice Sheraton. From the bedroom-sized shower with a claw-foot tub and a view of downtown Shanghai to the heated marble floor by the sink and the french press for coffee and the $10 bottle of Evian, it was what you’d expect.

Heading out for dinner with Thomas, I asked the front desk if the RFID transit card I had in my wallet was a Shanghai subway pass. He told me he thought it was, but wasn’t sure. It didn’t work, so I bought a 40 cent subway ticket to Thomas’ office on the Pudong side of the river.

Coming out of the subway, there was a small flea-market, consisting of sweaters, nuts, roasted snacks and iPhone cases. So many iPhone cases.

I walked into the GitCafe office to find Thomas and one of his coworkers playing XBox soccer on a giant wallscreen. They finished up their game, we chatted a bit and Thomas and I headed off for dinner. I asked him about the RFID card the clerk thought might be a Shanghai subway card. Thomas pointed out the large text that said ‘北京’ (Beijing) before helping me buy an actual Shanghai subway pass.

PB180482.jpg

The old TV tower got a new lease on life as the host of the hourly laser show.

We had dinner at 代官山, one of Thomas’ favorite restaurants at Super Brand Mall. Very few parts of dinner were things I recognized, but everything was tasty. One of the oddest bits was the drinks, which were some sort of Coca-Cola and citrus concoction with tiny little citrus fruits served in glass bottles heavy enough to kill someone. As we were leaving the mall, the Oriental Pearl TV Tower lit up with a laser light show. Green laserbeams started hitting nearby buildings and giant laser-projected horses stampeded across the tower’s base.

PB180522.jpg

Some of the local cafe chains have made fascinating branding choices.

We made plans to meet up Wednesday evening at XinCheJian, the local hackerspace. From there, I headed home and passed out until morning.

PB150003.jpg

Consumerism!

Saturday, I set off to find the Beijing Street electronic components market Thomas had recommended to me. It was fairly near Nanjing Road, so I hopped on the subway and popped up in front of the Sony Store and a gigantic Forever 21. Across the street was the first block of the Nanjing Road pedestrian mall. As soon as I set foot on the pedestrian mall, the touts hit. “Hey Mister. You want a watch?” “No.” “You want a handbag?” “No.” “Massage?” “No.” “Lady massage? Very sexy girls.” “No.” And it didn’t let up. From there on in, if I was on Nanjing Road, a tout was trying to sell me a Rolex, a designer handbag or a happy-ending massage. Some of the touts were men. Some were women. All were reasonably young. Some were more aggressive about it than others. Some only got in a single question as I walked past. Others followed me for half a block. That’s the last I’ll mention of the touts.

PB150005.jpg

Just like home!

I walked down Nanjing Road for a couple blocks — past a mobbed Apple Store, a gourmet grocery store, Gucci and a bunch of other high-end western shops. Guided by Google Maps, I took a right toward Beijing Road. Things quickly became more chaotic. Sidewalks and traffic lights became more…advisory than anything else. The side street was lined with small local shops, restaurants and…sort of ramshackle holes where there should be more shops.

PB150012.jpg

Seconds before, this shop window had been shilling for DeWalt

As I hit Beijing Street, things changed again. Apparently that section of Beijing Street is known as ‘Hardware street.’ On the corner as I walked up was a sort of micromall of power tools, hand tools and gas generators. Some of the stuff there was from Chinese brands I’d never heard of like Dongcheng, but there was just as much stuff (and advertising) from DeWalt, Craftsman and Milwaukee.

PB150025.jpg

Plumbing supplies on Beijing Street

PB150045.jpg

Perhaps I could interest you in some industrial springs in a range of festive colors?

Walking down Beijing Street, there were whole stretches of shops that sold nothing but magnets or bearings, tubing, connectors or brushes. Across the street, I found the 7 story “Technology Jingcheng Electron Market”.

PB150092.jpg

Every kiosk also sold a range of diodes, capacitors, oscillators and so on, but they weren’t nearly as photogenic.

PB150063.jpg

See. Told you so.

I started by wandering in the front door. A few dozen kiosks filled almost all available floor space. The kiosks had demos of the various LEDs they had for sale. They also appeared to sell everything else. Under glass various kiosks had piles of different sorts of switches, diodes, ICs, power adaptors, LCDs and a variety of other parts.

PB150071.jpg

Some of the kiosks were filled with unstable stacks of partial reels of surface-mount components.

And kids. Kids everwhere. It was Saturday, so everyone just brought their babies, toddlers and 10 year-olds to hang out.

PB150058.jpg

Every kiosk had one display case on wheels that served as a door..of sorts.

Heading downstairs into the basement, I found more of the same, but also a little more work being done. A few shopkeepers had customers laptops open and were attacking their motherboards with soldering irons. Things in the basement were generally a bit better organized than on the first floor.

PB160158.jpg

If you need custom faceplates for your milking machines, this is the place to go.

The second floor was…probably about 50% bigger than the first floor and connected to the next building over. As I was doing the tour of shops that sold nothing but spools of surface-mount microcontrollers (and there were probably about 20 of them), women with small sheafs of paper listing the parts their clients needed would dart in an out of various shops placing or picking up orders.

PB160125.jpg

At some point, a guy on a powered self-balancing unicycle zoomed past me.

I wouldn’t realize it was odd until days later, but not a single person on any of the 5 occupied floors of the component market said a single word to me without me trying to start a conversation first. And I only did that twice.

PB160157.jpg

I seriously considered trying to bring one of these soldering station microscopes home in my suitcase.

I make keyboards. I hadn’t really thought about buying keyboard parts on this trip. Had I planned ahead, I could have gotten someone at the electronics market to design me a PCB for my next model. As I was walking around, I kept an eye on the keyswitches that were being offered for sale, on the off chance that someone had a good deal on the switches I use (or interesting alternatives). Somewhere on the third floor, I finally found someone selling Cherry keyswitches. The vendor didn’t speak any English (and, to a first approximation, I speak no Chinese.) Using Google Translate, I explained that I wanted to know how much 200 of those keyswitches would cost. One of the two folks behind the counter picks up the switch I wanted and ran off. About 10 minutes later, he turned up again and wrote down a price…which was easily twice what they should cost. I wrote down what I wanted to pay. He shook his head, made an X with his arms and turned away from me. As I walked away, he was taking cameraphone pictures of the keyswitch.

PB160134.jpg

Very, very few of the vendors had posted price lists like this one.

PB150102.jpg

There were three of these shops in a row

The higher floors of the central market held more and more ‘finished’ goods. The shops in the secondary building tended to sell only a single sort of thing. There were bubblewrap shops. There were X86 CPU shops. There were packaging shops. There were shops that only made faceplates. There were cabling shops. You get the idea.

I got all the way to the top of the market without finding another vendor selling keyswitches. There had to be one — the merchant with the high price really clearly hadn’t left the building when he’d run off to get me a price. But it was lunch time and I was a little burned out on electronic components.

PB160129.jpg

If I’d been planning ahead, I probably could have gotten some keyboard PCBs made while I waited.

As I was walking across the second or third floor to get to the escalator, I noticed a tiny, tiny little kiosk (maybe 3 feet square) that had some keycaps on their “what we sell” board. Looking closer, they had an awful photocopy of the data sheet for Cherry keyswitches taped to the front of their display case. Getting into a conversation with the seller, it turned out that she had a pretty reasonable selection of Cherry keyswitches and keycaps. Her pricing for keyswitches was among the best I’ve found anywhere, though I know she was still making a decent profit. Her pricing on keycaps was astonishingly good for what she was selling. So I can find it later, her email is 724371693@qq.com and her phone is 021-53083556. The website on her business card doesn’t exist. I walked out about $60 poorer, but 200 Cherry keyswitches and about 700 keycaps richer.

PB150084.jpg

Over the course of the morning, I became a big fan of the Beijing-lu Electronic components market.

It was time for lunch.

Shanghai, late 2013. Day One. (The Electronic Component Market)

Airplane Mode for Glass

I've built my first little piece of software for Google Glass.

I flew home from SF yesterday and realized that there was no way (short of installing a very crashy Settings.apk) to enable Airplane Mode on my Glass.

That seemed like a reasonable enough "small" starter project.

This is really, really only for folks who are already comfortable running third party apps on their Glass. If you don't know how to sideload apps with adb, please don't install this. 

You can grab the initial build at:

https://www.dropbox.com/s/rtbt7vc3bz67j3c/GlassAirplane-0.1.apk

Source lives at https://github.com/obra/GlassAirplane

Patches welcome!

Airplane Mode for Glass

Recon MOD Live – a hackable $300 Android wearable (sort of)

I got a MOD Live HUD from Recon Instruments today.
It is, indeed, running Gingerbread.

As it turns out, if you can get it to install an update.zip, it won't check the signatures. Which means it's pretty easy to root 🙂

Cracking it open, the display is a Kopin, though I don't yet know which model.

It's designed as a look-around display. The prism has a mirrored backing and is wrapped in black plastic. The mirror coating on the prism comes off quite easily with a bit of rubbing alcohol.

So yeah, rootable Android (2.3) wearable computer. $300.

More details as the story develops.

Recon MOD Live – a hackable $300 Android wearable (sort of)