MP13
Posts: 5
Joined: Fri Oct 09, 2015 7:03 pm

Unable to access internet but Pi2 has IP address

Fri Oct 09, 2015 7:24 pm

Hi guys

I've had a RPi 2 for a week and I want to use it to feed data to flightradar24.com instead of running a pc 24/7.

I bought a Pi with the SD card pre-loaded with NOOBS and I installed Raspbian as the OS.

It took me ages to work out how to install fr24feed (which is the software) but eventually i got that installed no probs and it was working for about 10 mins so I turned it off to put the Pi in the loft. Since then fr24feed hasnt worked and ive contacted them and they said to check the log file but that doesn't exist?! They replied and said to do a clean install of fr24feed. So i started again and this is where my issue is at.

I entered the command to restart fr24feed however when it checks my feeding key it errors due to not being able to connect to the fr24 server. I must mention that I am using an Edimax Wifi USB adapter and have tried using the Ethernet direct from the router. So there is a problem with the network connection somewhere.

I cannot get access to anything on the browser as it says cannot resolve hostname but my IP address is shown as 192.168.0.48 and never changes (It's not static btw).

It was all working 2 days ago but suddenly doesnt work anymore. All of my other network devices work, the USB Wifi is flashing and when connected, the ethernet lights flash as they should.

When pinging 8.8.8.8 is says the 'destination host is unreachable'; when pinging google.co.uk it says 'unknown host'.

Its really frustrating and I havent done anything software/internally as I dont dare change anything!!

Can someone advise on what to do?

Thanks, Max

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Unable to access internet but Pi2 has IP address

Fri Oct 09, 2015 8:01 pm

- Can we assume that you have other devices on your network that is connected to the same router ?
- Can we assume that they also have ip-adresses in the 192.168.0.x range ?
- Can you ping 192.168.0.48 from other computers in your network ?
- Can you SSH into the Pi from other computer in your network ?

If yes to the last one, can you put the output from the "ifconfig" command here, either with wifi or cable ? ( or both, but not at the same time. )
The output from "sudo route -n" could also be helpful.

MP13
Posts: 5
Joined: Fri Oct 09, 2015 7:03 pm

Re: Unable to access internet but Pi2 has IP address

Fri Oct 09, 2015 8:28 pm

Hi

Q1 - yes, my laptop connects to the same (Sky) router.

Q2 - yes, my laptop is on 192.168.0.7.

Q3 - yes, i have just pinged 192.168.0.48 (Pi) from my laptop; came back with the data below:

C:\Users\Max-Acer>ping 192.168.0.48

Pinging 192.168.0.48 with 32 bytes of data:
Reply from 192.168.0.48: bytes=32 time=840ms TTL=64
Reply from 192.168.0.48: bytes=32 time=8ms TTL=64
Reply from 192.168.0.48: bytes=32 time=6ms TTL=64
Reply from 192.168.0.48: bytes=32 time=7ms TTL=64

Ping statistics for 192.168.0.48:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 840ms, Average = 215ms

Q4 - I could not too long ago; i have been browsing about this problem and changed the line after eth0 and wlan0 from manual to dhcp but that seems to refuse an ssh connection so ill return those as soon as i can.

Thanks

User avatar
lmarmisa
Posts: 1265
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Unable to access internet but Pi2 has IP address

Sat Oct 10, 2015 5:20 pm

Please, type these commands and poste here the results:

Code: Select all

ifconfig
iwconfig
route -n
cat /etc/network/interfaces
cat /etc/resolv.conf
ping -c3 8.8.8.8
ping -c3 google.com

P_Monty
Posts: 57
Joined: Sat Dec 27, 2014 2:45 pm
Location: Wiltshire, UK

Re: Unable to access internet but Pi2 has IP address

Sat Oct 10, 2015 6:58 pm

It sounds as if the network gateway isn't setup properly. However, as a Linux newbie, I don't know how to sort this...

MP13
Posts: 5
Joined: Fri Oct 09, 2015 7:03 pm

Re: Unable to access internet but Pi2 has IP address

Sun Oct 11, 2015 5:02 pm

Hi Imarmisa/all


I entered the commands; here are the results:




ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:df:46:9d
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)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:168360 errors:0 dropped:0 overruns:0 frame:0
TX packets:168360 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14000840 (13.3 MiB) TX bytes:14000840 (13.3 MiB)

wlan0 Link encap:Ethernet HWaddr 00:1f:1f:e4:51:fb
inet addr:192.168.0.48 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:538 errors:0 dropped:127 overruns:0 frame:0
TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80846 (78.9 KiB) TX bytes:12687 (12.3 KiB)



iwconfig
wlan0 IEEE 802.11bgn ESSID:"SKY8E080" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.437 GHz Access Point: 7C:4C:A5:FC:0A:1D
Bit Rate:72.2 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=100/100 Signal level=67/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

lo no wireless extensions.

eth0 no wireless extensions.



route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0




cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf



cat /etc/resolv.conf
# Generated by resolvconf



ping -c3 8.8.8.8
connect: Network is unreachable



ping -c3 google.com
ping: unknown host google.com



Sorry some of them have lost the RPi formatting and bunched up together, let me know what you think...


Max

User avatar
lmarmisa
Posts: 1265
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Unable to access internet but Pi2 has IP address

Sun Oct 11, 2015 5:43 pm

No default route is defined for your RPi. This is the problem. You are able to connect to other computers of your LAN but you have no access to the Internet. Your RPi has no gateway defined for the traffic to the Internet.

This is the output of the command route -n here:

Code: Select all

pi@rpi ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.18.1    0.0.0.0         UG    0      0        0 wlan0
192.168.18.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0
pi@rpi ~ $
The default route is that beginning with 0.0.0.0.

I have a RPi sending ADS-B data to fr24 too. This is the content of its file /etc/network/interfaces:

Code: Select all

pi@rpi ~ $ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp
pi@rpi ~ $
Try to change the interface definition for wlan0 to auto and dhcp. Change the interface eth0 to dhcp too if you wish. Maybe these changes will solve your problem.

MP13
Posts: 5
Joined: Fri Oct 09, 2015 7:03 pm

Re: Unable to access internet but Pi2 has IP address

Sun Oct 11, 2015 7:54 pm

Thanks Imarmisa

How come the route has disappeared? It was working okay then just suddenly stopped?

I will try your suggestions; will it be wise to copy the contents of your /interfaces file to mine?


Thanks, Max

MP13
Posts: 5
Joined: Fri Oct 09, 2015 7:03 pm

Re: Unable to access internet but Pi2 has IP address

Sun Oct 11, 2015 9:30 pm

Imarmisa - your suggestion worked!

Thanks you ever so much; I literally wouldn't have been able to fix it without you!


Max

Return to “Troubleshooting”