Well, finally back in Tokyo. I'm a bit late on this blog update because the two week excursion to the US put me seriously behind on a lot of things. One thing that I was suprised with is how busy things have gotten recently. With the part-time job, setting up the webshop, handling inventory, assembling boards, and the various side projects, I'm surprised that I haven't had a nervous breakdown.

Getting the hardware up is taking much longer than I expected. I actually ran into some issues with getting consistent results on the impedance matching between boards. I finally found the culprit which was careless assembly. There were small amounts of flux left on the board when I mounted the SMA connectors and the flux is very slightly conductive. It turned out that it had a random effect on my return loss values between the different boards. It was really frustrating and I was about to throw out all of my SMA connectors since I thought they were causing the problems. Anyways, after cleaning up the boards thoroughly, I began to see consistent results and my yield went up dramatically.

I've also been working on a side open source project which I should be announcing soon (if I can get it to work). I'm a little bit excited about it, but there's really not much commercial application. I think it's gonna be kinda fun, though. I started it when I was in the US because I ended up spending a lot of time at the coffee shops in Berkeley and wasn't used to having a lot of free time. Apologies for the secrecy, but you should be hearing more about it soon...

Other than that, got a lot of stuff done in the US. It was supposed to kind of be my vacation but it turns out that free time gives me more stress than being busy. I ended up talking to a wireless security researcher and am providing a little assistance on his upcoming wireless security book. Mostly just editing and fact checking, but from the material I've seen, it's going to be quite interesting. 

I also got the chance to meet up with the founder of Wireless Glue and his team, who specializes in Zigbee Smart Energy. He was showing me his new prototype device which is a Zigbee-based energy display that will show the real time energy consumption data from a smart meter along with the cost. He's a total geek and had the prototype enclosure made with a 3-D printer, that he sanded and finished himself. That got a lot of geek props from me. He was also filling me in on the latest news about Zigbee Smart Energy since he's one of the SE spec authors and also developed the Zigbee SE compliance test spec. You'll probably be hearing more about his company soon, and he should be releasing a really cool 802.15.4 module which uses a CC2520 (802.15.4 radio) + CC2591 (RF Tx/Rx amp). If you aren't familiar with the CC2591, its an 802.15.4 front end that can boost the signal to +22 dBm on the transmit side (~170 mW or about 60x the power output of the CC2520) and an improvement of about 3x on the receive sensitivity. It's also notoriously hard to work with which is probably why I haven't seen too many devices out there that have successfully tamed the chip.

And finally, I met up with a company thats interested in using my stack for an implementation that would go in actual smart meters. This could actually give me the motivation to work on the Zigbee Smart Energy profile since I've been really lagging on it for awhile. The whole Certicom license thing left a bad taste in my mouth since I heard that it's a hassle working with them and I don't approve of software patents, but since this company is fairly well known in the metering industry, it might help make things a bit easier. At the very least, they have a really great staff of experienced metering engineers plus tons of test equipment. Taking the stack through their QA should help make it much more robust and flush out the nasty bugs.

That's about it for my trip log. As I mentioned, I got the RF boards tuned and producing consistent return loss values. There are about eight of them up so far so I should be able to start setting up my own wireless sensor testing network soon. Oh, and here's a pic of one of my new antennas that I'll be testing. Its got 24dBi directional gain, aka 256x gain versus a standard 0 dBi omni-directional antenna. In other words, if I can get it working, it'll be a monster :)

Going on my second week in California and I'm already ready to go home. The weather in California is beautiful, and driving around in a convertible kicks some serious ass. But nothing can beat being surrounded by circuit boards, ICs, and my equipment.

I actually got a lot of stuff done on this trip like visiting my sister's family, seeing my parents, visiting the SF hackerspace, catching up with live Zigbee members, hanging out with old friends, ordering export controlled 2.4 GHz radios and MCUs, and of course, work. By far, the two most stressful events were work and seeing my parents. I'd have to say it was a tie.

The parents are still complaining about my lack of a job and wondering why I don't pursue a nice, stable corporate career. I tried to explain to them that such a thing doesn't exist anymore, but unfortunately, they didn't buy it. At least they've eased up on pressuring me for a grandchild.

I'm excited about the chips I ordered while I was here. When I first came, I tried to order a bunch of CC2520's since those radios are conspicuously missing from my parts inventory. The problem is that Digikey and Mouser don't ship them outside the US due to the onboard encryption engine which puts them in an export controlled category. That restriction only penalizes people with non-terrorist ambitions since any self-respecting terrorist wouldn't let that stop them from getting a chip. Hey, if they can get nuclear weapons...

Anyways, after about a week, Mouser suddenly got 400 of the CC2520s in stock so I immediately grabbed 200 of them. Just got the tracking number today so I should be receiving them before I leave. 

Another interesting chip I got was the ATXMega128 which is one of the newer AVRs. Yes, I'm an Atmel fan and no, I'm not sponsored by them. The interesting thing about the XMega is that it has an onboard AES security engine which should alleviate the vulnerability found by Travis Goodspeed when the keys are transported across the SPI bus. I'll probably be testing it out to see if it can be used for the Zigbee Security Manager. 

And finally, I found a cute little chip in the ATMega32U4 which seems to be quite new. It's got 32kB flash, 2kB RAM, and integrated USB. It has fairly perfect proportions of RAM/flash for a fun project chip, plus integrated USB which I can port my stack to. I grabbed a bunch of those as well and will be playing with them more in the near future. 

Anyways, until next time...*smooches*...

A strange phenomenon occurred where many people started posting very interesting software on Twitter. The attraction is that Twitter limits posts to 140 characters and so it's a challenge to see what type of functionality you can implement within that 140 character limit. I've been completely astounded by the quality, functionality, and creativity of these twitcodes and I've decided to archive them here. I hope you can enjoy them as well.

I just did a massive purge on the blog of 75% of the users. All deleted users were checked against the botscout database for matching spambot signatures (ip and email address). Nevertheless, if anyone has any problems with logging in, please send me an email through the site. Or you can also PM me.

I've been getting a lot of emails on the status of the Zigbee stack recently and its probably because it looks like nothing is going on. Actually, there is a lot of stuff going on but its pretty much behind the scenes and the details don't make it on to the blog. So I finally gave in and created a Twitter account, in case there's any curious souls that want to know the mundane trivialities that I'm doing battle with on a daily basis. Well, that and apparently, all the cool people in the WSN industry seem to be on Twitter.

Here's the Twitter link: 


Just saw an article mentioning that Peter Alfke from Xilinx is retiring . He's a legend in the FPGA community and was an FPGA guru on the Usenet group: comp.arch.fpga . I remember when I was just starting out designing with FPGAs back in another life, I was completely clueless about how to use the devices. His posts were my textbook and I gradually got the hang of taming the wild beasts. Back then, the FPGA compilers were complex and bug-ridden, the chips were completely cryptic, and it would take a whole day to compile a design on a Pentium 100 MHz PC. At least the PCs are faster now :)

Goodbye Peter, and if I ever get a chance to work on FPGAs again, I'm going to google your posts on the Usenet archives. Although I didn't know you personally, I felt like I did...

Along with working on the RF hardware for the Zigbee development platform, I've also been pretty busy with helping get the Tokyo Hackerspace up and running. This past Saturday, I co-taught a class on basic electronics for members of the hackerspace as well as the Tokyo 2.0 crowd.

The Tokyo 2.0 group is mostly a bunch of IT people in Tokyo that get together once a month to talk about all things tech/IT/internet. The meetings are semi-networking events where you can see a bunch of hipster geeks sipping beers in a night club turned conference hall with a DJ spinning carefully selected non-intrusive music. I figure they're trying to recreate the hip, tech vibe that you see at events in San Francisco or SXSW (South by Southwest). 

The last talk was about cloud computing and I actually went to check it out since I had no clue what cloud computing was. After the talks, I can definitely say that I still have no clue. It seems it means different things to different people, but in my opinion, it just sounds like a fancy name for cheap web hosting. 

Anyways, the class turned out pretty good and everyone was enthusiastic to learn about electronics. It wasn't easy teaching the basic principles of electronics within two and a half hours, but we managed to pull it off. These days, you pretty much just need to know a bare minimum of theory since the main goal is usually to get the signal of interest into a microcontroller. However we had to conceptually explain and show what resistors, capacitors, diodes, voltage, current, and transistors were. I think teaching basic electronics is much more difficult than teaching more advanced topics because you have to really have mastered the fundamentals to teach it well. It was certainly a challenge to explain things in a way that non-electrical engineers could visualize and understand conceptually.

Along with that, I also got the first batch of the Tokyo Hackerspace development boards back. We'll be selling these in order to raise funds to buy equipment like oscilloscopes, soldering stations, and furniture. It's also going to handily serve as a common platform for future workshops that we do for embedded programming and analog interfacing to digital circuits. 

When we were discussing the boards, I gave people the option to choose different solder mask and silkscreen colors and made it a majority vote decision. The winner was a red silkscreen with a white soldermask since that was supposed to be symbolic of the colors of the Japanese flag. However the red lettering over the white solder mask made the silkscreen come out pink. I was surprised at first, but it really grew on me. The color scheme is definitely different than any other boards I've seen out there, and it appeals to the girls in the group who wanted a girly board. FYI, a lot of the guys wanted a red mask with black silkscreen which was a bit overly testosterone-charged. It would've made the boards look like video cards.

Also, I threw down some cash and bought some cheap, surplus multimeters from Akihabara for the group. It's mostly symbolic, but it's to show that we're taking steps to equip the hackerspace.

Overall, things look like they're moving forward  quite well. The space/studio is already rented and we should be moving in there next month. We're also planning an art/tech exhibition inside and inviting different artists and IT people to collaborate on it. 

So basically, with this and Zigbee, looks like things are going to be getting pretty busy for a while.

Here's a couple of pics of the boards and other miscellanea...

Took a half day off yesterday to hit up Wireless Japan 2009. One of the things I noticed about the shows this year is that they're much smaller than the events that were held last year. I guess show exhibitors is a pretty decent gauge of the economic health of an industry.

One of the things that surprised me is that I actually knew people at this year's Zigbee Pavilion. I guess the Zigbee community is pretty small. A couple of people actually recognized my blog as well which surprised me. I've spent so much time isolated in Japan that I have no clue about the audience, other than the webstats. And I suspect that half of the webstats are actually computerized bots that just want to spam my site. 

One thing that disappointed me was that TI Japan was conspicuously absent. I was hoping to talk to them because I'm not getting any responses for inquiries on purchasing the radios from the Japan disti. I was hoping to add some CC2520s to my dev board radios since they currently seem to be heavily weighted towards Atmel.

Speaking of Atmel, I was talking to the Atmel product engineer and he mentioned that there are a lot of things coming out soon on the Zigbee front. He was pretty straightforward about them so  I don't think they're a big secret (the datasheet was visibly open on the laptop and he was carrying samples in his pocket). They should be an announcing a single die AVR + radio based on the AT86RF231 soon. This would be a major improvement because their previous multi-chip modules that combined the AVR and 802.15.4 radios didn't seem to get very popular within the 802.15.4 community. You know its bad when they don't even have dev boards with the chips on them. Their most popular dev kit, the Raven, has a discrete AVR MCU and radio. They should have some new dev boards out soon as well.

I was also complaining to him that Atmel was ruining the price of dev kits and modules for everyone by pricing the Raven USB sticks at $40. He just smiled and said that it wasn't the first time he heard that complaint. Apparently, the original price for the Raven USB sticks were $29 but they had so many complaints that they had to raise it to $40. Damn...if they had to buy their own chips, they'd be losing shitloads of money. Other than that, the Atmel guy is totally cool and I told him that if he had free time, we could go to dinner. I hung out with him last year too and the guy's a total trance head. He would stay out until 5am and hit up the trance and techno clubs. Heh heh...my kind of engineer...

Checked out the new Ember EM351 ARM Cortex chips too. I have a feeling that they'll be popular in the metering industry since the current EM250/260 series is currently bursting at the seams in terms of code space. It's probably due to all of the security and features that got added into the Zigbee Smart Energy profile, so the Cortex lineup should ease things on that front. 

And one of the things that kind of made me sad was seeing the ANT display at the front of the Nordic booth. ANT is a separate company from Nordic, but you can buy ANT chips which are Nordic nRF24xx chips with the ANT stack in the flash pre-programmed. The problem is that Nordic is making a heavy push towards Bluetooth Low Energy whose guns are aiming directly at the market that ANT made a niche out of. ANT has a good following in the personal health and fitness industry because the protocol is low power, small, and uses the nRF24 which is fairly cheap. However Bluetooth Low Energy is competing directly in this market, plus they have the backing of the cell phone giants and connectivity with Bluetooth enabled cell phones that sport dual mode chips. It's probably going to put the nails in the coffin of ANT if BLE is anywhere near as successful as they hope. It was also the first time that I heard an ANT rep bash a protocol other than Zigbee which was quite amusing.

And finally, here are the pictures. I threw in some eye candy just to see if it'd attract more visitors to the site. If so, then I might turn this into a combined Zigbee/trade show models site. Something similar to LowRider magazine and they're artistic use of females. Enjoy!

Yeah, it's been a nice little vacation from the Zigbee stack for me. You wouldn't believe how fatiguing it is to focus on one thing for a year and a half. The stack became part of my life, like I was growing a third arm (or a third leg...*ahem*). So intead, I've been focusing on building hardware development boards that I can use to set up Zigbee networks for real-life testing of the stack. Although it's going to take some time, in the end, I'm sure it will pay off. There's nothing like having access to a large supply of development boards that you can use as wireless sensor nodes. At least it beats having to purchase something like ten raven kits.

However that's another story. I've been spending a bit of time getting the Tokyo Hackerspace boards up. There was some initial hardware flaws that I found but after they were fixed, I got the board up fairly quickly. I was worried about porting my USB stack on to it since the AT90USB16 USB controller is different from the ones on the Raven board (AT90USB128). As an engineer, I was expecting all types of things to go wrong and was ready to pull out the USB protocol analyzer. Lo and behold, after the initial register configuration, the USB icon popped on to my screen and it came up as a COM port.  It was probably one of the first times for me that bringing up a board went so smoothly.

I can't really say that I was testing the boards out. It was more like playing. Working on the stack for so long prevented me from messing around with smaller circuits and trying out fun things since I was putting pressure on myself to get it running. However being part of Tokyo Hackerspace gives me an excuse to explore different components and try things that might not necessarily be WSN related. In essence, it gives me permission to play with electronics which is great.

I was worried that the AT90USB16 might not have enough juice to do a lot (500 bytes RAM, 16kB flash) but I figured I might as well try. So the first thing I did was throw up a command line on the THS board. I just re-used the same one I'm using on FreakZ so it went pretty fast. Once I got the command line going, it was time to play. I wrote a command to toggle the various LEDs on the board, but that got boring pretty quickly.

I wanted a way to demonstrate to the Hackerspace members how it could be used for rapid prototyping of small circuits. That's always a big obstacle because people talk a lot about different things they want to design, but the bottleneck is always in implementation. If it were easy to do a proof of concept implementation, I think it would ease up the design juices and let people get more daring with what they attempt. So I figured that GPS might be a bit impressive. I just happened to have a GPS module given to me from my friend in France. It's quite a nice one and goes for $60 on Sparkfun. The specs are very impressive: it can track 32 satellites at one time, can track position info even in deep canyons and dense foliage, and can update position info up to 5 times a second. Just what you'd expect from a geek gift and something I'm definitely going to use the next time I'm trekking through the dense jungles in Southeast Asia. 

Well, since it was just collecting dust in my parts bin, I pulled it out, soldered some headers onto it and prayed that it still worked. Let me just say: 3 wires, 8 lines of code, and no soldering. It was totally sweet! I was getting raw GPS position data and dumping it to the console. The breadboard peripheral was even better than I had hoped. 

After that experiment, I decided to play with the RGB LED. This is all in preparation of doing a demo to the Hackerspace folks with the board. I wanted to generate some excitement so that people can get motivated to think of interesting projects. I had previously talked to one of the members about designing LED based jewelry. He had mentioned that most of the LED accessories blink which is harsh and gaudy. He wanted something that would slowly pulse which is a more subtle effect for an illuminated accessory.

So I took some time to write some PWM code to control the brightness of the LEDs on the RGB LED. I basically had a 100 Hz update rate (10 msec period) for the PWM and divided that up into 255 intervals of ~40 usec. It's easier than it sounds. After that, I just had a simple counter that kept track of the phase and would turn off each of the LEDs if it matched the counter. Basically, it was just standard software PWM. I implemented some commands to manually control the brightness and also commands that could pulse the red, blue, or green LEDs with a specified pulsing interval. I think I'll probably re-use the same code for the AC light dimmer that I'm going to be using to test my Zigbee Cluster Library implementation. 

So anyways, here's some pics of what I did. I also presented it to the group last night. I can't remember the reaction very well though because I was kind of drunk. Pretty typical for a hackerspace meeting...

And in case you're curious, the final memory footprint including USB stack, command line, PWM, LED pulsing, and GPS was slightly under 8kB flash and about 280 bytes RAM. Looks like the tiny machine can pack a bit of a punch...

Today was kind of strange. The PCB files went out, the parts have been ordered, documentation's been written, license was changed, and the release was issued. I really had nothing to do today and it was a strange feeling. I started getting fidgety so I decided to investigate a problem with my USB device stack on Linux that someone reported. No problem found...worked on Ubuntu. Great. After such a long time pushing myself with all the stuff that needed to be done, having an involuntary free day like this was really eerie. I didn't know what to do with it.

Another strange thing was that Michael Jackson passed away. I was always a big fan of his, since my days as a pro dancer. If you're in the entertainment biz, you can't help but admire MJ, who was one of the few people that really knew how to put on a show. There's a reason why MJ, JJ (Janet Jackson), and Madonna are still the reigning icons in pop. My wife was devastated. She's a member of an online social fan club for MJ in Japan and I had to pretty much forcefully hold her back from buying a ticket to LA.


We had the second meeting of the Tokyo Hackerspace today and I got a chance to present the design idea I had with the development boards. The response was more positive than I expected. We also got a chance to discuss what everyone wanted to get out of the group. I know I've mentioned this before, but there is a huge amount of IT brainpower and experience within the members. A lot of the interest centered on interfacing electronics with web services and physical computing. I'm still trying to get a handle on what physical computing actually is, but I suspect that it's where you interface a PC to real objects like sensor gloves and clothing. Rob Faludi, if you're out there, could you please enlighten me on this subject? 

Anyways, one of the best things is that there is so much energy to learn and try new things. It's like the complete opposite of working with real engineers. I suspect that I'm going to learn more than they will when all's said and done.

In the meantime, one of the issues I think we're going to face is to distill all of the areas of interest into things that are do-able. I think the best way to describe this would be how to separate things into baby steps so that we can actually make progress on hardware hacking and cool projects. I was discussing this with one of the other electronics guys and we think that, on the electronics front, there needs to be some workshops on fundamental electronics and embedded programming. On the other side, I think that we also need to tap some of the computing brainpower for web services and how to access them, as well as the experiences of the artists, musicians, and chefs. Once we can start diffusing the knowledge and experience, I think there's no limit to the design possibilities.

One thing I'm pretty sure of is that Contiki and uIP are going to be really popular. I'm going to be bringing in the Raven wireless boards at the next meeting and showing them some basic Zigbee functionality as well as explaining 6LoWPAN (IPv6 over 802.15.4 for the uninitiated). I'm pretty sure that it's going to spark a lot of ideas. 

Stay tuned, because I think this group has the power to realize a lot of the things that the WSN industry is just talking about. At least...(*buzzword alert*)...the Internet of Things, as applied to real things...