Achievement unlocked – OpenWRT device porting – and a quick and dirty level conversion

Apr 26 2013 Published by under howto, tech

Porting a Linux Router

So I just posted what I hope this time are properly formatted patches to the OpenWRT developers mailing list, a set of patches that add support to OpenWRT for the D-link DIR-632-A1 router.

You can see some of my progression on the OpenWRT forum.

This was quite a bit of a journey, as I had a few false starts and along the way crossed a number of different areas in the Linux kernel. The best thing was debugging bit-banging of device registers, which reminds me of hacking on my Commodore 64 many years ago. I have of course had occasion to do such at times professionally, but I have rediscovered my desire to do more low level hacking, and having recently received a Raspberry Pi as a gift and finding use for my leostick from the 2012 linux conf I expect to have plenty of opportunity when I manage to find some more spare time.

Along the way I extended significantly my knowledge of how to work with OpenWRT and build customised images, etc. I added a build guide for this router to the wiki pending acceptance of patches into the main stream; I think this cuts through the useful but verbose documentation elsewhere in the wiki.

When you need a USB-TTL RS232…

and you live 45m from Jaycar, and its 9pm Friday night anyway and you certainly don’t want to wit 3days for Internet delivery from your friendly Aussie electronics suppliers (hello Core electronics!) or a month for some Chinese no-brand on ebay… and you want to hack now!

A crucial part of hacking a router is access to the serial port.  These are always at logic level, and in the case of the DIR-632 at 3v3 not 5V, further complicating things.  However all I had handy was a USB-RS232 dongle running at proper RS-232 levels, of +/- 12V – so connecting this would be sure to let the smoke out of something…

Now it turns out I have a shedful of what most people would term junk.  But usefully this included a tube of MAX232 chips I acquired some years ago.  So first, find a handful of resistors and capacitors, and a birdnest later, one logic level to RS232 converter:

nest

There is a leostick there, but it is being used to provide 5V :-) Originally I attempted to use it as a serial relay, but apparently there is a bug in the firmware in the model I have that causes problems with the d0/d1 serial port and thus all I could ever see was junk… (thanks to MarkJ for letting me know)

The circuit is basically as described here (1), but I used 2x 2u2 capactitors in parallel, not having enough 1uF (* I really get into going the whole bush-mechanic-electronics thing!)

However, this doesnt fix the whole problem – the MAX232 is powered by 5V, although I also later found out it may have worked at 3v3 anyway.

I suspect many of the younger maker crowd might not be aware of some trick that can be employed when necessary: you can of course buy a 2cm sized 3v3 to 5v level converter form Jaycar, or from China on ebay, but again I didnt want to wait, and I had a pile of BC547 transistors handy and basic knoweldge of how logic circuits are actually built.

Thus, two transistors and a few resistors later, a logic level converter:

              -+-----------------+- 5V
               |                 |
               |                 Z
               |                 Z
               |                 Z
               |                 Z        __
               |                 |     __|  |__
               Z                 |
               Z                 +--------->
     __        Z   __    __      |
  __|  |__     Z     |__|      | /
               |               |/
               +----/\/\/\-----|
               |               |\
             | /               | \
     4k7     |/                  V
---/\/\/\----|                   |
             |\                  |
             | \                 |
               v                 |
               |                 |
               +-----------------+
               |
               |
             --+--
              ---
               -

(ASCII art FTW!)

Going he other way, I just ran three signal 1N4148 diodes in series, this dropped the line to about 3v5 which managed to not blow anything up with!

 

And several rather late nights^H^H^H early mornings later:

Links:

(1) http://www.scienceprog.com/alternatives-of-max232-in-low-budget-projects

No responses yet

Yellowstone YSE300 7″ 4GB EReader (aka AudioSonic ASEET001K)

Apr 01 2013 Published by under tech

(This is a late night blog entry ‘get it down before it gets forgotten’, mainly in case it is of use to someone, so please excuse the untidyness!)

I had noticed these for some time at JB HiFi for $59 but ignored them, being not touch screen and
not wanting to waste the money for what seemed to be an underwhelming device I didnt need.
However I was browsing the other day and they were 20% off that, so in a ‘what the hell’ moment
I purchased one to experiment with.

First Impressions

The feature list on paper seems reasonable, for some definition of reasonable. At least, compared to what the average Joe would be paying at least $100 for to a walk out the shop with an android device or a Kobo, etc.

The device is TFT LCD 800×480 resolution in 15:9 widescreen with headphone socket, micro USB for charging / connectivity, and is not touch screen, but button driven.

It runs a custom firmware, with MP3 player, video player, calendar, calculator, voice recorder,
and e-reader.  I have only tested the e-reader using PDF, and the photo viewer and MP# player.
The device is recommended to work with the Adobe e-reader Windows software and support DRM’d
ebooks but I didnt test with that.  It has a TF (mini-sdcard) slot.

In Use

In practice when reading a PDF I found it to be significantly sluggish at
rendering the pages.  The rendering quality of the fonts found me struggling to read late
at night as well.  The test book I used was the free download edition
of “Hacking the X/Box” (http://boingboing.net/2013/03/11/hacking-the-xbox-free-in-hono.html) by Bunnie Huang,  who was a keynote speaker at LCA2013.
He released for free as a tribute to Aaron Swartz, and I found it quite the suitable choice to
read whilst attempting to work out if this device was itself hackable in any way.

Pages with pictures could take several seconds to render, which is something I havent
noticed when using the no-brand $65 Android tablet I purchased from ebay for my kids to use.

On the upside, it competently does photo-frame, and the MP3 playback with a choice of equalisers.
It also supports voice record, video play, FM radio calculator and calendar, I didnt bother trying these.
So the list of upsides is quite short.

The UI however is average, and the physical interface downright woeful.  There is a lot of lag responding to button presses.  The poor quality is most noticeable with MP3, all the buttons seemed to just seek tracks and I couldn’t work out how to control the volume!  According to the manual, ‘up’ and ‘down’ (as one might expect)
should control the volume, but it is difficult to do just this without pressing the central
(ok)  button at the same time unless you are very careful.
And the usual response to the wrong button is to restart the current song…

The player played music without headphones but at a very low volume.

Can it be hacked?

The intent of my experiment was to try an alternative firmware, such as found at sites like rockbox.org.

Inside, there are three chips, an RK2738 SOC (ARM), and a FLASH and a RAM.  However, it seems the RK2738 is a somewhat underwhelming device from a hackability perspective: initial google searching returned a dearth of information.

The Yellowstone / Audiosonic has no firmware tool on an website relatad to either JB or Kmart or either search term.
I did find a RK27 SDK I could download, and multitude  of firmware loaders.  But none worked!
In theory the device can be switched into a service mode mode where system partitions become accessible, this would allow the ROM to be dumped, etc.
But none of the suggested  methods worked.
First method – write a zero length ‘tag’ file in the root directory, and reboot.  I tried a variety of
combinations seen on various forums for similar devices, to no avail. (Example: http://forums.rockbox.org/index.php?topic=34081.0 )
Second method – try the firmware tools of various other devices based on the RK2738, but the tools that actually detected the device as a RockChip require it to be in the system mode.

Going by the SDK and some forum posts, it should be possible to switch to system mode by sending
a specially crafted SCSI command (being a mass storage device, SCSI protocol is used over USB.)
But this approach also failed.

Further research on the RK2738 hinted as to whether rockbox (or even some Linux) might work, but
I can’t experiment until I can get it into system mode. It seems the RK2808 or upwards is needed for Android, so I might be left with RockBox:  http://www.rockbox.org/wiki/Rockchip27xxPort

The only thing I have left to try, as ‘reboot’ has some ambiguity, is to disconnect the battery and
do a true cold reboot, to see if any of the tag files might have an effect.
Failing this, you can short pins on the ROM.  Life however leaves me no time to waste on the above, so this has now turned into yet another rainy day project.

Of note, the device looks identical to the Audiosonic Ereader marketed by Kmart. (http://www.e3style.com/general/eReaders/Audiosonic/ASEET001K-UM_V4_24Aug2012.pdf)

Otherwise, it will have to do duty as a e-reader (until I get sick of the rendering)
media player ( for which I already have my phone for mp3) and higher resolution photo viewer.

A starting point to a lot of information about similar RK devices can be found at http://dtbnguyen.blogspot.com.au/2012/07/if-only-reading-were-easier.html

No responses yet

SD to IDE converter problems

Mar 10 2012 Published by under tech

I recently bought an SD to IDE bracket converter off ebay. It only cost me $11 from one of those cheap Chinese stores with feedback in the 10s of thousands so if it didn’t work I hadn’t lost much money at least. It looks very much like this.
I have had good success using Compact Flash as a bootable SSD for my old 386 and 486 boxen so given the wider availability of cheap SD cards (on the shelf at the local supermarket for $7) I decided to try an SDcard version – currently I have an old Pentium4 I am rebuilding for use as a hardware test machine in the shed. Having a card running FreeDOS and a Linux distro with a shared FAT partition is handy for transferring between different PCs and even to my main computer when network is unavailable.
After much mucking around it seemed I had a DOA (incidentally in spite of what you might expect I have had very few DOA in >20 cheap Ebay purchases) as whenever I had it connected to the IDE bus with a card inserted no devices were detected; tested and failed with two different 8GB SDHC cards. I wasn’t hopeful as the soldering on the board was terrible, and reworking surface mount solder without proper equipment is painful (having done so with good results on a dodgy ebay purchase before)
In the end for some reason I tried it with a 1GB card from my spare camera and the motherboard detected the reader as an IDE device. Further testing confirmed this gadget seems to not cope with 8GB SD cards.

I already had another one of these gadgets but without the PC case bracket, that works with 8GB cards, so this one must have some firmware variation that limits it to 4GB.

I messaged the seller querying about possible firmware upgrade but I don’t hold much hope for that.

So in summary, if you buy one of these, be prepared for some issues with various SD cards.

No responses yet