Adding USB support into firmware

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Author Message
extasy
DD-WRT User


Joined: 30 Oct 2007
Posts: 52

PostPosted: Sun Mar 09, 2008 23:00    Post subject: Reply with quote
shinji257 wrote:
Actually the support I wanted is in the main releases now so there is no more real need for mine. On the other hand it wouldn't be too difficult to make a new modified build against the last one which would include serial support but I would cut out the ext3 and xfs modules.

I still think it's an idea for your release, one with more state of the art support for usb, having the newest printer module support for more usb devices etc, mounting scripts etc. The standard release will focus on so much more then USB. I would prefere a mega version of the usb support release due to the simple fact I own a ASUS 500 Premium like you and it has 8MiB memory. Why were you planing on removing the ext3? ext3 module should have support for ext2 as well.

shinji257 wrote:

OTOH I am planning on making a new nokaid usb build once I get another Asus router so if you are willing to wait I will be trying to integrate the serial support into subversion. The kernel code is there. It just isn't enabled and integrated. Trust me it is on my todo list. The following items are planned for purchase...
1x ASUS WL-500g Premium router
2x PPA 3321 USB to Serial converters


I wouldn't mind if you made a mega nokaid build and removed the sputnik hotspots etc. And maybe even integrated secure ftp server etc instead.

And ones again I want to thank you for your proect, without it usb would not have been included into the dd-wrt project for a long time.
Sponsor
shinji257
DD-WRT User


Joined: 02 May 2007
Posts: 222

PostPosted: Mon Mar 10, 2008 0:19    Post subject: Reply with quote
extasy wrote:
shinji257 wrote:
Actually the support I wanted is in the main releases now so there is no more real need for mine. On the other hand it wouldn't be too difficult to make a new modified build against the last one which would include serial support but I would cut out the ext3 and xfs modules.

I still think it's an idea for your release, one with more state of the art support for usb, having the newest printer module support for more usb devices etc, mounting scripts etc. The standard release will focus on so much more then USB. I would prefere a mega version of the usb support release due to the simple fact I own a ASUS 500 Premium like you and it has 8MiB memory. Why were you planing on removing the ext3? ext3 module should have support for ext2 as well.


Actually the reverse is true. You only need the ext2 module loaded unless you need the journaling support. The ext3 module does not support the ext2 filesystem however ext3 partitions can be mounted as ext2.

extasy wrote:
shinji257 wrote:

OTOH I am planning on making a new nokaid usb build once I get another Asus router so if you are willing to wait I will be trying to integrate the serial support into subversion. The kernel code is there. It just isn't enabled and integrated. Trust me it is on my todo list. The following items are planned for purchase...
1x ASUS WL-500g Premium router
2x PPA 3321 USB to Serial converters


I wouldn't mind if you made a mega nokaid build and removed the sputnik hotspots etc. And maybe even integrated secure ftp server etc instead.

And ones again I want to thank you for your proect, without it usb would not have been included into the dd-wrt project for a long time.


Unfortunately I was not able to build the mega versions and unless I recompile the code it isn't possible to remove segments of the gui due to the way it works.
Bimbo
DD-WRT Novice


Joined: 07 May 2007
Posts: 15

PostPosted: Mon Mar 10, 2008 23:15    Post subject: Reply with quote
shinji257 wrote:
Actually the support I wanted is in the main releases now so there is no more real need for mine. On the other hand it wouldn't be too difficult to make a new modified build against the last one which would include serial support but I would cut out the ext3 and xfs modules.

OTOH I am planning on making a new nokaid usb build once I get another Asus router so if you are willing to wait I will be trying to integrate the serial support into subversion. The kernel code is there. It just isn't enabled and integrated. Trust me it is on my todo list. The following items are planned for purchase...

1x ASUS WL-500g Premium router
2x PPA 3321 USB to Serial converters


I'd like serial support, can i add manually? where i can get serial mod and ftdi serial mod drivers?
I also need stty command. is it possible to have stty binary? Is it possible to integrate in the next release?
extasy
DD-WRT User


Joined: 30 Oct 2007
Posts: 52

PostPosted: Tue Mar 11, 2008 20:39    Post subject: Reply with quote
I now installed the newest "mega" worked really good! mounted the usb stick with "mount /dev/discs/disc0/part1 /tmp/usb" and it was no problem at all, now is my question where is rc.local. I wan't to be able to have this usb stick to be mounted every time I reboot the device and also be able to call other scripts. so I can have my serial support loaded Smile.
bkmo
DD-WRT User


Joined: 18 Oct 2007
Posts: 385
Location: Grecia, Costa Rica

PostPosted: Tue Mar 11, 2008 21:04    Post subject: Reply with quote
extasy wrote:
I wan't to be able to have this usb stick to be mounted every time I reboot the device and also be able to call other scripts. so I can have my serial support loaded Smile.


I put a usb.startup script in jffs/etc/config/
Anything named .startup and placed in this directory will be run automatically at boot time. You will need to enable and clean jffs every time you flash a new firmware, then create the directory and copy the script.
Bird333
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 809

PostPosted: Tue Mar 11, 2008 21:28    Post subject: Reply with quote
See the 'optware' page in the wiki to manually add Samba.
extasy
DD-WRT User


Joined: 30 Oct 2007
Posts: 52

PostPosted: Tue Mar 11, 2008 21:42    Post subject: Reply with quote
bkmo wrote:
I put a usb.startup script in jffs/etc/config/
Anything named .startup and placed in this directory will be run automatically at boot time. You will need to enable and clean jffs every time you flash a new firmware, then create the directory and copy the script.


thnks for the tip!

I was not able to find jffs/etc/config.

In my /jffs/ directory I only have 2 folders tmp and usr

In tmp folder only one folder called ipkg. in usr a lib folder.
Bimbo
DD-WRT Novice


Joined: 07 May 2007
Posts: 15

PostPosted: Tue Mar 11, 2008 22:56    Post subject: Reply with quote
extasy wrote:
I now installed the newest "mega" worked really good! mounted the usb stick with "mount /dev/discs/disc0/part1 /tmp/usb" and it was no problem at all, now is my question where is rc.local. I wan't to be able to have this usb stick to be mounted every time I reboot the device and also be able to call other scripts. so I can have my serial support loaded Smile.


How have you added the serial support?
do you have the binary files? also for stty?
Thank you!
extasy
DD-WRT User


Joined: 30 Oct 2007
Posts: 52

PostPosted: Tue Mar 11, 2008 23:17    Post subject: Reply with quote
Quote:
How have you added the serial support?
do you have the binary files? also for stty?
Thank you!


I have added the files I was talking about, you got mail with the pack. Unfortunately it does not show up in dmesg. should look something like this.
kernel: usbserial.c: USB Serial support registered for FTDI SIO
kernel: usbserial.c: USB Serial support registered for FTDI 8U232AM Compatible
kernel: usbserial.c: USB Serial support registered for FTDI FT232BM Compatible
kernel: usbserial.c: FTDI FT232BM Compatible converter detected
kernel: usbserial.c: FTDI FT232BM Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
kernel: usbserial.c: USB Serial support registered for FTDI FT2232C Compatible
kernel: usbserial.c: USB Serial support registered for FTDI FT232R Compatible
kernel: usbserial.c: USB Serial support registered for USB-UIRT Infrared Tranceiver
kernel: usbserial.c: USB Serial support registered for Home-Electronics TIRA-1 IR Transceiver
kernel: ftdi_sio.c: v1.3.5r1:USB FTDI Serial Converters Driver

All I get is:
Serial driver version 5.05c (2001-07-0Cool with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
Bimbo
DD-WRT Novice


Joined: 07 May 2007
Posts: 15

PostPosted: Tue Mar 11, 2008 23:32    Post subject: Reply with quote
extasy wrote:
Quote:
How have you added the serial support?
do you have the binary files? also for stty?
Thank you!


I have added the files I was talking about, you got mail with the pack. Unfortunately it does not show up in dmesg. should look something like this.
kernel: usbserial.c: USB Serial support registered for FTDI SIO
kernel: usbserial.c: USB Serial support registered for FTDI 8U232AM Compatible
kernel: usbserial.c: USB Serial support registered for FTDI FT232BM Compatible
kernel: usbserial.c: FTDI FT232BM Compatible converter detected
kernel: usbserial.c: FTDI FT232BM Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
kernel: usbserial.c: USB Serial support registered for FTDI FT2232C Compatible
kernel: usbserial.c: USB Serial support registered for FTDI FT232R Compatible
kernel: usbserial.c: USB Serial support registered for USB-UIRT Infrared Tranceiver
kernel: usbserial.c: USB Serial support registered for Home-Electronics TIRA-1 IR Transceiver
kernel: ftdi_sio.c: v1.3.5r1:USB FTDI Serial Converters Driver

All I get is:
Serial driver version 5.05c (2001-07-0Cool with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A


Are you using insmod command to install the mod files?
Have you test with lsmod command?
Do you have also le stty command binary to change the serial speed?

did you sent me by mail the binary files?
Thank you very much!
extasy
DD-WRT User


Joined: 30 Oct 2007
Posts: 52

PostPosted: Tue Mar 11, 2008 23:48    Post subject: Reply with quote
root@Asus:/tmp/harddisk/serial/bin# insmod usbserial.o
root@Asus:/tmp/harddisk/serial/bin# insmod ftdi_sio.o
root@Asus:/tmp/harddisk/newcs_asus/bin# lsmod
Module Size Used by
ip_nat_pptp 2284 0 (unused)
ip_conntrack_pptp 2812 1
ip_nat_proto_gre 1552 0 (unused)
ip_conntrack_proto_gre 2440 0 [ip_nat_pptp ip_conntrack_pptp]
jffs2 153624 1
ext3 72724 0 (unused)
jbd 54328 0 [ext3]
ext2 41400 1
usb-storage 34072 1
sd_mod 12500 2
scsi_mod 95720 2 [usb-storage sd_mod]
ehci-hcd 20460 0 (unused)
usb-ohci 19060 0 (unused)
usb-uhci 27180 0 (unused)
usbcore 76344 0 [usb-storage ehci-hcd usb-ohci usb-uhci]
switch-robo 5036 0 (unused)
switch-core 5984 0 [switch-robo]
bkmo
DD-WRT User


Joined: 18 Oct 2007
Posts: 385
Location: Grecia, Costa Rica

PostPosted: Wed Mar 12, 2008 2:58    Post subject: Reply with quote
extasy wrote:
bkmo wrote:
I put a usb.startup script in jffs/etc/config/
Anything named .startup and placed in this directory will be run automatically at boot time. You will need to enable and clean jffs every time you flash a new firmware, then create the directory and copy the script.


thnks for the tip!

I was not able to find jffs/etc/config.

In my /jffs/ directory I only have 2 folders tmp and usr

In tmp folder only one folder called ipkg. in usr a lib folder.

Read my quote. You need to create the directory, and also a script.
extasy
DD-WRT User


Joined: 30 Oct 2007
Posts: 52

PostPosted: Wed Mar 12, 2008 22:18    Post subject: Reply with quote
bkmo wrote:
Read my quote. You need to create the directory, and also a script.

Sorry! it was late Wink thanks for the help now finaly works ;)

Eko, would you be so kind and make modules that work for DD-WRT of these two sources? usbserial and ftdi_sio.
shinji257
DD-WRT User


Joined: 02 May 2007
Posts: 222

PostPosted: Thu Mar 20, 2008 16:17    Post subject: Reply with quote
@extasy: Letting you know that it is done. See my signature. Note that the support is still incomplete as the nodes that they attach to still do not exist but you can check to make sure that your adapter will be seen (you will get messages via dmesg about detection of the device now). I did end up having to use the kernel drivers from 2.4.28 though as it doesn't see to build quite right on mips for any of the newer ones. 2.4.29 was the first version that they changed the driver code completely making it use code from tty_io. Prior to that the driver recreated alot of the code itself and did not rely on outside dependencies from it. It works quite well with the 2.4.35 usb drivers.

@All: I am working on finalizing the usb startup script that I had done at the beginning that is responsible for automounting hard drives. Right now the following has been implemented.

Checks for nvram setting usb_automount to see if the user has enabled this. If it is then proceed to enter constant loop. Otherwise just exit out. The script will not re-check until the router is rebooted. -- Done. Added to webgui.

Change mount point from just /tmp to /tmp/usb. A folder will be created at the root called /usb during build time and will point to /tmp/usb. You should be able to use either one to reference to the folder. I will be working on adding a part to mount the first partition found on the first device (/dev/discs/disc0/part1) to /opt by default. If and when I get UUID detection working in busybox then maybe I'll have it controllable via nvram and then it won't matter about location anymore.

The automount script now mounts usbfs. In fact it does it right away even before checking for usb_automount but it is checking for usb_enable anyways. This should be moved to sysinit later but it will be done now in the usb daemon script. -- Done in script now implemented into usb startup

Mount points will now use the noatime and nodiratime options (no access time update). This will improve performance by not updating that timestamp anymore. I noted that it was done in alot of guides involving ext2 and ext3 partitions and the option is also accepted for vfat as well.

The p910nd printer daemon may be added to the build process.

The usb serial support is getting close to completion. In order to finish I will need to either add mdev or mknod. -- Done. Found /dev/usb/tts was missing so I have it created if usb serial support is enabled. All USB serial devices will appear in that location automatically.

EDIT: Scratch mdev support. It needs sysfs support in the kernel and that wasn't added until the 2.6.

Expect all of these to be fully implemented over the next 2 to 3 of weeks. Hopefully...

P.S. - UUID is the serial number given to a unique partition. It is changed upon formatting the partition.


Last edited by shinji257 on Thu Mar 20, 2008 23:08; edited 1 time in total
bkmo
DD-WRT User


Joined: 18 Oct 2007
Posts: 385
Location: Grecia, Costa Rica

PostPosted: Thu Mar 20, 2008 18:45    Post subject: Reply with quote
Shinji257,
You are making great strides at finally providing USB support "without pain" in the DD-Wrt firmware. I am not yet in need of serial support, and have no adapters to test with, but I agree that is something that should be added. I have a couple of additions to ask you for. I would definitely like to be able to enable the p910nd daemon via the gui. Possibly being able to select bidirectional or not from the gui also. The second request would be to check for programs in /opt/etc/init.d and have them run from the automount script.
Code:

#start optware programs
if [ -d /opt/etc/init.d ]; then
for i in /opt/etc/init.d/S*; do
  $i start 2>&1
done
fi

And lastly add support for a swapfile located on the root of the opt partition (first partition). This would need busybox to support swapon.

Code:

#mount swap file if it exists
if [ -e /opt/.swapfile ]; then /opt/sbin/swapon /opt/.swapfile
  fi


These additions should work for anyone running optware programs. I feel there is no harm adding this code, if you have no optware or swapfile they will just not be utilized.

Thanks for listening,
Bkmo
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next Display posts from previous:    Page 8 of 10
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum