Mis-adventures in OpenWRT (TL-WR741ND)

While waiting for a long 3D print job to finish, I got to installing OpenWRT on a TP-Link router I have here in the office… The long and short of it, I managed to brick the device. Even thought the TL-WR741ND is supported by OpenWRT, I managed to flash the wrong image on to it.

So what to do next.. It was cheap and I was going to scrap it and forget about it, but I couldn’t let it go!  I popped to cover and read about console access over on the OpenWRT site.

I dug out one of my USB FTDI cables and got soldering…

TP Link TL-WR741ND with cover off

TP Link TL-WR741ND with cover off

Simple enough to connect to a serial lines back to the FTDI break out board. TP4 is TX, TP5 is RX and ground is taken from the bare copper trace.

Tap points for UART

Tap points for UART

Got a serial terminal program up and running on my lab PC, set to 11520,n,8,1.  Turn on the power and bingo, console data coming thick and fast! Cool.. except the Linux image I had flashed didn’t want to boot.  Corrupt image file, the boot loader was stuck in a loop.

How to stop uBoot from cycling all the time and get access to the CLI?
Tried the ESC key a few time, no joy.. Reading around the web someone else suggested the ~ key.. still no luck.  I found a post about another TP-Link router and mention of the keystroke “tpl” to get to the uBoot CLI.  Typing really fast then the “Autobooting in 1 seconds” message came on the console, bingo the boot loop stopped and I had a CLI.

Serial uBoot debugNext, how to get a new image flashed? Well that is quite easy with uBoot.. One can flash an image from a TFTP server. So armed with the correct image and a running TFTP server, this is what I did on the console:

ar7240> setenv serverip <TFTP server IP>
ar7240> setenv ipaddr <Temp IP address on my network>
ar7240> tftpboot 0x80000000 orig.bin
ar7240> erase 0x9f020000 +0x3c0000
ar7240> cp.b 0x80000000 0x9f020000 0x3c0000
ar7240> bootm 0x9f020000

Reboot, and we’re good…

Carambola i2c IO board with relays – V1.1

I’ve been working on a new version of my Carambola IO board.  I’ve added an interrupt line from the MCP23017 back to the Carambola to allow for a trigger when an input changes (save on having to poll the MCP23017 to check for changes!).

One other small change was the addition of a decouple cap close to the pin headers for the Carambola module.  It helps to keep the +5V in order, on the first version there was a lot on noise on the 5V line. You can get the new schematic here: Carambola IO Board

I re-generated the artwork, broke out the light box and development kit and got to work “spinning” a new PCB.  I’m happy with my timings for exposure and development now and seem to have a repeatable process in place.

Carambola IO board - main components placed

Carambola IO board – main components placed

The double sided PCB above took about 2 hours from PC screen to etched PCB (not drilled!). Got a good clean PCB with well defined tracks.

Carambola IO board - close up of I2C extender

Carambola IO board – close up of I2C extender

Getting the new Carambola module configured was easy.  Once connected to the network I could simple copy my Lua MQTT code from my original board over SSH.

Carambola IO board - ready for testing

Carambola IO board – ready for testing

Now I have to write some more Lua code to handle the interrupt pin and post the changes on the inputs via MQTT!

pcDuino and I2C IO board

Thought I do a quick test with my pcDuino and see if I could get the I2C relay board connected and working on it.

The pcDuino is really easy to get up and running on.. Like the Carambola it can be handy to have a FTDI cable handy to get console access.  Once the serial cable is connected you can configure the network and generally get the board set up for connection to your network.  Sparkfun have a really handy tutorial with the pin-outs, etc.

Getting Ubuntu up and running is easy, and because the pcDuino has on board flash memory, there is no need for a SD card.. kinna cool.

Connecting the I2C IO board requires 3 wires from the pcDuino, no drama, simple!

pcDuino and I2C IO boardAfter I install the i2c tools, I was able to drive the relays and monitor the inputs no problem.

pcDuino and I2C IO board from end

pcDuino on it’s way….

Much excitement here at the moment, my new pcDuino is on it’s way from EXP-TECH in Germany (very cool site BTW!).

pcDuino product picture

pcDuino product picture

Here is a short description from the pcDuino site..

pcDuino is a mini PC platform that runs PC like OS such as Ubuntu and Android ICS. It outputs screen to HDMI. Moreover, it has hardware headers interface compatible with Arduino.

Looks like it might be what I hoped the APC SBC would have been!