Welcome! Log In Create A New Profile

Advanced

Strange behaviors of Wheezy/Pogo Mobile with wifi dongle

Posted by twinclouds 
Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
September 23, 2014 10:12PM
A few years ago, I experimented with wifi dongles on Dockstar to access wifi networks successfully. But that was Lenny time. Recently, I tried to do the same thing on Wheezy/Dockstar and Pogo Mobile, but always had problems. I used exactly the same procedure/configurations that had been used on Raspberry Pi successfully. However, they did not work on Dockstar and Pogo Mobile, even though all of them using Debian/Wheezy and based on arm processors as CPU.
The main issue I had was that the wifi network would connect and I could login through the wifi dongle's address with the ethernet cable plugged in, it would disconnect once I pulled out the ethernet cable. Then I found that if I disabled eth0 by "ifdown eth0," the wifi ip address will still work after unplugging the ethernet cable. So I added "ifdown eth0" to rc.local before exit. Sure enough, I can restart the device with the ethernet cable unplugged and the wifi still works.
After that I found another problem. Even though the device could reach other devices on the local net, it couldn't ping entities on internet outside local net. By checking using "route -n", I found the the gateway was reset after doing "ifdown eth0". It would work again if I did a "route add default gw 192.169.x.x(Gatewayip)", so I added this line to rc.local also.
Everything works fine now. However, I found another strange thing, even though that does not affect the functionality. When I check the available ip addresses by using Advanced IP Scanner, I can see that the ip address of the ethernet port still showed up and I can ssh in using that ip, even though "ifconfig" showed only lo and wlan0 but no eth0.
Since the same setup works fine on RPi, I suspect the behavior described above is caused by the Kernel (3.14.0-kirkwood-tld-1) used in Pogo Mobile/Dockstar. I am not really that good on Linux and networking. Maybe somebody more experience can find the cause of these behaviors, so wifi can work without the patches?



Edited 2 time(s). Last edit at 09/24/2014 03:51PM by twinclouds.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
September 29, 2014 07:27AM
Hi
i cant offer you the technical answer to your issue, but i can offer you a pre scripted solution available on the git hub. search for and install create_ap. the author (Oblique) has put a lot of work on this and i find it accomplishes my wifi needs adequately. there are a couple of dependencies you need to add and these are listed at the following link. i currently run it from rclocal as opposed to running as a system service,

This works fine on my Pogo mobile and Pogov4

link below

https://github.com/oblique/create_ap
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
September 29, 2014 12:35PM
Thanks. However, I think what he did was to set up an wifi AP rather than to use a Dockstar/Pogo to connect to an existing network. Do I understand correctly?
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 01, 2014 11:43AM
The script does what you mentioned and more, you can both ways with the lan -> wifi <-lan  / wifi to wifi etc also if your adaptor supports it add wifi and share the wifi off the same adaptor. its a VERY adaptable script.

What is your use case that you are trying to address? ie how are you looking to use what to do what?


Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 01, 2014 12:16PM
What I want to do is very simple. I have a regular wifi (also ethernet) network aleady. I simply want to use and wifi dongle plugged into Pogo mobile and use it to connect to the existing wifi network. Can the script do that? I don't need to use the Pogo mobile as an AP.
I will take a more careful look at the script also.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 01, 2014 01:20PM
ahh, now i understand the use

My mistake is misinterpreting your question at the top, put it down to a long day.... the create_ap is ethernet to wifi dominant .

Re reading the above (taking it into leafpad so i could read it properly). thats interesting behaviour that its exhibiting in that it still holds the ip address of the downed network card. my first thoughts are arp cache not clearing as quickly as expected.

I will see if i can replicate the issue on mine.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 01, 2014 03:04PM
Thanks. Looking forward to hearing from you soon.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 03, 2014 03:33AM
Hi again, before i reimage my Pogov4-Mobile can you have a look below?

Im going to make the following assumptions about your setup

1 You are using WPA-PSK for your wireless network
2 You are running the commands from the plug/dockstar from a serial connection.
3 You have wpa_supplicant installed correctly and there are no issues with your wireless network card
4 when you do an "iwlist" you only have 1 wireless card showing, as wlan0
5 That if you followed the Pi way of doing things that you dont have any GUI specific network manglers lurking around.
They sometimes get installed and can interfere.

the above being the case /etc/wpa_supplicant.conf should be something like this.

:----> snip
network={
ssid="mywifilink"
proto=WPA
key_mgmt=WPA-PSK
psk="mylongpassword"
}
:----< snip

and /etc/network/interfaces, something like this

:----> snip
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

auto eth0

:----< snip

If they dont, give these settings a go and let me know what you experience. i guess i dont need to advise that any files you modify you should backup first.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 03, 2014 11:42AM
Gravelrash:
Thanks for you directions. I have an almost identical setup. The only thing I have differently is in the interfaces file. I don't have the two lines:
pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

The wlan0 part looks more like:
auto wlan0
iface wlan0 inet static
address 192.168.x.xx
gateway 192.168.x.1
network 192.168.x.0
netmask 255.255.255.0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

BTW, shouldn't "-iwlan0" in the post-down line be "-i wlan0"? I can try both, though.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 03, 2014 05:56PM
Gravelrash:
I have modified my interfaces file according to what you sent. The results are the same, with the ethernet cable connected, I can ssh into either eth0 or wlan0. However, when ethernet cable is unplugged, ssh to the wlan0 ip address has no response.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 04, 2014 05:59AM
Twinclouds:

Thanks for trying the above.

i will build mine around the config you posted around *your* setup. It appears, as you have described, that the gateway is being removed when the eth0 is removed, the statement eth0 auto in the interfaces should allow you to plug and unplug to your hearts content.

I'm not convinced yet at this point that the kernel is in error.

Are you in a position with your device to set the wlan0 interface as dhcp? To see what the results are?

Previously i have seen similar to what you describe, that have been resolved with doing a dhcp rediscover command on the wlan0. which recreates the gateway automatically. Given that you are on the local network the device will still find the dhcp server and rebuild its routing table as a matter of course

Another thought comes to me, i wonder if we add a comment in the interfaces file for when the eth0 goes down to reinitate and insert the default gateway. thus alleviating the need to do it manually.

Gravelrash
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 04, 2014 06:20PM
I can use dhcp server but the results are the same. Namely, when ever the ethernet cable is unplugged, there will be no connect when ssh to the wlan0 ip. The portion of interfaces related to wlan0 is as follows:
allow-hotplug wlan0
iface wlan0 inet dhcp

wpa-conf /etc/wpa_supplicant.conf
iface default inet dhcp

I don't know what is the "dhcp rediscover command". If you let me know, I can certainly try also.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 04, 2014 08:03PM
@twinclouds,

Do you have serial console? this is where serial console will make troubleshooting much easier. I had this problem long ago on the Pogo Pro. IIRC, the solution was with routing table (gateway). If I can find my note, I'll post the settings.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 04, 2014 10:55PM
Hi, Budhi:
Yes. I can have serial connection to the Dockstar or Pogo mobile. The question is I don't know what to look for because I don't really know much about Linux networking. If you provide me some directions, I can certainly look into the details when get time.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 03:52AM
twinclouds,

I meant simply that you can log in with serial console and look at the problem live, even though you can't ssh in. You can try setting routes, up/down the wlan, … so on. It is easier to see it that way.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 10:23AM
I second bodhi on this

What you are experiencing is because the load order of the network is eth0 then wlan0. I managed to replicate your situation by having the eth0 and wlan0 on the same network segment. the result of which (caused by binding order of the network interfaces) was for the routing table to preference eth0 over wlan0 and build the routing table accordingly.

When the eth0 was downed/unplugged this removed the default route statement from the routing table. and as the network has no other unique network to reference + there has been no traffic passed through the wlan0 interface there is no route for the packets to go to. No "backup route" is evident.

to dhcp rediscover, do as follows:-
release the address : dhclient -r
renew the address : dhclient wlan0

these links should give you an idea of how to add a persistant static route to your wireless or other interface
http://mahidulsblog.blogspot.co.uk/2013/04/how-to-add-static-route-in-linux-md.html
http://amar-linux.blogspot.co.uk/2011/12/adding-persist-static-routes-in-debian.html
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 11:36AM
Bodhi, Gravelrash:
I understand what bodhi said. Still, my problem was I didn't know what to look into. What Gravelrash provided will be useful for me to start. I will let you know what I found.
Thanks you both.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 12:01PM
@twinclouds
glad you have some pointers to get things started - im willing to help in the future if you need more assistance.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 12:58PM
@Gravelrash,
Thank you for your willingness to help. I really appreciate that.
In http://amar-linux.blogspot.co.uk/2011/12/adding-persist-static-routes-in-debian.html, which you pointed me to. Do you know in the permanent fix, why he has the statement "down route del ......" after the statement "up route add......"? Will the "down route ..." statement negate what "up route ..." had done?
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 01:11PM
in this context, up and down relates to interface states.

all things being equal - up will add the route when the interface comes up and conversely down will remove the static route when the interface is down.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 01:39PM
Quote
Gravelrash
> What you are experiencing is because the load
> order of the network is eth0 then wlan0. I managed
> to replicate your situation by having the eth0 and
> wlan0 on the same network segment. the result of
> which (caused by binding order of the network
> interfaces) was for the routing table to
> preference eth0 over wlan0 and build the routing
> table accordingly.
>
> When the eth0 was downed/unplugged this removed
> the default route statement from the routing
> table. and as the network has no other unique
> network to reference + there has been no traffic
> passed through the wlan0 interface there is no
> route for the packets to go to. No "backup route"
> is evident.
>

This was precisely the reason, iirc.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 05, 2014 07:06PM
Gravelrash, Bodhi:
Thank you both again.
I tried a few of the suggestions. They mostly work when giving the commands but not after restarting. I found the most reliable way is put the following commands in the rc.local before exist:
sleep 5
if ifconfig wlan0 | grep "inet addr:" ; then
  ifconfig eth0 down
  route add default gw 192.168.2.1
fi
It may not be the proper way to program but it seems serving my purpose fine. I don't know why but I can still access my eth0 ip even the cable is not connected.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 06, 2014 03:30AM
You will definitely need to be using the serial connection for teh next steps

could you pirint out and show us the routing table for the device when the eth0 interface is connected and when it is disconnected. use the following command.

route -n

after this it may be necessary to tweak route cache. following links are a "starter for 10" - so to speak

http://vincent.bernat.im/en/blog/2011-ipv4-route-cache-linux.html
http://linux-ip.net/html/linux-ip.html

or it could be as simple as the interface eth0 is holding its ip address until the dhcp lease expires



Edited 1 time(s). Last edit at 10/06/2014 10:26AM by Gravelrash.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 06, 2014 11:24AM
Thanks.
I am a little occupied by other things right now. Will get back when more information is available. Please keep me posted if you find anything more.



Edited 1 time(s). Last edit at 10/06/2014 11:26AM by twinclouds.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 11, 2014 01:29PM
Hi, Bodhi:
I tried to compile the driver for RTL-8192EU. I got the source code and compiling scripts. However, when I did the build, it give me the errors:
make ARCH=armv5tel CROSS_COMPILE= -C /lib/modules/3.14.0-kirkwood-tld-1/build M=/usr/src/RTL8192EU_linux_v4.3.1.1_11320.20140505/driver/rtl8192EU_linux_v4.3.1.1_11320.20140505  modules
make[1]: Entering directory `/lib/modules/3.14.0-kirkwood-tld-1/build'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/lib/modules/3.14.0-kirkwood-tld-1/build'
make: *** [modules] Error 2
There's nothing in the 'build' directory. Do you know what I should do to fix?
Thanks.
BTW I am still using 3.14.0 because it works best for the wifi module.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 11, 2014 03:50PM
Twinclouds,

That build directory should not be there, you can remove it. Version 3.14.0 was compiled with make-kpkg and this build directory was an artifact.

Further thought: this driver is not in 3.17 either. Did you download it from Realtek?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 10/11/2014 03:56PM by bodhi.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 11, 2014 04:59PM
Hi, Budhi:
Thank you for your quick reply. The "build" directory was not there actually. Then the compilation process showed:
make: *** /lib/modules/3.14.0-kirkwood-tld-1/build: No such file or directory.  Stop.
make: *** [modules] Error 2
I then added this sub-directory and that still didn't work.
I bought a wifi usb dongle from ebey. It didn't work so I contacted the seller and he sent the package. I can forward it to you if you tell me where to sent. Maybe you can take a look and let me know what went wrong. I just run the install.sh script.



Edited 1 time(s). Last edit at 10/11/2014 05:05PM by twinclouds.
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 11, 2014 06:54PM
twinclouds,

Pls check your PM.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 12, 2014 06:31PM
Hi twinclouds,

I've looked at the driver zip file.

In this document: "Quick_Start_Guide_for_Driver_Compilation_and_Installation.pdf". Step 5 shows you how to integrate the driver source into the kernel source tree. This is where you can extract the source for this RTL-8192EU driver. The extracted source will be captured in a folder. If you could do this and post or send me the folder archive then I can put it in the kernel source tree, compile it.

This is the quickest way to get the module, and also include it the kernel (for the benefit of others looking for this particular driver in the future).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Strange behaviors of Wheezy/Pogo Mobile with wifi dongle
October 12, 2014 08:56PM
Hi, Bodhi:
I extracted the files for 8192eu. That is the easy part. It does not looks as easy to modify the Makefile and Kconfig files are in the instructions. For example, I think the platform statement should also be changed but there are many ARM platforms I even don't know which is the right one. I leave these files there so may be you know what to modify. In any case, I have sent the download link for you to take a look. Thanks.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: