OpenWRT and Scripting Languages, Part 1

The RGB wall light project is currently on hold due to a massive lack of time. Still, I’m taking little steps of preparation for the second phase of the project, the software intended to control the RGB matrix. I could use the gcc cross compiler for the job, but using a scripting language to develop directly on the device promises to be far more comfortable. I’d like to narrow this down to languages readily available as packages for OpenWRT which leaves me with Erlang, Lua, Ruby, Perl, and Python. Since I feel like trying something new I’m going to rule out Perl for now.

Make Room

The installation of the bleeding edge OpenWRT version called “Attitude Adjustment” on the TL-MR3220 leaves about 1MB of space for additional packages to be installed – which isn’t even close to being enough for this purpose. So, the first step is to extend that space and the currently recommended way to do this is to move the overlay mount to an external USB device: Read the rest of this entry »

, , ,

1 Comment

Fixing Broken PSU of Asus WL-500gP Router

I’ve been using the Asus WL-500g Premium under OpenWRT for years. I always keep a second cold-spare device in stock to minimize our household’s downtime in case the router breaks. Last year, it was actually the router’s power supply unit that ceased to function. After I replaced it with the PSU from the spare device everything was back to normal. The same thing happened again this week, so I decided to document how I fixed the wall-wart back then.

Note: This is potentially dangerous so don’t try this at home! You’ve been warned.

Actually, the hardest part was to open the PSU. Both parts of the case are glued together, so separating them will inevitably scar the case. After the case was open, the worn out capacitor that broke the unit was clearly visible. I just de-soldered the capacitor, replaced it with a new one, and closed the case using two strips of adhesive tape. Done.

, ,

1 Comment

Wifi Enabled RGB Matrix Wall Light, Part 1

Inspired by the so called Lampduino and several other related projects I decided to build my own version of a RGB matrix wall light some time ago. During the last few weeks I finally managed to start out on this project.


The matrix of 64 individual cells and the LED back-plane are made from 4mm thin plywood that I spray-painted with a silvery varnish. The outer frame is made from a stronger 14mm birch multiplex board, yielding a very solid construction. I also bought some thin, white PVC board intended as the material for the front cover, but I still have to figure out how to cut that nicely.

Lacking the ambition to create my own LED driver board I settled for the “Rainbowduino”, an Arduino compatible board developed and sold by Seeed Studio. In addition to that, I wanted the matrix to be controlled and programmed over the air. One of the cheapest, easiest, and most versatile ways to accomplish this was to modify an OpenWRT based router for this purpose.

Read the rest of this entry »

, ,

1 Comment

Serial Communication Between an Arduino and the TL-MR3220 Router

Last time, I installed OpenWRT on the TL-MR3220 router and added a connector for it’s serial interface. Today, I wanted to try and connect this interface to an Arduino to make the two communicate. The router’s interface operates at 3.3V while the Arduino’s UART operates at 5V, so we need to convert between those levels. The cheapest way to do this that I could find is described here. It involves using a 74LS04 hex inverter chip to convert the 3.3V signal up to 5V and two resistors for a simple voltage divider to convert the 5V signal down to 3.3V.

Read the rest of this entry »

, , ,


OpenWRT and the Serial Console of the TL-MR3220 Router

The TP-LINK router TL-MR3220 is a very cheap (around €22 in Germany) yet feature-rich wireless 802.11n router that supports the open source OpenWRT firmware. It offers a USB port, allowing a bunch of additional peripheral hardware to be connected. Installing the matching OpenWRT nightly build was easy enough, the original firmware offers to do so using the standard web interface.

I was thinking about connecting one of them to an Arduino in a project to come. The integrated serial interface seems to be the obvious way to achieve this. The router’s board readily exposes the interface, so I added a 4-pin header to do a few tests. The pin-out of the interface is documented in the OpenWRT wiki. Using a standard FTDI adapter I then got access to the router’s serial console. From here it should not be to hard to use the same interface to connect to an Arduino instead.



Seeeduino Stalker: Writing to the SD Card

After I managed to upload the first sketches to the Seeeduino Stalker last week, I was eager to try the special features offered by this special kind of Arduino platform. I decided to try writing to an SD card first and followed the example included in the Stalker’s documentation. Which turned out to not work at all.

A couple of hours later and looking for errors in all the wrong places, I finally managed to find out how to use the FileLogger library:

  1. The SD card needs to be FAT16 formatted.
  2. The file that the the Arduino is writing to must exist, the library does not create files.
  3. The file must not be empty, it must contain at least one byte of data.

If these conditions are met, the following tiny sketch will work just fine and append data to the file:

#include "FileLogger.h"

void setup(void)
 byte buffer[] = "Hello World!";
 FileLogger::append("data.txt", buffer, 12);

void loop(void) {}

Update 10/8/12: Please note that this example will work with version 1.0 of the Stalker, only. For newer versions of the board you should try sadfatlib.

, ,


Connecting to the Seeeduino Stalker

A few weeks ago, Seeed Studio were celebrating their anniversary with a bunch of limited offers. Among other things, I acquired a pair of Seeeduino Stalkers v1.0 with an Atmega 168. Unfortunately, the serial interface on those boards is not labeled. So it took me a while to figure out how to connect the FTDI breakout board. With a small adapter board, programming the Stalkers with the Arduino IDE now works like a charm. (Select board type “Duemilanove w/ 168”.)



Unboxing the DSO Nano

On Friday, I received a late Christmas present to myself: after about 4 weeks of travel, my DSO Nano finally arrived! A long time, but that’s alright, it didn’t take much longer than I had expected. Also, the current weather conditions are not really fit to speed up delivery times.

The oscilloscope and the few other parts I had ordered were well packaged and thus arrived in excellent condition. Seeed even replaced the spare probes I had ordered with the adapter I would have liked instead, just as they promised. Unfortunately, my time is somewhat limited right now, so I can’t get to thoroughly trying out my new toy right away. All I managed yesterday, was to install the battery and to turn on the DSO. So far, everything seems to be working fine.

Oh, I really like the white box that the DSO is packaged in. Very professional!

No Comments

Fixed Weave Sync Again

After I upgraded my Weave server to API version 1.0, syncing my bookmarks between browsers no longer worked alright. At first, I didn’t really notice because Weave Sync still seemed to work but just not — well, just not always. Fuzzy symptoms that kept me from investigating for some time.

Then, almost by accident, I noticed Jason Frisvold’s post on the mozilla-labs-weave group. He describes exactly the same problems I was having and points to the solution: when I upgraded the user API database table I missed the necessary changes to the WBO table. Most notably, the column containing the modification time of an object has been changed from

`modified` decimal(12,2) DEFAULT NULL


`modified` bigint(20) DEFAULT NULL

This resulted in all my bookmark records having a modification time of 9999999999.99 which explains why the syncing would no longer work as expected.

, ,

No Comments

Waiting for my DSO Nano

I always wanted my own oscilloscope. Not that I really needed one or missed it more than a couple of times. But you can never have enough tools! What kept me from ordering one or from buying a used one online so far, was not so much the price. It’s the fact that the space I have to keep my tools is somewhat limited. A regular oscilloscope would be yet another big box standing in my way and gathering dust most of the time.

dso-nano-productThen, a few month ago, a post on hack-a-day pointed me to Justblair’s review on the DSO Nano. Justblair got his hands on one of the “beta test” models of the DSO Nano, a brand-new pocket-sized digital oscilloscope developed by Seeed Studio. While it has a few limitations and draw-backs, it’s size and the price tag of only $89 do make it a really interesting option. When I checked back two weeks ago, I noticed that Seeed Studio was accepting pre-orders for the final version of the DSO Nano to be shipped on December 10th. So I had to order one.

The probes that come with the DSO Nano are supposed to be rather basic, which is alright at that price. Seeed Studio offers a BNC adapter, allowing standard probes to be connected to the DSO Nano. Unfortunately, the adapter was sold out the day that I placed my order. When it was back in stock a couple of days later, I sent an email, politely asking if they could replace the spare probes that I had ordered with one of those adapters. They are both the same price. My email was answered quickly, and Xiang Fan promised to update my order. Great customer service!

By now, the DSO Nano seems to be ready, and the shipping seems to be in progress. I can’t wait to try it out. But it probably won’t make it all the way to Germany before the beginning of next year. Well, you always need something to look forward to.


1 Comment