Hi! Some general question + Wifi USB Realtek RTL8191S

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Wed Jan 08, 2014 9:02 pm

So some progress...
yes you can do these commands to see what happens
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log


You can repeat these commands before and after bringing a network interface
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Wed Jan 08, 2014 9:15 pm

bringup_wlan0 is now:
#!/bin/sh

/usr/bin/echo "start of bringup_wlan0" >> /etc/iface_scripts/udev.log
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/sbin/ifconfig wlan0 up
/sbin/route add dafault gw 192.168.178.1 dev wlan0
/sbin/ifconfig eth0 down
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/usr/bin/echo "end of bringup_wlan0" >> /etc/iface_scripts/udev.log


bringdown_wlan0 is now:
#!/bin/sh

/usr/bin/echo "Start of bringdown_wlan0" >> /etc/iface_scripts/udev.log
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/sbin/ifconfig eth0 up
/sbin/route add default gw 192.168.178.1 dev eth0
/sbin/ifconfig wlan0 down
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/usr/bin/echo "End of bringdown_wlan0" >> /etc/iface_scripts/udev.log



udev.log is now:
start of bringup_wlan0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 * 255.255.255.0 U 0 0 0 eth0
eth0 Link encap:Ethernet HWaddr
inet addr:192.168.178.200 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:4bff:fe91:71ff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3478 errors:0 dropped:0 overruns:0 frame:0
TX packets:1591 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:382361 (373.3 KiB) TX bytes:241404 (235.7 KiB)
Interrupt:11

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:65536 Metric:1
RX packets:284 errors:0 dropped:0 overruns:0 frame:0
TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27023 (26.3 KiB) TX bytes:27023 (26.3 KiB)

wlan0 Link encap:Ethernet HWaddr
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
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:65536 Metric:1
RX packets:284 errors:0 dropped:0 overruns:0 frame:0
TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27023 (26.3 KiB) TX bytes:27023 (26.3 KiB)

wlan0 Link encap:Ethernet HWaddr
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

end of bringup_wlan0
Start of bringdown_wlan0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
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:65536 Metric:1
RX packets:284 errors:0 dropped:0 overruns:0 frame:0
TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27023 (26.3 KiB) TX bytes:27023 (26.3 KiB)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 * 255.255.255.0 U 0 0 0 eth0
eth0 Link encap:Ethernet HWaddr
inet addr:192.168.178.200 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:4bff:fe91:71ff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3482 errors:0 dropped:0 overruns:0 frame:0
TX packets:1597 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:382765 (373.7 KiB) TX bytes:241844 (236.1 KiB)
Interrupt:11

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:65536 Metric:1
RX packets:284 errors:0 dropped:0 overruns:0 frame:0
TX packets:284 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27023 (26.3 KiB) TX bytes:27023 (26.3 KiB)

End of bringdown_wlan0
Last edited by matzi on Wed Jan 08, 2014 9:46 pm, edited 1 time in total.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Wed Jan 08, 2014 9:22 pm

I see that your wlan0 doesn't seem to be set and so no wlan0 exists when you bring up it.

As I doesn't follow with much attention how do you set it may be you should add in the wlan0 bring_up script the commands that you use to do this.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Wed Jan 08, 2014 9:27 pm

When I move the udhcpc command from my bootscript into the bringup_wlan0 script it works. Plugging the dongle let me access the webinterface through wireless and wired IP. Unplugging switches back to wired IP.

After unplugging the cable while dongle is plugged, I have access through both IPs. For the first time without giving ifconfig eth0 down manually! :bananadance
Last edited by matzi on Wed Jan 08, 2014 10:24 pm, edited 1 time in total.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Wed Jan 08, 2014 9:35 pm

Glad to heard this, matzi... :applause

I Think that you and us learned much on this challenge :thumbup
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Wed Jan 08, 2014 9:44 pm

Just opened a fresh beer an enabled fvdw to share another one with you!
Santé!
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Wed Jan 08, 2014 9:54 pm

me too :beer:
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Sat Mar 29, 2014 3:04 pm

Jocko I found an unsolved issue:

see the logfile:
start of bringup_wlan0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 * 255.255.255.0 U 0 0 0 eth0
eth0 Link encap:Ethernet HWaddr 00:D0:4B:91:71:FF
inet addr:192.168.178.200 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:4bff:fe91:71ff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:501 errors:0 dropped:0 overruns:0 frame:0
TX packets:838 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:125502 (122.5 KiB) TX bytes:45562 (44.4 KiB)
Interrupt:11

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:65536 Metric:1
RX packets:249 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26305 (25.6 KiB) TX bytes:26305 (25.6 KiB)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface

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:65536 Metric:1
RX packets:249 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26305 (25.6 KiB) TX bytes:26305 (25.6 KiB)

wlan0 Link encap:Ethernet HWaddr 00:0D:81:AC:5B:AD
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

end of bringup_wlan0
Start of bringdown_wlan0
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface

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:65536 Metric:1
RX packets:249 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26305 (25.6 KiB) TX bytes:26305 (25.6 KiB)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 * 255.255.255.0 U 0 0 0 eth0
eth0 Link encap:Ethernet HWaddr 00:D0:4B:91:71:FF
inet addr:192.168.178.200 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:4bff:fe91:71ff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:537 errors:0 dropped:0 overruns:0 frame:0
TX packets:844 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:139141 (135.8 KiB) TX bytes:46010 (44.9 KiB)
Interrupt:11

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:65536 Metric:1
RX packets:249 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26305 (25.6 KiB) TX bytes:26305 (25.6 KiB)

End of bringdown_wlan0



This logfile is created from the two scripts bringup_wlan0 and bringdown_wlan 0

bringup_wlan0

#!/bin/sh

/usr/bin/echo "start of bringup_wlan0" >> /etc/iface_scripts/udev.log
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
udhcpc -b -i wlan0 -q -s /etc/simple.script

/sbin/ifconfig eth0 down
/sbin/ifconfig wlan0 up
/sbin/route add default gw 192.168.178.1 dev wlan0
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/usr/bin/echo "end of bringup_wlan0" >> /etc/iface_scripts/udev.log



bringdown_wlan0:

#!/bin/sh

/usr/bin/echo "Start of bringdown_wlan0" >> /etc/iface_scripts/udev.log
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/sbin/ifconfig eth0 up
/sbin/route add default gw 192.168.178.1 dev eth0
/sbin/ifconfig wlan0 down
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/usr/bin/echo "End of bringdown_wlan0" >> /etc/iface_scripts/udev.log


Please see the red highlighted lines. Does that mean there are situations without a routing table? If so, why? I have the routing commands in the scripts.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Mon Mar 31, 2014 6:08 pm

Hi matzi,

I don't think so.

When you do a route command later, I am pretty sure that you get the right route table. I think that you must wait a time after bringing up a iface before printing the route table.

So try to use previously a sleep command (for example with 3'') before printing the route table.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Thu Jun 12, 2014 10:50 pm

Hi Jocko,

after some time has passed I did some further investigations on the wireless subject. I found out that it just needs some time delays to get it perfectly running. My current bringup_wlan0.sh is:


#!/bin/sh

/usr/bin/echo "start of bringup_wlan0" >> /etc/iface_scripts/udev.log
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log

/sbin/ifconfig wlan0 up
/usr/bin/sleep 30s
/sbin/udhcpc -b -i wlan0 -q -s /etc/simple.script >> /etc/iface_scripts/udev.log
# /sbin/ifconfig wlan0 192.168.178.27 netmask 255.255.255.0
/sbin/route add default gw 192.168.178.1 dev wlan0
/sbin/ifconfig eth0 down
/usr/bin/sleep 5s
/sbin/route >>/etc/iface_scripts/udev.log
/sbin/ifconfig >>/etc/iface_scripts/udev.log
/usr/bin/echo "end of bringup_wlan0" >> /etc/iface_scripts/udev.log


Now as you can see there are two delays. One is in my opinion a delay between the call of wpa_supplicant and udhcpc. The other is between udhcpc and reporting its results by ifconfig. You see my values above. Maybe the values depend on the specific wifi dongle.

There is still the need to adjust the routing tables manually. In fact my old configuration never came to a successfull ip assignment by udhcpc.

I need to update the wireless howto.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 11 guests