Recently in Netgear DG834G Category

I've been asked about the v3 DG834G in the past (mine is a v2) and always answered that I don't know anything about it. Earlier this week Ben asked me about it and let me have a login to his. He also took pictures, which are on the OpenWRT DG834G page.

Some comments, based on this:

  • The ADAM2 bootloader is different. Looking at the output of strings on it I can't see the checksum message seen in the v2 version. I also can't see the FTP server strings I'd expect. However the default config appears to specify an IP of 169.254.87.1 so it might be worth nmaping that when the router is coming up and seeing if anything is open.
  • The wireless card is no longer on a mini PCI card. I assume it's still connected electrically the same way, but I guess this is cheaper for Netgear to manufacture.
  • The CPU is slightly different, a TNETD7200ZDW instead of a TNETD7301GDU. No idea if this makes any major difference.
  • The board appears to have JTAG and serial port headers easily accessible. And possibly even JTAG for the wifi.
I think it should be easy enough to get OpenWRT up and running on this (possibly someone has even done so already); someone just needs to hook up a serial console and do some prodding.

As I type this my internet connection is being once again powered by my DG834G. It's also very dark, but that's because I'm observing Earthhour (I don't think it'll change the world, but I don't mind sitting in the dark that much and there's only me in the house).

After my last OpenWRT/AR7 experiment I thought I'd bricked the Netgear. I ended up using my BT Home Hub as a stop gap solution and wondered how to proceed. I bought a Conexant Accessrunner USB modem and tried it with the WGT634U. This proved more stable than the USB Speedtouch, but still resulted in a couple of line drops a day at least. AR7 still seemed the way forward. I picked up a D-Link DSL-502T off eBay. This has a USB port, an ethernet port and no wireless. However it's AR7 based and has 4MB of flash and 16MB of RAM; the same as the Netgear. It also has a serial header already soldered on, so it was easy to connect my level shifter up and have a play. I built up a recent OpenWRT and managed to install it successfully and then hook it up to my ADSL. All seemed quite stable and I was feeling pretty happy.

In parallel with this I'd picked up a cheap D-Link G604T off eBay - this has a 4 port switch and wireless and is basically the same hardware as the Netgear. It was listed as faulty, but I was hoping to be able to use it for parts or at the very least for testing. As it turned out it worked perfectly; didn't need to reflash it or anything to get it going. I put the image I had working on the 502T on it and hooked it up. Again, everything seemed stable. I managed to get the wireless detected ok, but the driver doesn't seem to support AP mode that well - there are big warnings in dmesg when you enable it. It's an acx111 chipset and unfortunately there doesn't seem to be a lot of upstream activity - there's some work on a version using the in kernel 802.11 stack, but it doesn't currently compile with 2.6.24 AFAICT.

Anyway. I had working ADSL with OpenWRT, albeit without wireless (having the switch was useful though, as the router lives beside the media box but also needs to be connected to the switch upstairs in the study). I'd chased Enta a week ago about IPv6 but still not heard anything, so I gave them another prod. This time I got a speedy response indicated my account was now enabled for IPv6 and providing me with a /64. I added +ipv6 to /etc/ppp/options and restarted PPP and it all just started working. In addition I've configured up radvd on the box so everything on the ethernet autoconfigs.

Flush with the success of all this I thought I'd try my Netgear again and see if it was really dead or if I could get the original firmware back on it. For some reason that worked first time and the router booted fine. So I thought I'd try OpenWRT again, given that I had an image I knew worked fine on another AR7 router - if it didn't work on the Netgear I'd know there was some sort of hardware difference or problem rather than a build issue. And it worked. My DG834G is now running OpenWRT SVN r10685, doing IPv6 and generally everything I need except for wireless. I've updated my DG834G page a little bit, including a link to the OpenWRT config I'm using. Hopefully the wireless will get there; certainly most chipsets seem to be getting much improved upstream support these days and I'm sure it must be possible for the ACX guys to make use of the in kernel stack to reduce their work.

I tried again this weekend to OpenWRT my Netgear DG834G ADSL router with SVN r10500. Less joy this time; it boots the kernel and says something along the lines of "Please wait while OpenWRT does its thang", prints a message about loading the FPU emulator and sits there. However I'm pretty sure this isn't OpenWRT's fault; trying to flash the router back to the stock Netgear image is failing. ADAM2 does the erase ok, but once it gets to trying to do the flash it just sits there even when left for hours. I don't know if this is because the flash blocks are going or some other reason, but I think I can be fairly sure the hardware is on the blink. I'll try again to turn it back into a normal device, but somehow I don't rate my chances.

So, having broken my primary ADSL router I fell back to my WGT634U + Speedtouch USB combo. I'd found my other frog and hoped it might prove more stable, but no. Got a maximum of about half an hour of connect time. Which leads me to believe the original Speedtouch just isn't very good at either ADSL Max or a full 8Mb/s (yes, I live in the middle of nowhere but in general I get full ADSL Max connect speeds).

I gave up at this point (it was Sunday night) and on Monday decided to have a look for cheap routers on eBay. And then I remembered I had a BT Home Hub lying around. It's locked to BT by default, but I knew there were various discussions on putting Thompson Speedtouch 7G firmware on it that would open things up. It meant finding my Windows box and booting it (Wine wouldn't cut it unfortunately due to magic network voodoo or something) in order to do the upgrade, but I now at least have a stable 8Mb/s connection again. The Home Hub is running Linux but it's a Broadcom chipset with no source for the ADSL drivers that I'm aware of, so I don't hold a lot of hope for hacking it. However I have a D-Link DSL-502T on its way (for less than a tenner) so I haven't given up on AR7 yet.

Since I've moved to Castlerock I've started using my DG834G to provide my ADSL again, as it was quick to setup and easily found in all the boxes. Up until now I've just been using it with the normal Netgear firmware, but I'm getting to the point where enough of the rest of the house is sorted that I want to think about the network layout. Part of that is enabling IPv6 (I'm with an Entanet reseller these days, and Enta claim to do IPv6), part of it is not bridging the wireless and wired networks (I'd like to be able to trust the wired one a bit more) and part of it is just being able to run useful bits on the router itself.

Anyway. I had built up an OpenWRT SVN image last month and tonight I decided was the time to try it, having been putting it off for ages. Epic fail. Managed to get the backup of the Netgear image done fine, eventually got the new image on there, waited and waited and no joy. Wouldn't even ping on the LAN side. Further investigation showed that it would ping for a few seconds when first power cycled and then die. So I had to find my serial console level shifter so I could have a look. All signs point to it failing when loading the wireless or ADSL firmware blobs. Bah.

I spent a while trying to get the old firmware back on it; ADAM2 seems really unhappy if it receives unexpected traffic (like, say, DNS requests because my network thinks the router is the DNS server/gateway) while you're ftping an MTD image. I got there, but decided I'd try out my WGT634U setup again, which is what I used in Norwich. Found the frog, fired up the router, changed my old Black Cat details to the new Enta ones and crossed my fingers. At first all appeared well (well, except for no IPv6 PPP; must email Enta to see if they need to tweak settings at their end for my username), but after a while it became apparent that the ADSL connection was flakey; it was resyncing every couple of minutes. Bum. It might just be the frog; I do have another one somewhere, but I ended up just falling back to the DG834G with the stock Netgear firmware ie exactly where I started this evening. I've pulled latest OpenWRT SVN and I see a few kernel/VLYNQ patches regarding AR7, so I shall try another build and see what happens.

Epic fail. I shouldn't play with networking on a school night.

I spent too much time today reading MIPS disassembly of the ADAM2 bootload, as used on the Netgear DG834G. The problem is that the version used on the Netgear performs a checksum over most of the flash device on every boot. This makes the use of JFFS2, as done by OpenWRT, somewhat problematic. In an ideal world I'd try to compile up a newer, less restrictive version of ADAM2 but there's no JTAG on the Netgear that I've found and the thought of frying the bootloader and bricking the device wasn't appealing.

So what I've ended up doing is finding where the checksum is done and changing the branch instruction that aborts the boot to a nop. It's still scary, but it appears to do the job.

PLEASE NOTE THE BELOW COULD PERMANENTLY BREAK YOUR ROUTER

First, obtain your ADAM2 image. This is 128K and is mtd2 from the bootloader view. It should have an md5sum of 0530bfdf00ec155f4182afd70da028c1. If it doesn't, stop. The version I'm talking about is 0.18.01 as distributed by Netgear.

Assuming you have the right md5sum you want to go to offset 0x3944 where the 4 bytes should be 44 09 00 0C (representing a jal 0x90002510 during execution). Replace these 4 bytes with 0 (representing nop) and you should end up with a new image with an md5sum of d8a2f4623bf6f64b7427812f0e849aa7. You'll then need to do something like dd if=adam2-fix.bin of=/dev/mtdblock/2 on the device (I don't believe you'll be able to rewrite the bootloader from the bootloader for some reason...).

After that ADAM2 will still checksum the flash, but will continue to boot it after printing a checksum error message. This means you can go off and build yourself an OpenWRT AR7 based image and install it on your Netgear. Rock.

Rar. I've finally got the Netgear happier. I grabbed an OpenWRT 2.4.30 kernel and hacked that into my OpenEmbedded image. That stopped the init panic messages. I've also done some work on faking up a /etc based on the values from nvram - this should hopefully mean I have persistent data over reboots as well as meaning you can upgrade from a stock Netgear DG834G image and keep your settings. I think I'm going to have to write a very basic bit of C to crypt the password though, as there doesn't seem to be any existing tiny utility in OE that'll do so.

Anyway. This post is done from my desktop sshed to the Netgear which is connected to the ADSL and doing IPv6, and I'm then sshed from there to the via IPv6 (I could have setup the routing so I just sshed directly from my desktop through the Netgear, but this was quicker). Yay! That proves the ethernet, ADSL and IPv6 works. Haven't tried the wireless yet.

I think I'm at the stage where I need to pull the OpenWRT kernel into the OE framework so I can build it all easily, and then I'll commit it and be able to provide an image in case anyone else is actually interested in this warbling. :)

I finally found some time to devote to hacking on the DG834G. Given that it seems the bootloader checksums almost the entire flash on each boot a writeable flash file system doesn't seem to be an easy option. This rules out vanilla OpenWRT unfortunately, which is a shame given the AR7Port. However as I'm familiar with OpenEmbedded (which seems to be non working at present, but is behind OpenZaurus which I run on my C3000) I decided to have a look at getting that going. So now I have an image that boots, creates a ramfs for /, pivotroots the flash round to /media/realroot, creates a bunch of symlinks and should give me a basic filesystem to play with.

Except it's not very happy, producing INIT: PANIC: segmentation violation! sleeping for 30 seconds. messages. Booting to just /bin/sh works fine, but various things won't run. I'm currently blaming this on the fact I haven't changed the default Netgear kernel from 2.4.17, so the next course of action is probably to use an OpenWRT based kernel and see how that goes.

I have a rather weird network setup at home. Partly due to having both a sensible ADSL connection from Black Cat and an NTL cable modem as backup, partly because I have native IPv6 (over the ADSL). I used to just use a normal PC with a USB Speedtouch plugged into it, but a while back I managed to get an ASUS WL-500g setup to do the job (it has USB for a flash drive / webcam, but this got the Speedtouch plugged into it). It does the job, but is somewhat hacked up. Plus I think the USB ADSL modem adds extra latency and can sometimes be dodgy.

So, when I discovered that the Netgear DG834G had source available for all the important bits (wireless, ADSL, ethernet) I was intrigued. I already know a bunch of people who have this router and are happy with it, so the knowledge that it was more hackable than the average ADSL router made it very appealing. As it happened quinophex (who seems to becoming my hardware pimp) had a spare one, so we did a deal and he brought it round today.

After checking it actually worked and could connect to my ADSL line it was time to open it. The screws are hidden underneath the little white feet and appear to be torx style, but I had a normal flathead that did the job (I should really get myself a larger set of screwdrivers). At first I couldn't spot any headers, but then I saw JP603 half hidden under a sticker with the MAC address on it. Ta da. 4 holes, one obviously ground, one looked non connected, 2 had tracks leading away from them.

I found a piece of veroboard in my toolbox and realised I'd put off building my MAX232 level shifter for too long. After much too long (but no burnt hair) I'd soldered up the simple circuit and was ready to try it out with my Linksys WMA11B. Using Andrew Wild's excellent serial port instructions I had an adapted device to test with. Hooked it all up and it didn't work. Bah, think I. My soldering sucks. No, serial ports suck. ttyS0 has decided not to play nice on my desktop machine. One USB serial port adaptor later and I can see the Linksys boot. Yay!

So, onto the Netgear. A bit of prodding (and dodgy soldering) later and I have a console. Yay! I can see ADAM2 and I can see the kernel boot and get a busybox login. Rock. Now I just need to work on getting a better firmware installed that can handle what my Asus is doing at present.