LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-17-2014, 12:38 PM   #1
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Rep: Reputation: 47
Raspberry Pi wifi flaky


I'm having wifi issues with my new Raspberry Pi model B running Raspbian Wheezy with an edimax wifi usb adapter...but only away from my house. The wifi works fine in my house. When not in my house I can still connect with ssh but a simple ping gives of www.google.com gives this:

ping: unknown host www.google.com

I have static routing setup in /etc/network/interfaces:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet static

address 192.168.1.20
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

wpa-ssid "network"
wpa-psk "password"


***************************

This is really strange-does anybody have any idea how I could use an internet enabled wifi device outside my house?
 
Old 07-17-2014, 02:00 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
Blog Entries: 13

Rep: Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947
You should use DHCP on other networks. It's also possible that even at home you have DHCP addressing from your router, but you can configure manually for an address and get away with using the network so long as you're authenticated by the router and you've matched the addressing scheme for your network. Simply put though, don't assume everyone uses 192.168.1.x networks in their public WIFI; most of the public networks will want you to DHCP for your address.
 
Old 07-17-2014, 02:12 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,256

Rep: Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117
At first glance I thought the same thing but you can also infer from the information given that the OP is connecting via ssh to the Pi from a computer outside the home network and then trying to ping google. This would not be a Pi wireless problem.

So the OP needs to clarify a bit as to what they are trying to accomplish.
 
Old 07-17-2014, 02:34 PM   #4
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
what's OP? I'm running my Raspberry Pi headless with ssh enabled, so if I use DHCP then how would I find the IP address being used? I connect to it using ssh on an android app. I tried all kinds of other android apps that would tell me what port it's using with nothing. Maybe it just isn't getting an IP address with DHCP. How should I change my /etc/network/interfaces file to use DHCP?
 
Old 07-17-2014, 02:38 PM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by linuxhippy View Post
what's OP?
Forum Shorthand for "Original Poster",.. in this case referring to you, LinuxHippy.
 
Old 07-17-2014, 02:42 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,256

Rep: Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117
What's OP? you i.e. Original Poster or Original Post depending on context.

So you can ssh from your Android device to the Pi successfully? And what is the ultimate goal?
 
Old 07-17-2014, 03:01 PM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
Blog Entries: 13

Rep: Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947
The following will make it so that your WIFI interface performs DHCP.

Change your iface wlan0 line to match your eth0 line:

Code:
iface wlan0 inet dhcp
And comment out all of: address, netmask, network, broadcast, and gateway using # before all of them.

Last edited by rtmistler; 07-17-2014 at 03:02 PM.
 
Old 07-17-2014, 03:08 PM   #8
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
ok, that'll give me dhcp...then how do I find the IP address since I won't have it connected to a monitor and keyboard? Maybe running some Android app that can sniff out what addresses the router has given? The firmware on the router I'm using outside my house stinks and unlike ddwrt doesn't tell u which devices have which address.
 
Old 07-17-2014, 03:13 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
Blog Entries: 13

Rep: Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947
Quote:
Originally Posted by linuxhippy View Post
ok, that'll give me dhcp...then how do I find the IP address since I won't have it connected to a monitor and keyboard? Maybe running some Android app that can sniff out what addresses the router has given? The firmware on the router I'm using outside my house stinks and unlike ddwrt doesn't tell u which devices have which address.
You said you were ssh'ing to it. ... OK I get you there. Well I was gonna say SSH to it (D'uh!!) and then run 'ifconfig'.

Raspberry Pi. ... See Beaglebone supports a network over USB therefore the primary Ethernet or WIFI may be something else, and the USB network is always there and always a certain address; therefore I can reach the BBB that way.

But wait a minute. Pi has a wired Ethernet port. Set that up for a static IP, a'la the way you had the WIFI set up and then hook a cable between a laptop and the Pi with the laptop set for the address, and then you should be able to find the address. But you say you have a tablet, not a laptop. Interesting issue, well you can hook up a monitor, keyboard, and mouse to that Pi...
 
Old 07-17-2014, 03:18 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
On my home network I could use the ping network scanner (ping sweep, basically) "app" on my iPad to find my Pi as the "app" does detect it as a Pi. I'm sure there's something similar avaliable for Android.
If you have access to the router then I suggest you tell it to set a reserved DHCP address for your Pi so that when it connects it always gets the same IP address.
 
Old 07-17-2014, 03:20 PM   #11
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
I'd have to get a portable usb keyboard, but I could hook a cable into my Android TV which runs Linaro and has a usb ethernet adapter...what kind of cable would I need to ssh between the two? Just a cat5 ethernet cable?
 
Old 07-17-2014, 03:24 PM   #12
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
Blog Entries: 13

Rep: Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947
Quote:
Originally Posted by linuxhippy View Post
I'd have to get a portable usb keyboard, but I could hook a cable into my Android TV which runs Linaro and has a usb ethernet adapter...what kind of cable would I need to ssh between the two? Just a cat5 ethernet cable?
Yes normal CAT5 Ethernet cable will work fine.
 
Old 07-17-2014, 03:33 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,256

Rep: Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117
I think I understand the problem.

If you configure a static IP on the Pi but do not add any namesevers in /etc/resolv.conf you will not be able ping via URL i.e google.com. Now you could configure the Pi with DHCP and a with router DHCP reservation it will technically be static and resolv.conf will be automatically configured.
 
Old 07-17-2014, 03:37 PM   #14
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
I'll try that tomorrow (I have to get the cable from my house). This isn't a public wifi spot that I'm accessing but my second router that I have...it's a Clear spot. I can use a web browser to get into the router, though there aren't many things that can change. I haven't looked in this one for a while but I don't remember it having a place to adjust your dhcp lease time. Once your dhcp lease expires, would a router just give a different address or does it keep giving out the same one? How long is a typical lease...30 days?
 
Old 07-17-2014, 03:39 PM   #15
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,899
Blog Entries: 13

Rep: Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947Reputation: 4947
Quote:
Originally Posted by linuxhippy View Post
I'll try that tomorrow (I have to get the cable from my house). This isn't a public wifi spot that I'm accessing but my second router that I have...it's a Clear spot. I can use a web browser to get into the router, though there aren't many things that can change. I haven't looked in this one for a while but I don't remember it having a place to adjust your dhcp lease time. Once your dhcp lease expires, would a router just give a different address or does it keep giving out the same one? How long is a typical lease...30 days?
If it's your router and you can get to the web management portal, then you should be able to see the IP address it assigned to your Pi as part of the statistics for connected clients.

A typical lease time is (I thought) 24 hours. I believe also that if it expires, the two entities, being your computer and the router will renegotiate or renew the lease; in fact you'll find that if you attach daily, likely you'll obtain the same IP address each time you attach, especially in an environment that doesn't change much like your personal network. I see that at home with given laptops, they always get the same address. You just can't "depend" on that as an absolute.

Last edited by rtmistler; 07-17-2014 at 03:42 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Wifi network on wifi - raspberry pi business_kid Debian 1 06-01-2014 02:11 PM
Raspberry Pi - Wifi & Monitor Mode Not Working SirSlappy Linux - Embedded & Single-board computer 1 05-24-2014 06:45 AM
LXer: How to set up Raspberry Pi as a WiFi access point LXer Syndicated Linux News 0 04-01-2014 12:01 PM
Raspberry Pi Model B Wifi -> No DHCPOFFERS received Raspberry Linux - Networking 9 01-03-2014 11:14 AM
Flaky wifi on Thinkpad T42, Ubuntu hardy mrloaf Linux - Wireless Networking 4 06-30-2008 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration