OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › From where to begin ? › Re: Re: From where to begin ?
rederikus
Well done. From looking at your pic, it works. If you want to set up your WiFi and to use a fixed IP address (most useful ‘cuz that way it will always stay the same) try this.
You need to change two files on your system, /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf. Edit both files to match the samples from my working system. Obviously you will need to insert your IP address into interfaces and the name (ssid) of your wireless system and its encryption type (WPA, etc.) and your wireless key or password in wpa_supplicant.conf.
You can use a number of text editors to edit your files. There is vi, nano or pico. I use pico. To edit a file type sudo pico /path/filename.ext So to edit interfaces, type
sudo pico /etc/network/interfaces. You need to command sudo (Super User Do) to allow you to edit and save system files.
/etc/network/interfaces [/color
#File /etc/network/interfaces
# This file will setup your wireless network (wlan0) to have a fixed IP address
#
auto lo
iface lo inet loopback
# If you wish a fixd IP on your wired LAN (eth0) replace wlan0 with eth0 and vice versa in the line below
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
# Put your network (IP-address etc.) here
# If you wish a fixd IP on your wired LAN (eth0) replace wla0 with eth0 and vice versa in the line below
iface wlan0 inet static
address 192.168.1.50
netmask 255.255.255.0
gateway 192.168.1.1
# The file wpa_supplicant.conf defines your wireless network login parameters and will not be needed if you are using eth0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
#File: /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="your_wireless_network_name"
scan_ssid=1
psk="your_wireless_network_key_or_password"
# key_mgnt is the type of wireless encryption mine is WPA_PSK
key_mgmt=WPA-PSK
id_str="home"
priority=15
}
I hope this helps.