• Home
  • Help
  • Search
  • Login
  • Register
Pages: 1 [2] 3
Author Topic: Setting up sheevaplug with wlan  (Read 11853 times)
AutoStatic
Newbie
*

Karma: 1
Posts: 40


View Profile
« Reply #15 on: August 22, 2009, 12:44:59 AM »

If ftp won't work I wonder if the sheeva can be setup to serve webpages? (Was hoping to do it via ftp, as (usually) its pretty easy. Smiley
You can get ftp to work if you want to, same goes for a webserver. I use Apache myself with PHP5 (I need stuff like virtual hosting, mod_rewrite and such). Just a simple apt-get apache2 php5 does the trick then. And some knowledge about setting it up, but documentation on setting up a webserver is spread all over the net. If you want less overhead you could try lighthttpd. But you are using the Ubuntu installation on your plug right? For setting up an ftp server you could use this information: http://ubuntuforums.org/showthread.php?t=79588 or https://help.ubuntu.com/6.06/ubuntu/serverguide/C/ftp-server.html
Logged

ljones
Newbie
*

Karma: 0
Posts: 20


View Profile
« Reply #16 on: August 23, 2009, 06:16:01 AM »

 Sad Sad

Spoke to soon. More problems!

I have everything up and running with lighttp and an ftp server now. I'm using a powered USB hub to connect the WLAN to the sheevaplug (and also an external hard drive).

Snag is the connection from the USB WG111V2 is really flaky. I mean seriously flaky. I can ping the WG111V2/Sheeva and it often misses pings or completely fails! I've also noticed that the WG111V2 although it connects - its blue light never switches on (it should come on and flash or do something). It is also getting very hot - in fact after a time, the metal USB connector of the WG111V2 gets so hot it is not that far away from being the right tempeature to burn your skin. I'm just glad it is not in the sheeva directly.

I've seen this before with another USB wireless device though and yes another WG111V2 (not my one though!). The light failed to come on and it got very hot though that one also refused to connect to anything (which was from memory a driver problem). Once it connected, the blue light turned on and it didn't get anywhere near as hot.

What I am not sure about is if I am looking at some sort of driver problem or weather or not my WG111V2 is dying. Only thing I can do (and I don't want to get another WG111V2) is to try a different devicel I just bought one off ebay, an Alfa Network AWUS036H . It uses an RTL8187L chipset (which I think is the same as the WG111V2, not an RTL8187B chipset, that one won't work). So I hope to try that one out and see how far I get with it.

Does anyone know if my WG111V2 is on its way out, or maybe it is a software problem?

ljones
« Last Edit: August 23, 2009, 06:18:04 AM by ljones » Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #17 on: August 23, 2009, 01:16:26 PM »

My wifi is also a little flakey at the moment. After about a day it loses association with the AP.
So I've added a script to re-associate when this happens.
No packet loss on ping, though (although I have just changed the aerial and move things around).
I have one of these.  And yes - it does get quite warm.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #18 on: August 24, 2009, 05:23:12 PM »

Might be related to things like this:

http://patchwork.kernel.org/patch/38530/

There seem to be a few post about "No probe response from AP" timeouts since 2.6.30-rc3.  Apparently fixed at 2.6.31.2.  But they may be driver-specific (and neither is RTL8187).

My scripts to re-associate (which are at least a workaround) are these:
5-min crontab job (/etc/cron.d/WifiCheck)
Code:
# Check the Wifi status
#
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/local/bin

01-58/5 * * * * root /local/bin/wireless-check
The actual script (/local/bin/wireless-check):
Code:
#!/bin/sh
#
if=wlan0

if iwconfig $if | grep -q Not-Associated; then
   : Not associated, so get it to retry
else
   exit     # All OK
fi

iwconfig $if | Mail -s 'Wifi lost association on plug' {my-mail-address}
# Force re-association
iwconfig $if ap auto
(I've got mail setup...)
The result, earlier today, showed this in in dmesg (as well as mailing me the Not-Associated details):
Quote
wlan0: no probe response from AP 00:02:cf:xx:xx:xx - disassociating
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 1
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 2
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 3
wlan0: direct probe to AP 00:02:cf:xx:xx:xx timed out
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 1
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 2
wlan0 direct probe responded
wlan0: authenticate with AP 00:02:cf:xx:xx:xx
wlan0: authenticated
wlan0: associate with AP 00:02:cf:xx:xx:xx
wlan0: RX ReassocResp from 00:02:cf:xx:xx:xx (capab=0x431 status=0 aid=4)
wlan0: associated
Logged

ljones
Newbie
*

Karma: 0
Posts: 20


View Profile
« Reply #19 on: August 26, 2009, 01:40:39 PM »

Ok, giving those scripts a try. Do I have to do anything extra to activate them?

I got the new wlan, btw. So far I've had mixed results. On the first attempt it lost the connection very quickly - within the first 10 or so seconds. A Second try lasted for several hours.

ljones
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #20 on: August 27, 2009, 06:24:57 PM »

Ok, giving those scripts a try. Do I have to do anything extra to activate them?
No - just drop the control file into /etc/cron.d.  cron will see that the directory has changed at its next minute-wakeup.
Quote
I got the new wlan, btw.
New wlan?  You mean the Alpha USB dongle?
Logged

ljones
Newbie
*

Karma: 0
Posts: 20


View Profile
« Reply #21 on: September 09, 2009, 10:08:57 AM »

Ok, giving those scripts a try. Do I have to do anything extra to activate them?
No - just drop the control file into /etc/cron.d.  cron will see that the directory has changed at its next minute-wakeup.
Quote
I got the new wlan, btw.
New wlan?  You mean the Alpha USB dongle?

Sorry for the delay - !

BTW the scripts so far seem to be working, though I still have yet to find a proper place to put the sheevaplug (and ext. hard drive).

Yep the new wlan is an alfa one, so far so good -- much better than the netgear!

I can get into the sheevaplug/hard drive with both "ftp" or "gftp" on another linux machine.

*Snag is.....*
Now I need how to figure out how to do port forwarding on the sheevaplug (as I'm using no-ip.com as well). No idea on that one -- !

ljones
« Last Edit: September 09, 2009, 10:39:13 AM by ljones » Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #22 on: September 09, 2009, 02:01:08 PM »

BTW the scripts so far seem to be working, though I still have yet to find a proper place to put the sheevaplug (and ext. hard drive).
Good.  I changed the aerial on mine, which enabled me to get a better signal, as it has a longer lead, allowing more placement freedom.  If I reboot it seems to lose association once within the first day, then stays connected.  Almost as though it learns!
Quote
Now I need how to figure out how to do port forwarding on the sheevaplug (as I'm using no-ip.com as well). No idea on that one -- !
Don't you need to do port-forwarding on your router?  Or are you using the Plug as a router  Shocked
I'm interested in how to set the Ethernet interface to be on a different network (well - that bit's easy) and route between it and the Wifi device.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #23 on: September 10, 2009, 05:38:54 PM »

If you want to try improve the Wifi reception you could try one of these!?!  The links to the European suppliers (a French one that only supplies them in batches of 24?, and one on the Spanish EBay) still seem to have the previous version, which is more expensive.
So you could get one form the US at $59 + ~$34 P+P.  Plus VAT - possibly/probably. 
Logged

westyd1982
Newbie
*

Karma: 1
Posts: 29


View Profile
« Reply #24 on: September 12, 2009, 11:54:23 AM »

I had good success setting up a ZyXEL G-202 to provide WLAN.  It is on a Plug running Debian.  The Debian wiki has good instructions: http://wiki.debian.org/zd1211rw, and it didn't take long to get it up and running.
Logged

ruidc
Newbie
*

Karma: 0
Posts: 36


View Profile
« Reply #25 on: September 13, 2009, 04:44:25 AM »

I'd like to get my plug working with a ZyXEL G-220 wlan dongle. My understanding is that the zd1211rw drivers for this have existed in the linux kernel since 2.6.18 (http://linuxwireless.org/en/users/Drivers/zd1211rw), but they do not appear to be present in the sheeva ubuntu kernel 2.6.30.4 i have installed.

What is the best way to proceed? is there a way for me to add it? or do i need to compile a new kernel from scratch? Or would it make sense to get the distributers to add this, and if so how would i go about it?

Any direction appreciated.

Regards,
ruidc
Logged

ljones
Newbie
*

Karma: 0
Posts: 20


View Profile
« Reply #26 on: September 19, 2009, 04:29:54 PM »

Might be related to things like this:

http://patchwork.kernel.org/patch/38530/

There seem to be a few post about "No probe response from AP" timeouts since 2.6.30-rc3.  Apparently fixed at 2.6.31.2.  But they may be driver-specific (and neither is RTL8187).

My scripts to re-associate (which are at least a workaround) are these:
5-min crontab job (/etc/cron.d/WifiCheck)
Code:
# Check the Wifi status
#
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/local/bin

01-58/5 * * * * root /local/bin/wireless-check
The actual script (/local/bin/wireless-check):
Code:
#!/bin/sh
#
if=wlan0

if iwconfig $if | grep -q Not-Associated; then
   : Not associated, so get it to retry
else
   exit     # All OK
fi

iwconfig $if | Mail -s 'Wifi lost association on plug' {my-mail-address}
# Force re-association
iwconfig $if ap auto
(I've got mail setup...)
The result, earlier today, showed this in in dmesg (as well as mailing me the Not-Associated details):
Quote
wlan0: no probe response from AP 00:02:cf:xx:xx:xx - disassociating
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 1
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 2
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 3
wlan0: direct probe to AP 00:02:cf:xx:xx:xx timed out
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 1
wlan0: direct probe to AP 00:02:cf:xx:xx:xx try 2
wlan0 direct probe responded
wlan0: authenticate with AP 00:02:cf:xx:xx:xx
wlan0: authenticated
wlan0: associate with AP 00:02:cf:xx:xx:xx
wlan0: RX ReassocResp from 00:02:cf:xx:xx:xx (capab=0x431 status=0 aid=4)
wlan0: associated


I've just had a thought. I lost my internet connection for a short time tonight but the sheevaplug didn't seem to manage to connect. My idea would be as follows -- to have a simple counter which adds by one every time the sheeva fails to reconnect, and if it reaches say .... 5 the sheeva is rebooted.

Code:
#!/bin/sh
#
if=wlan0

if [count==5] then
  count=0
  shutdown -r now 

fi
if iwconfig $if | grep -q Not-Associated; then
   : Not associated, so get it to retry
else
  count=0
   exit     # All OK
fi

iwconfig $if | Mail -s 'Wifi lost association on plug' {my-mail-address}
# Force re-association
count=count+1
iwconfig $if ap auto

Not sure if I have it right there or not.

ljones
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #27 on: September 20, 2009, 03:39:55 AM »

Not sure if I have it right there or not.
  • There's no persistence.  You check for count being 5 at the start, but at that point it is still undefined
  • the '[' and ']' for tests are tokens, so need whitespace around them
  • the sh test for a numbers is '-eq'
  • You need a leading $ to refer to a variable's value
  • count=count+1 won't work even if you'd had a $ in there
Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #28 on: September 20, 2009, 04:57:19 AM »

Instead of count=count+1 you'd need a construction more like:

count=`expr $count + 1`

Note the *back* quotes and the use of the expr command (man expr for more).

Rgds

Damon
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #29 on: September 20, 2009, 06:13:04 AM »

doesn't really matter, just a note, so you don't learn bad habbits that bite you if you start to write more shell scripts.

expr will spawn a new process to evaluate. You can do basic maths directly in the running shell process (at least in zsh, bash) and avoid wasting CPU cycles.

Code:
count=$(($count +1))

Logged

Pages: 1 [2] 3
Print
Jump to: