Power & Source of Big Ideas

Nanopi does not connect on the internet.

Moderators: chensy, FATechsupport

I am unable to connect my nanopi the Internet, set up the wifi as teaches
the site, but still is not working wifi.

wlan0 Link encap:Ethernet HWaddr 04:e6:76:71:52:8e
inet6 addr: fe80::6e6:76ff:fe71:528e/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:13302 (12.9 KiB)

Results:

root@nanopi:~# arp -a[/b]
? (192.168.100.207) at 36:86:f5:4c:41:48 [ether] on usb0

root@nanopi:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0
usb0


root@nanopi:~# wpa_cli -iwlan0 scan_result
bssid / frequency / signal level / flags / ssid
00:04:df:8e:05:77 2412 -72
[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] JRG1
00:21:91:70:e9:e4 2437 -76 [WEP][ESS] JRG
1c:af:f7:5a:2a:1a 2417 -89 [WPA-PSK-TKIP][ESS] Not Found 404

I own two access points here at home, JRG1 and JRG, the configuration I did
was to access the JRG1 point, but I can not. Does the setting is right?
/etc/network/interfaces.d/wlan0

auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid JRG1
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk xxxxxxxx
Hi please try the following steps:
1. Save your wlan0, exit and reboot your board
2. After reboot your board please try "ifconfig -a" to check your IP and then do "iwconfig" to check if the data is correct
3. Try #ping www.google.com
Results:


root@nanopi:~# ifconfig -a
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:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:76 (76.0 B) TX bytes:76 (76.0 B)

usb0 Link encap:Ethernet HWaddr e2:11:6f:2c:0b:c2
inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::e011:6fff:fe2c:bc2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:498 errors:0 dropped:0 overruns:0 frame:0
TX packets:322 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:45291 (44.2 KiB) TX bytes:40800 (39.8 KiB)

wlan0 Link encap:Ethernet HWaddr 04:e6:76:71:52:8e
inet6 addr: fe80::6e6:76ff:fe71:528e/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3384 (3.3 KiB)

root@nanopi:~# iwconfig
-bash: iwconfig: command not found
root@nanopi:~# ping www.google.com
ping: unknown host www.google.com
2) I had to download iwconfig after I was able to connect to the internet.

iwconfig is more informative
Try the following as it might supply more information:

Go to /var/log and
rm daemon.log
touch daemon.log (just in case a new one is not automatically generated)

reboot

Go back to /var/log and
nano daemon.log

I think you will see some responses from the router which might help.
Trying to connect to another WiFi AP after successfully connecting to the first WiFi AP is still causing me problems.

Most of the examples I find for connecting to multiple WiFi APs use a /etc/wpa_supplicant/wpa_supplicant.conf file rather than the /etc/network/interfaces.d/wlan0 file in the NanoPi Debian Jessie distro. http://forums.debian.net/viewtopic.php?t=27573 seems to suggest that you have to have a wpa_supplicant.conf file somewhere on the system.

I notice that ifconfig -a still shows the previous WiFi AP, so it appears to me that this information is persistent.

Do you need to flush the previous wlan0 configuration so that a new wlan0 file in /etc/network/interfaces.d takes effect? It also seems that after trying 10-20 times to connect to the new router that it will start working.

Could you try connecting to a 2nd WiFi AP after successfully connecting to the 1st WiFi AP?
OK, don't bother trying to log into a 2nd WiFi AP. Even though the router I am currently trying to access says WPA2-PSK it also says that it needs CCMP+TKIP. TKIP is a cipher for WPA.

When I changed:

wpa-pairwise & wpa-group to CCMP TKIP

it now works.

Now, for the bizarre part ... ifconfig says that I am connected to my other wireless router 75kms away!! So, my observation that ifconfig does not seem to reflect the current connection appears valid. Any idea of what could be wrong here?

iwconfig displays the correct router information
Tried another few things:

ip addr flush wlan0

that get rids of the wlan0 entry in ifconfig, however on reboot it reverts to my old inaccessible router.

dhclient -v

says that the NanoPi is bound to my local router.

Where does ifconfig get it's information from for the wlan0 entry?
Well, according to http://ubuntuforums.org/showthread.php?t=2162439this is expected ifconfig behaviour.

Solution is :
ifconfig wlan0 down
ifconfig wlan0 up

I found that the down command was enough to update the ifconfig wlan0 entry and to bring wlan0 up again, but perhaps there is a good reason for doing both.

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 102 on Mon Oct 08, 2018 12:42 pm

Users browsing this forum: No registered users and 1 guest