PDA

View Full Version : Command Line on setting up Linksys usb adapter from sbininit



chip.ling
08-19-2009, 06:16 PM
I got my linksys usb adapter working in knx 5.3.1 finally. I'm not sure how to edit the make file to specify the 2.6.24.4 linux kernel when installing it though.

I also have to manualy load the driver rt2870sta.ko using : insmod rt2870sta.ko

/etc/rc.local doesnt load it on start up. I dont know if the script is enabled.

at the bottom of rc.local it says:
In order to enable or disable this script just change the execution
# bits.
Thats fine and dandy but I dont know how to change the execution bits

I have to pull it up with ifconfig ra0 up and then configure it with Knoppix on board network wizard. I cant seem to get it going with command line, the pump command always fails for some reason. I want to be able to do it with the command line.

I moved your post here just to avoid too much topics on one thread. Let's be fair to those user who wants to keep track on their own problems.

OK, for your problem. Here is a summary of what you have done so far.

1. You found yourself a compiled wifi device driver rt2870sta.ko from somewhere.
2. Manually, you have successfully activated your wifi device.

Now you want to automate it during boot time. And you are trying it by adding entries on the rc.local to make it works.

Can you do the following:

Perform the following 2 commands from the konsole and post your result back.



$ ls -l /etc/rc.local
$ cat /etc/rc.local


In case you don't know where the konsole is, it is the black TV liked icon on the bottom status bar on the x-window.

Rgds,
Chip

sbininit
08-21-2009, 12:58 AM
Yes, here is the first command results-

knoppix@Knoppix:~$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 358 Aug 18 23:08 /etc/rc.local
knoppix@Knoppix:~$


and the 2nd-

knoppix@Knoppix:~$ cat /etc/rc.local
#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo insmod /lib/modules/2.6.24.4/wireless/rt2870sta.ko
exit 0
knoppix@Knoppix:~$



I did get it to load the module at boot up by canging the name of the /bin/sh -e to /bin/sh
That did not solve completely the problem. the light comes on my usb wireless adapter but I cant see the device with iwconfig or ifconfig until I unplug it, replug it and then bring it up with ifconfig ra0 up.

chip.ling
08-21-2009, 07:10 AM
knoppix@Knoppix:~$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 358 Aug 18 23:08 /etc/rc.local


For your first question, the 3 x show above mean you already have the execute bits on. This script should run at boot time.



knoppix@Knoppix:~$ cat /etc/rc.local
#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo insmod /lib/modules/2.6.24.4/wireless/rt2870sta.ko
exit 0
knoppix@Knoppix:~$


So you added one line before the 'exit 0' line. I don't think it requires sudo, but it should run OK.

I believe at this point, after the boot up of the system, the rt2870sta.ko will be loaded into the system.

Please confirm it by enter the following command:



$ sudo ls -l /lib/modules/2.6.24..4/wireless


You should be able to see the rt2870sta.ko is there.



I did get it to load the module at boot up by canging the name of the /bin/sh -e to /bin/sh


Don't know what you mean here. Can you give more detail information like what you have done?



That did not solve completely the problem. the light comes on my usb wireless adapter but I cant see the device with iwconfig or ifconfig until I unplug it, replug it and then bring it up with ifconfig ra0 up.


Can you do the iwconfig and ifconfig between each step you take and post the result here.

1. after the reboot
2. after the unplug of the USB device
3. after the plug in of the USB device
4. after you execute the ifconfig ra0 up command

Rgds,
Chip
[/code]

sbininit
08-21-2009, 11:38 AM
the results of sudo ls -l /lib/modules/2.6.24..4/wireles or as follows-


root@Knoppix:/home/knoppix# sudo ls -l /lib/modules/2.6.24.4/wireless
total 591
-rw-r--r-- 1 root root 600508 Aug 15 23:20 rt2870sta.ko



I'll get back with you on the iwconfig and ifconfig results. It takes me about twenty minutes to get back on line after rebooting.

sbininit
08-21-2009, 11:57 PM
Here are the results of iwconfig and ifconfig after reboot, unplugged, replugged and ifconfig ra0 up-



1.after reboot with WUSB600N plugged in-

knoppix@Knoppix:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 B) TX bytes:100 (100.0 B)


knoppix@Knoppix:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.



2. unplugged-

knoppix@Knoppix:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 B) TX bytes:100 (100.0 B)


knoppix@Knoppix:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.



3. replugged-
knoppix@Knoppix:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 B) TX bytes:100 (100.0 B)

knoppix@Knoppix:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

ra0 RT2870 Wireless ESSID:"" Nickname:""
Mode:Auto Frequency=2.412 GHz
Link Quality=10/100 Signal level:0 dBm Noise level:-143 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0



4. ifconfig ra0 up-


root@Knoppix:/home/knoppix# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 B) TX bytes:100 (100.0 B)

ra0 Link encap:Ethernet HWaddr 00:1e:e5:e7:aa:38
inet6 addr: fe80::21e:e5ff:fee7:aa38/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:69 errors:0 dropped:0 overruns:0 frame:0
TX packets:221 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5947 (5.8 KiB) TX bytes:19112 (18.6 KiB)



root@Knoppix:/home/knoppix# iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

ra0 RT2870 Wireless ESSID:"myrouterxxxxx" Nickname:"RT2870STA"
Mode:Auto Frequency=2.462 GHz Access Point: Not-Associated
Bit Rate:1 Mb/s
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=10/100 Signal level:0 dBm Noise level:-87 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

chip.ling
08-22-2009, 01:45 AM
root@Knoppix:/home/knoppix# iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

ra0 RT2870 Wireless ESSID:"myrouterxxxxx" Nickname:"RT2870STA"
Mode:Auto Frequency=2.462 GHz Access Point: Not-Associated
Bit Rate:1 Mb/s
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=10/100 Signal level:0 dBm Noise level:-87 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Questions:

1. Is the ESSID = "myrouterxxxxx" the correct ESSID name?
2. Are you able to do the pump command to get an IP address from your router?

# pump -i ra0

Note: your wireless router should be setup with dhcp = on or else it will not be able to response back with the IP address request.
If you can pass the pump command, then you should be able to connect to your LAN via the wireless adapter.
You can double check with the ifconfig command

$ ifconfig ra0

It should return you the ra0 configuration data with an IP address.
I believe you can do it according to your first post. Now I want you to do the following steps:
1. Reboot the knoppix
2. After the knoppix boot up, open a konsole and su to root

$ su
#

3. Reset the USB port with the following commands

# modprobe -r uhci-hcd
# modprobe uhci-hcd

4. Now perform a iwconfig, you should see the ra0 appears
5. Setup the essid with iwconfig

# iwconfig ra0 essid myrouterxxxxx

change the "myrouterxxxxx" to whatever it is on your wireless router if it is not the same.
6. Start your wireless device using ifconfig

# ifconfig ra0 up

7. Obtain the IP address from the router

# pump -i ra0

8. Try to see if you can connect to the internet or other machines in your local area network. If the answer is yes. Move on to the next step.
9. Edit your rc.local file and right before the exit 0 statement, insert the commands on step 3. Save the file and then reboot knoppix.
10. Now su to root, and then continue from step 4 to step 7.
11. If it works, edit the rc.local file again, this time put all commands there, step 5, 6, 7 and your rc.local should look like this

sudo insmod /lib/modules/2.6.24.4/wireless/rt2870sta.ko
modprobe -r uhci-hcd
modprobe uhci-hcd
iwconfig ra0 essid myrouterxxxxx
ifconfig ra0 up
pump -i ra0
exit 0

Let us know if it works.

Rgds,
Chip

sbininit
08-22-2009, 02:05 PM
I can't seem to reset the usb port with that modoprobe command and there doesn't seem to be a module loaded that
resembles the one you suggested.


root@Knoppix:/home/knoppix# modprobe -r uhci-hcd
FATAL: Module uhci_hcd not found.


and pump -i ra0


always returns with-


root@Knoppix:/home/knoppix# pump -i ra0
Operation failed.



After rebooting I have to get back on line by...

1. manually installing WUSB600N driver rt2870sta.ko

# insmod /lib/modules/2.6.24.4/wireless/rt2870sta.ko which I have a script in /bin for titled loadra0

2.run knoppix network wlan configuration with ra0 still down, set mode to auto set essid to bogusnamerouterxxxx, set IP
to auto and let it run. If DHCP answers with IP,broadcast,gateway, adresses etc,...it will load by...

3.# ifconfig confirms that ra0 is up


4.run the knoppix network wlan configuration tool once more now that ra0 is up and voila I'm back here posting.



I would lik to add that it doesnt seem to work the same every time. /etc/rc.local was loading the usb driver at boot
time after I changed the name of the script from /bin/sh -e to /bin/sh. The last five or six times it has not and I have
to manually load it.

Its easy enough but I would like to be able to do it all by command if possible.

chip.ling
08-25-2009, 10:46 PM
I can't seem to reset the usb port with that modoprobe command and there doesn't seem to be a module loaded that
resembles the one you suggested.


root@Knoppix:/home/knoppix# modprobe -r uhci-hcd
FATAL: Module uhci_hcd not found.


and pump -i ra0


always returns with-


root@Knoppix:/home/knoppix# pump -i ra0
Operation failed.


Sounds like we are using difference version of Knoppix. I am still using Knoppix 5.1.1. Kernel version is 2.6.19.

From the info your provided, you must be using 5.3.1 or above.

I downloaded knoppix 5.3.1, which has the same kernel number as yours, and did a test on it, it did not work. Don't even has the uhci-hcd USB module for me to do a reset.

For the pump command, I got the same problem as you under knoppix 5.3.1


After rebooting I have to get back on line by...

1. manually installing WUSB600N driver rt2870sta.ko

# insmod /lib/modules/2.6.24.4/wireless/rt2870sta.ko which I have a script in /bin for titled loadra0

2.run knoppix network wlan configuration with ra0 still down, set mode to auto set essid to bogusnamerouterxxxx, set IP
to auto and let it run. If DHCP answers with IP,broadcast,gateway, adresses etc,...it will load by...

3.# ifconfig confirms that ra0 is up


4.run the knoppix network wlan configuration tool once more now that ra0 is up and voila I'm back here posting.



I would lik to add that it doesnt seem to work the same every time. /etc/rc.local was loading the usb driver at boot
time after I changed the name of the script from /bin/sh -e to /bin/sh. The last five or six times it has not and I have
to manually load it.

Its easy enough but I would like to be able to do it all by command if possible.

Yes, I understand what you mean. That's why I still try to use command line commands when possible. Just wonder if those gui programs (i.e. network wlan config tool) can be run in silent mode (or in batch mode)

If you cannot find a way to run all those commands in command mode to activate the wlan, you cannot automate it.

Rgds,
Chip

sbininit
08-27-2009, 11:00 AM
I was wondering if there is a way to view the commands that the knoppix network utility uses? The answer has to be somewhere in there. Where would one find the script it uses?

Sorry I failed to mention I was using knoppix 5.3.1. I kind of figured network connecting would all work about the same on any knoppix.

chip.ling
09-01-2009, 04:55 AM
I was wondering if there is a way to view the commands that the knoppix network utility uses? The answer has to be somewhere in there. Where would one find the script it uses?

Sorry I failed to mention I was using knoppix 5.3.1. I kind of figured network connecting would all work about the same on any knoppix.

Well, if you really interested in it. You can go to the following two directories which hold all the programs you can run from the k-menu and the knoppix menu.


/usr/share/applications
/usr/share/applications/kde


I take a look at the file kwlan.desktop under /usr/share/applications, I believe it is the Kwlan wireless LAN manager on the K-Menu


# cat /usr/share/applications/kwlan.desktop | head

[Desktop Entry]
Encoding=UTF-8
Name=Kwlan
Exec=kwlan %i %m -caption "%c"
Icon=kwlan
Type=Application
DocPath=kwlan/kwlan.html
Comment=KDE network manager
Comment[da]=KDE's netværkshåndtering
Comment[el]=ÎιαÏειÏιÏÏÎ®Ï Î´Î¹ÎºÏÏÎ¿Ï ÏÎ¿Ï KDE


On the 4th line, the command after Exec= is the actual command it runs.

From the /KNOPPIX/usr/bin directory, you can find the kwlan program in binary format.

The problem of the GUI program is that, even you kick it off from command line and it MIGHT end up go back to the interactive GUI interface mode and ask you to provide input. Obviously you cannot put it into your automation script.

It's up to the developer's preference to provide a batch silent mode (i.e. you enter all required parameters up front or allow you to enter all input from a configuration file) or not.

Rgds,
Chip

sbininit
09-12-2009, 03:35 AM
I was wondering if there is a way to view the commands that the knoppix network utility uses? The answer has to be somewhere in there. Where would one find the script it uses?

Sorry I failed to mention I was using knoppix 5.3.1. I kind of figured network connecting would all work about the same on any knoppix.

Well, if you really interested in it. You can go to the following two directories which hold all the programs you can run from the k-menu and the knoppix menu.


/usr/share/applications
/usr/share/applications/kde


I take a look at the file kwlan.desktop under /usr/share/applications, I believe it is the Kwlan wireless LAN manager on the K-Menu


# cat /usr/share/applications/kwlan.desktop | head

[Desktop Entry]
Encoding=UTF-8
Name=Kwlan
Exec=kwlan %i %m -caption "%c"
Icon=kwlan
Type=Application
DocPath=kwlan/kwlan.html
Comment=KDE network manager
Comment[da]=KDE's netværkshåndtering
Comment[el]=ÎιαÏειÏιÏÏÎ®Ï Î´Î¹ÎºÏÏÎ¿Ï ÏÎ¿Ï KDE


On the 4th line, the command after Exec= is the actual command it runs.

From the /KNOPPIX/usr/bin directory, you can find the kwlan program in binary format.

The problem of the GUI program is that, even you kick it off from command line and it MIGHT end up go back to the interactive GUI interface mode and ask you to provide input. Obviously you cannot put it into your automation script.

It's up to the developer's preference to provide a batch silent mode (i.e. you enter all required parameters up front or allow you to enter all input from a configuration file) or not.

Rgds,
Chip


Well, it works I guess that's the main thing. I just kinda figured that it would work like Ubuntu 8.10.

ifconfig ra0 up followed by dhclient gets you going. Sometimes you might have to do an ifconfig ra0 down and back up but not often. Ubuntu 9.04 supports the usb wireless out of the box, I guess everything will in time though. Thanks for the replys.