Hello,
I found no proper how-to on internet to setup a static IP on my raspberry pi using wifi (wlan0).
Today I just lost control of it… and won’t be able to fix it until I physically reach there… in two weeks!
how do you do it?
thanks
Hello,
I found no proper how-to on internet to setup a static IP on my raspberry pi using wifi (wlan0).
Today I just lost control of it… and won’t be able to fix it until I physically reach there… in two weeks!
how do you do it?
thanks
Easiest way I did was to ignore static addressing on the Pi. Instead, if your router supports it, is to configure a static address reservation on the router. Mine (TP-Link Archer C7) was found under a DHCP tab, under Address Reservation. You’ll need to know the MAC address of the Pi, which you can associate with a static address. I assigned two static addresses, one for the ETH0 port MAC and the other for the WLAN0 port MAC. Boot the router, boot the Pi.
If you can view the DHCP Lease table in your internet router you will be able to see what IP it is using and reconnect to it with the new IP…
The router I use does not allow that. I know it save life, i did that in another location.
I lost it all, it does not connect to flightaware no more.
Here is /etc/network/interfaces . You will need to modify to fit your network. You will need to create the WiFi password via md5 and the SSID will need to by typed exactly.
auto lo
iface lo inet loopback
iface eth0 inet dhcp
# For Direct Ethernet Connection
#address 192.168.1.66
#netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
#gateway 192.168.1.1
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
wpa-scan-ssid 1
wpa-ap-scan 1
wpa-key-mgmt WPA-PSK
wpa-proto RSN WPA
wpa-pairwise CCMP TKIP
wpa-group CCMP TKIP
wpa-ssid "Network Name Here"
wpa-psk "854875847fgh980909jlkjkja1e76575c4c21113454465"
address 192.168.1.66
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
And please note what I have disabled. I don’t use wpa_supplicant, as it’s buggy.
thanks!
I keep you post, trying two weeks from now
well, I did that and somehow it crashed my pi: I had to apply new image.
I manage to set a static IP from the GUI connecting my PI to a monitor for a while: but I had network performance issue.
I stopped that.
I finally find a way to set mac address to a static IP at router level.
But now the PI ‘crash’ or network get lost on reboot or after few hours of connection.
today what deceit me is that this guideline from flightaware explaining how to sustain wifi network make me systematically lost control of the Pi as it does not reconnect to network at all:
flightaware.com/adsb/piaware/build/optional
I have few days left at my parents home to fix that, otherwise I will have to remove the antenna as it is now becoming unreliable for me (3200 planes + 530 000 positions per day).
BTW what is the status of the new piaware image that was suppose to come out for April?
-Regis
Did you disable the power saving for the wifi adapter? How was it crashing? A network configuration error shouldn’t crash a system. It just wouldn’t be able to connect.
where can i check any log?
Just an update. The configuration I posted above only works for Wheezy and older. The people developing Jessie decided to change everything about network configuration. I don’t understand why, as it’s been the same way for decades and has been working just great.
Here is a link for configuring Jessie: http://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip
In some circles that is reason enough. “If it ain’t broke, fix it til it is”.
thanks indeed,
I had some trouble to set that up in rpi but finally scroll down the router config page to see that I can set mac address to static IP.
You do realise that the wpa-* options configure wpa_supplicant, right?
It should have said, “I had issues with wpa_supplicant.conf”. But now none of that matters with the revamped configuration on Jessie.
The wpa-* options end up being equivalent to having a wpa_supplicant.conf, AFAIK. (They use wpa_cli, though, so I guess it could in theory behave differently)
FWIW this is how my jessie-based images currently look; it’s been reliable so far:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
metric 1
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wireless-power off
wpa-roam /etc/wpa_supplicant/wpa-roam.conf
iface wireless inet dhcp
metric 2
network={
ssid="..."
id_str="wireless"
psk="..."
}
(ifplugd configured to manage eth0 only)
On Jessie, I had a hell of a time setting everything up. I assumed Wheezy configs could be copied and pasted in. Oops, you can’t!
In /etc/dhcpcd.conf
adding for static IP:
interface wlan0
static ip_address=192.168.1.x/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
static domain_name_servers=8.8.4.4
The jessie config I posted above is essentially the same as what I used on wheezy, so I’m not sure what the problem you ran into was.
dhcpcd only starts with a global config if you have no explicitly dhcp-configured interfaces in /etc/network/interfaces, iirc.
(I do not have dhcpcd installed on my image)
Exactly. They now explicitly want you to avoid touching /etc/net/interfaces. And it wasn’t clear at first because they didn’t broadcast this information loud enough to outshine all the existing information on configuring. These changes seem to follow the theme like having the GUI start by default. Dumbing it down, I guess.
To go back to the way is used to be, you have to uninstall junk and revert configs to the older way.