Broadband-Hamnet™ Forum :: Hardware
Welcome Guest   [Register]  [Login]
 Subject :WRT54G-TM MMHC/SDHC Card Support.. 2012-07-21- 06:00:35 
Joined: 2024-04-24- 07:06:30
Posts: 0
Location

So after much researching and finally getting newer source code to compile for these devices, I have been able to add MMHC/SDHC support to the WRT54G-TM.

If anyone is interested, I have attached instructions on how to do it along with the source code I used and the MMHC/SDHC modules.

What I like most about it, is the fact that everything is internal.  After setting yours up, you can do whatever you would like with that extra space.  I turned mine into an FTP Server:  http://tech.dir.groups.yahoo.com/group/DAWG-HSMM/message/2397

73,
KF5JIM


P.S. This can also work on other routers.  You would just need to edit and compile the sourcecode for your GPIO pinout.

=================== Prepare the SDHC Card ==================
Format SDHC card using a computer to the ext2 file system.
We need something that does not have journaling.
Do not decide to format it using the HSMM-MESH node as it will
stall.
 
Optional:  Create a seperate partition and set it to swap.
 
 
=============== Prepare the WRT54G-TM Router ===============
With the HSMM-MESH node connected to the internet, install the
following packages:
    e2fsprogs
    fdisk
    kmod-fs-ext2
    libuuid        (If doing SWAP)
    swap-utils    (If doing SwAP)
 
 
Modify the router as per instructions paying close attention
on the pinouts:
 
    http://www.dd-wrt.com/wiki/index.php/Linksys_WRT54G-TM_SD/MMC_mod
 
Optional:  Build the attached source code
(Note:  I could not get it to compile on anything other than "whiterussian_0.9")
 
scp the sdhc.o (normal version) and sdhcd.o (debug version) modules
to the /etc/modules/2.4.34 directory:
 
    scp -P 2222 /sdhc.o root@localnode:/etc/modules/2.4.34
 
****  The module files attached are hard-coded to use   ****
****     these particular pinouts for the WRT54G-TM        ****
****          However, they can easily be changed            ****
 
 
ssh into the router and navigate to the /etc/modules.d directory and
add another file titled '80-broadcom-sdhc' with the only text inside
the file is one of the two uploaded files without the '.o'.  eg: sdhc
 
    ssh -p 2222 root@localnode
    
    vi /etc/modules.d/80-broadcom-sdhc
/*  [press the keyboard button]  */
    [i]
    sdhc (or) sdhcd
    [esc]
    [:][wq!][enter]
 
 
Go into the /etc/init.d/ directory and modify the 'boot' file  
(using vi again) to mount the partition(s) or swap space  
(changing the correct partition numbers) after the  
'load_modules /etc/modules.d/*' command:
 
    load_modules /etc/modules.d/*
    mkswap /dev/sdcard/part1
    swapon /dev/sdcard/part1
    mount /dev/sdcard/part2 /
}
 
===== Plugging the SDHC Card into the WRT54G-TM Router =====
Plug the SDHC Card into the router.
 
using the ssh console, reboot the router by typing 'reboot'
 
 
=================== Checking the Mod out ===================
ssh into the router and type:
df -h
cat /proc/meminfo
 
You should see your mounted SDHC card and (if you did it)  
much more swap than before.
 
 
Now you can use this extra space for whatever you would like.
I turned mine into an FTP server following these instructions:
    
    http://tech.dir.groups.yahoo.com/group/DAWG-HSMM/message/2397
 
 
This method by Paul is licensed under a Creative Commons  
Attribution 3.0 Unported License.



Attachments
 SDHC Instructions.zip [1 KB] :: SDHC Instructions
 WRT54GTM.png [58 KB] :: After Finishing the Mod
 broadcom-sdhc.zip [27 KB] :: Source Code
 broadcom-sdhc-modules.zip [25 KB] :: Modules
IP Logged
Last Edited On: 2014-05-10- 12:27:40 By KF5JIM for the Reason
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2012-08-17- 05:51:53 
KD4E
Member
Joined: 2012-07-29- 13:39:05
Posts: 55
Location: Nevils in SE-Georgia, USA
 

Will this do the HSMM-MESH without extra work?

Same as the WRT54GL?

Thanks!

David



[KF5JIM 2012-07-21- 06:00:35]:

So after much researching and finally getting newer source code to compile for these devices, I have been able to add MMHC/SDHC support to the WRT54G-TM.

If anyone is interested, I have attached instructions on how to do it along with the source code I used and the MMHC/SDHC modules.

What I like most about it, is the fact that everything is internal.  After setting yours up, you can do whatever you would like with that extra space.  I turned mine into an FTP Server:  http://tech.dir.groups.yahoo.com/group/DAWG-HSMM/message/2397

73,
KF5JIM

P.S. This can also work on other routers.  You would just need to edit and compile the sourcecode for your GPIO pinout.

=================== Prepare the SDHC Card ==================
Format SDHC card using a computer to the ext2 file system.
We need something that does not have journaling.
Do not decide to format it using the HSMM-MESH node as it will
stall.
 
Optional:  Create a seperate partition and set it to swap.
 
 
=============== Prepare the WRT54G-TM Router ===============
With the HSMM-MESH node connected to the internet, install the
following packages:
    e2fsprogs
    fdisk
    kmod-fs-ext2
    libuuid        (If doing SWAP)
    swap-utils    (If doing SwAP)
 
 
Modify the router as per instructions paying close attention
on the pinouts:
 
    http://www.dd-wrt.com/wiki/index.php/Linksys_WRT54G-TM_SD/MMC_mod
 
Optional:  Build the attached source code
(Note:  I could not get it to compile on anything other than "whiterussian_0.9")
 
scp the sdhc.o (normal version) and sdhcd.o (debug version) modules
to the /etc/modules/2.4.34 directory:
 
    scp -P 2222 /sdhc.o root@localnode:/etc/modules/2.4.34
 
****  The module files attached are hard-coded to use   ****
****     these particular pinouts for the WRT54G-TM        ****
****          However, they can easily be changed            ****
 
 
ssh into the router and navigate to the /etc/modules.d directory and
add another file titled '80-broadcom-sdhc' with the only text inside
the file is one of the two uploaded files without the '.o'.  eg: sdhc
 
    ssh -p 2222 root@localnode
    
    vi /etc/modules.d/80-broadcom-sdhc
/*  [press the keyboard button]  */
    [i]
    sdhc (or) sdhcd
    [esc]
    [:][wq!][enter]
 
 
Go into the /etc/init.d/ directory and modify the 'boot' file  
(using vi again) to mount the partition(s) or swap space  
(changing the correct partition numbers) after the  
'load_modules /etc/modules.d/*' command:
 
    load_modules /etc/modules.d/*
    mkswap /dev/sdcard/part1
    swapon /dev/sdcard/part1
    mount /dev/sdcard/part2 /
}
 
===== Plugging the SDHC Card into the WRT54G-TM Router =====
Plug the SDHC Card into the router.
 
using the ssh console, reboot the router by typing 'reboot'
 
 
=================== Checking the Mod out ===================
ssh into the router and type:
df -h
cat /proc/meminfo
 
You should see your mounted SDHC card and (if you did it)  
much more swap than before.
 
 
Now you can use this extra space for whatever you would like.
I turned mine into an FTP server following these instructions:
    
    http://tech.dir.groups.yahoo.com/group/DAWG-HSMM/message/2397
 
 
This method by Paul is licensed under a Creative Commons  
Attribution 3.0 Unported License.

IP Logged
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2012-08-18- 17:13:21 
Joined: 2024-04-24- 07:06:30
Posts: 0
Location

Yes it will! I have two of the WRT54G-TM's. However, you must follow each step in the 4th post in the link below in order to get HSMM-MESH to work on this router.

http://www.broadband-hamnet.org/hsmm-mesh-forums/view-postlist/forum-2-hardware/topic-180-wrt54gtm.html

IP Logged
Last Edited On: 2014-09-26- 03:06:20 By KF5JIM for the Reason
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-05-01- 08:10:24 
AE3D
Member
Joined: 2014-04-28- 06:34:41
Posts: 3
Location: Bowie, Maryland

I purchased a WRT54G-TM at a recent hamfest.  It had already been modified to hold an SD mDemory card, but had DD-WRT installed.  A 2GB SD card came with it, mounted in a socket which was attached to a small circuit board.  This board was attached to the motherboard by a ribbon cable.  

I located, and flashed the WT54G firmware, gave the unit its new password and node name.  It appears to work fine.

Next I removed the SD Card from the WRT54G-TM and attached it to my Laptop, opened up VMware, started Ubuntu Linux and used gparted utility to determine that the SD Card was already formatted in ext2.  At this point the 2GB SD Card has a Lost+Found folder on it, but nothing else.

According to your instructions I should now connect my Linksys WRT54G-TM to the Internet.  I assume to do this I would use the units WAN port and connect it to my home network switch.  If I am correct there is a setting in setup that will allow the Internet connection to act as a gateway for the MESH network, but assume changing this setting would not be required.  Is this correct?

Next in the process is connecting to the WRT54G-TM and making it receive files from the Internet?  I assume the ssh -p 2222 root@localnode will connect my Ubuntu system PC to the WRT54G-TM.  Is this correct?  I assume ssh works very much like telnet except that it is secure.  Am I correct there too?  As you can tell I don't use Linux near as much as I should.  I assume I should use ssh to order the WRT54G-TM to download the needed software.  But how does one then install them on the WRT54G-TM?  Do I use the get-apt install <software> commend?   

I next assume the sdhc.o and sdhcd.o modules get relocated to the Ubuntu machine's /etc/modules/2.4.34 directory rather than a directory on the WRT54G-TM?  Am I right?.    

Your instructions then say the modules are hard coded for a particular set of pinouts.  How do I check to make sure my card was installed using those correct pinouts?  I guess I can should look at the info you reference.  I hope I don't get too lost checking pinouts.  Also if the pinouts are easily changed, how do I actually do that if I must?

The scripting part of your instructions I think I can follow.  Not that I'm a big fan of vi, but I can always look up what each command does ahead of time.  I tend to prefer using a graphical text editor.  Gosh I really need to use Linux more often, don't I.

Then you say I must go to where I want the SD Card mounted.  After reading this about 4 times, I now assume you mean the SD Card gets mounted on my Ubuntu machine in order to receive files.  Is that correct?  I can easily find a location if that is the case.

I assume if I'm not making more swap space, I can skip the mkswap and swapon commands.  I still don't get exactly why I'd want extra swap space.  I also don't get why I would install the swap space and memory onto the SD Card while it is still mounted on my Ubuntu PC.  This one baffles me.     

I get the next part about rebooting.  So I then use ssh to log into the Linksys WRT54G-TM, ask it to tell me all about disk space, using df and cat proc/meminfo commands.  

I would also like your opinion on using a 4GB SD Card instead of the 2GB that came with it.  I would also like to know how much swap space you might recommend for the WRT54G-TM assuming I need more of it for use on the router.  

Oh and thanks for the reference to the instructions for using the space to create an FTP server.

I am sure your instructions were perfectly clear to those of us who are Linux experts.  Sorry to ask so many 'dumb' questions.  Hope you can help me.  Thanks in advance. 

Keith Miller, AE3D

 





 


IP Logged
Keith M. Miller
ae3d@graykitty.net
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-05-01- 09:05:26 
KF5JIM
Future Astronaut
Joined: 2013-07-17- 12:13:36
Posts: 250
Location: Nederland

At this point the 2GB SD Card has a Lost+Found folder on it, but nothing else.

That's common with linux-formatted disks.  No need to worry about it.

According to your instructions I should now connect my Linksys WRT54G-TM to the Internet.  I assume to do this I would use the units WAN port and connect it to my home network switch.  If I am correct there is a setting in setup that will allow the Internet connection to act as a gateway for the MESH network, but assume changing this setting would not be required.  Is this correct?

That is correct.  Ticking the Mesh Gateway box will allow other nodes access to the internet through your node.  If the WRT54G-TM router is plugged into the internet via the WAN port, no need to tick this box.

Next in the process is connecting to the WRT54G-TM and making it receive files from the Internet?  I assume the ssh -p 2222 root@localnode will connect my Ubuntu system PC to the WRT54G-TM.  Is this correct?

Yes.  However, you can also go to the Setup --> Administration page (http://localnode:8080/cgi-bin/admin) and install the modules via the Package Management section.

I assume ssh works very much like telnet except that it is secure.  Am I correct there too?

Yes.

But how does one then install them on the WRT54G-TM?  Do I use the get-apt install <software> commend?

If you want to do it through the command line, you'd use ipkg install <package name>.

I next assume the sdhc.o and sdhcd.o modules get relocated to the Ubuntu machine's /lib/modules/2.4.34 directory rather than a directory on the WRT54G-TM?  Am I right?.

Negative.  They are copied and pasted onto the WRT54G-TM's /lib/modules/2.4.34/ folder.  You can SCP the files to this directory.  Use this command from your linux machine while you are physically connected to the LAN port of the WRT54G-TM mesh node:  scp -P 2222 <path to file>/sdhc.o root@localnode:/lib/modules/2.4.34

Your instructions then say the modules are hard coded for a particular set of pinouts.  How do I check to make sure my card was installed using those correct pinouts?

Check the link, http://www.dd-wrt.com/wiki/index.php/Linksys_WRT54G-TM_SD/MMC_mod, and make sure that the wires match up to the correct pins.  If they don't, you'll either need to change the values in source code and the cross-compile the modules (which is beyond the scope of this reply), or un/resolder the wires to match the correct pinout found at the link above.

I hope I don't get too lost checking pinouts.  Also if the pinouts are easily changed, how do I actually do that if I must?

You should not have too much trouble checking the above link with what is found in the router.  It would be easier to just un/resolder wires, as needed.

Then you say I must go to where I want the SD Card mounted.  After reading this about 4 times, I now assume you mean the SD Card gets mounted on my Ubuntu machine in order to receive files.  Is that correct?

Negative.  The only thing that is done using your ubuntu machine is partitioning the SD card.  Everything else is done on the WRT54G-TM router itself.  You can find out where the SD card is mounted by typing dmesg.  Chances are, it will appear as /dev/sdcard/partX (where X are numbers coorsponding to the individual partitions you created at the very beginning of the instructions).

I assume if I'm not making more swap space, I can skip the mkswap and swapon commands.

Correct.

I still don't get exactly why I'd want extra swap space.

It'd give you more "RAM" to work with when more resources are needed.

I also don't get why I would install the swap space and memory onto the SD Card while it is still mounted on my Ubuntu PC.

Every step (except partitioning) is done on the mesh node itself.

So I then use ssh to log into the Linksys WRT54G-TM, ask it to tell me all about disk space, using df and cat proc/meminfo commands.

Correct, you use the df -h command and cat /proc/meminfo (for swap) to see the additional space.

I would also like your opinion on using a 4GB SD Card instead of the 2GB that came with it.  I would also like to know how much swap space you might recommend for the WRT54G-TM assuming I need more of it for use on the router.

Depends.  This module is quite old.  It's the only one I have found that works with the router.  At the time this particular module was written, 2GB SD Cards were the norm.  If you can get your 4GB card to be recognized, all the better!  Just keep in mind, that the module was designed to provide support to the non-SDHC cards.  As for how much swap space, I did 0.5GB, but that's a bit overkill.  You can choose any value you would like.  64MB would probably even be enough.

Oh and thanks for the reference to the instructions for using the space to create an FTP server.

Your welcome!  Just try not to transfer large files.  I have had it hang before.

I am sure your instructions were perfectly clear to those of us who are Linux experts.

Linux Experts...maybe...I created this during the summer of 2012.  I got into BBHN during the summer of 2012 and BBHN (believe it or not) taught me Linux.  This guide was written with less than one month experience using the operating system.  If I wrote it again, I'd change a couple things, but what I have done is pretty stable.  You can do it!


Let me know how it goes!

Paul, KF5JIM

IP Logged
Last Edited On: 2014-05-11- 02:37:10 By KF5JIM for the Reason
My opinions and views expressed here are solely my own.
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-05-02- 15:11:19 
AE3D
Member
Joined: 2014-04-28- 06:34:41
Posts: 3
Location: Bowie, Maryland
Well it took me a while to get through it all. Most of it went well. I reformatted the SD Card for 128mb of Linux swap in the first partition and the second partition was formatted as ext2. My Ubuntu machine listed them as sdb1 and sdb2 partitions. I removed the card from my Linux PC, then re-inserted it, and gparted found the two new partitions to be formatted in the manner I just described. I used the Package Management tool as you suggested to install files. I noted that the e2fsprogs automatically loaded libuuid. I guess it must have been a dependency thing. I loaded the others without issue, including swap-utils. I chose to use sdhc rather than sdhdc so I used 'sdhc' without the quotes as the only text in the 80-broadcom-sdhc file. I set my mounting point as /mnt/sd-card. When I got to the step where I added the commands to the end of my 'boot' file, I realized that here was no 'sdcard' file in my WRT54G-TM's /dev directory, which means I must have done something wrong. Right? Oh and I didn't understand the part where you instructed me to change the correct partition numbers, so I used part1 and part2 like you did, because partition 1 was indeed swap space, and partition two was RAM just as in your example. I rebooted and checked df -h and cat /proc/meminfo and sure enough the SD card was not mounted. Any ideas? Keith Miller, AE3D ARRL / AARC ae3d@graykitty.net ae3d@w3vpr.net ae3d@arrl.net 301-805-1854
IP Logged
Keith M. Miller
ae3d@graykitty.net
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-05-10- 12:23:18 
AE3D
Member
Joined: 2014-04-28- 06:34:41
Posts: 3
Location: Bowie, Maryland
After a bit of exploration I have determined the instructions in "SDHC Instructions txt.zip" contain an error. Those instructions instruct users to copy the 'sdhc.o' and 'sdhcd.o' files into the '/etc/modules/2.4.34' directory on the WRT54G-TM unit.... when they should have gone into the '/lib/modules/2.4.34'. Once I relocated my files to the correct directory everything worked. I should have figured this out earlier as I had to create the '/etc/modules" and '/etc/modules/2.4.34' directories in order to follow the incorrect instruction, though I was not instructed to create these directories. I hope someone will correct the 'SDHC Instructions txt.zip' file.
IP Logged
Keith M. Miller
ae3d@graykitty.net
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-05-10- 12:30:20 
KF5JIM
Future Astronaut
Joined: 2013-07-17- 12:13:36
Posts: 250
Location: Nederland

Thanks for catching that error! I probably wrote that in the wee hours of the morning one night in 2012. It has been fixed.

IP Logged
My opinions and views expressed here are solely my own.
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-09-26- 02:50:59 
W8PIE
Member
Joined: 2013-11-22- 05:40:36
Posts: 1
Location
http://hsmm-mesh.org/hsmm-mesh-forums/view-postlist/forum-2-hardware/topic-180-wrt54gtm.htm You may not be able to visit this page because of: an out-of-date bookmark/favourite a search engine that has an out-of-date listing for this site a mistyped address you have no access to this page The requested resource was not found. An error has occurred while processing your request. Please try one of the following pages: Home Page If difficulties persist, please contact the System Administrator of this site
IP Logged
 Subject :Re:WRT54G-TM MMHC/SDHC Card Support.. 2014-09-26- 03:04:22 
KF5JIM
Future Astronaut
Joined: 2013-07-17- 12:13:36
Posts: 250
Location: Nederland

Two years ago it was on hsmm-mesh.org. The site has changed to broadband-hamnet.org. Same link, different domain works.

http://www.broadband-hamnet.org/hsmm-mesh-forums/view-postlist/forum-2-hardware/topic-180-wrt54gtm.html

IP Logged
My opinions and views expressed here are solely my own.
Page # 


Powered by ccBoard


SPONSORED AD: