Connect Raspberry Pi to WiFi and give static IP from command line

First off, let me tell you I am no NOOB to linux, but finding a configuration that worked for me here was a bit time consuming. It looks as though there are numerous ways to go about doing this, and I think I tried about a dozen before I found one that worked with my RPi in my configuration. So I can’t guarantee this will work for you, all I can say is it works for me and it will hopefully help you out too.

 

All I really did was edit /etc/network/interfaces

 

You can let the first few lines I show below be, they have to do with the loopback interface and the wired ethernet port on the RPi.

auto lo

iface lo inet loopback
iface eth0 inet dhcp

After those lines we get into the config for the wireless device. In this case, and probably most, this is named “wlan0”. I changed the “iface” line to say static instead of dhcp, and I commented out the wpa_supplicant line. I was never able to get anything to work using the wpa_supplicant.conf file. Then I added in the lines to tell it what wireless network to connect to and what IP address to use, as well as the rest of the needed network config.

 

auto wlan0

allow-hotplug wlan0

iface wlan0 inet static

        wpa-ssid [your-wifi-name]

        wpa-psk [your-wifi-password]

        address x.x.x.x

        netmask 255.255.255.0

        gateway x.x.x.x

#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Make sure to change the above to use your actual WiFi name and password. Also change the address to what you want your static IP address to be, and change the gateway to the IP address of your router.

Add the “#” to the wpa-roam line to comment it out, or delete that line.

You can then save and close the file. At this point you can reboot or type the following commands to restart the wlan0 interface:

sudo ifdown wlan0

sudo ifup wlan0

You should now have your wifi connection and it should be using the IP address you gave it.

For you security minded people, yes I know I have my wifi password in a plain text file. I’m not that concerned about it because this is just a RPi at my home I have for testing and learning purposes.  If you would like to keep your password more secure look into creating a hash file using wpa_passphrase.

Named: broken trust chain error

While troubleshooting why my DNS server (named on a CentOS box) wasn’t working, I found lots of errors similar to the following in /var/log/messages

 

error (broken trust chain) resolving ‘0.ubuntu.pool.ntp.org/AAAA/IN’: 208.67.220.220#53

 

As it turns out the most common cause of this broken trust chain error is the system time being off too far in either direction. So there are probably numerous ways to fix this, but here are 2 that I use most often.

 

1. Manually set time correctly using “date” command:

The syntax is `date MMDDhhmmYYYY` , so for example to set time to 2/25/2015 12:34pm you would enter: date 022512342015

 

2. You can install NTP (Network Time Protocol) and have it sync your clock automatically:

sudo yum install ntp

chkconfig ntpd on

Windows Installer Service on local computer started and then stopped

This is for WinXP and Server 2003, although it may well work with other versions of Windows as well.

While trying to remove a piece of software I was informed that the Windows Installer service wasn’t running. When I checked on the service, sure enough, it wasn’t. So I tried to start it manually and got the following error message:

“Windows Installer Service on local computer started and then stopped”

 

A reboot did not resolve the issue, so after some Google searching on the error I came across this resolution that worked for me:

 

You may try to reregister Windows Installer and check if the issue reappears. To do this, follow these steps:

a. On the Start > Run box, type “msiexec /unreg”, and then press ENTER.

b. Then type “msiexec /regserver”, and then press ENTER.

Josey pic roundup

This first one is Josey at my office, he is such a good boy, sleeps under my desk for most of the day. 11/26/2014

 

11/26/2014

 

Josey sleeping on his favorite ottoman. 11/30/2014

 

11/30/2014

 

He spends a lot of time snoozing right here. 12/7/2014

 

12/7/2014

 

Hey, hey, I’m right here, hey, hey, throw the ball, hey, hey…. 12/15/2014

 

12/15/2014

 

My buddies little boy playing with Josey, he is so gentle with kids. 1/3/2015

 

1/3/2015

 

This time my buddies girl petting Josey. 1/17/2015

 

1/17/2015

 

Josey has started guard duty. He watches everything that goes on outside. 2/1/2015

 

2/1/2015

 

Josey is now going on 9 months old, he is growing, but not as fast as he was. I’m actually kind of anxious to see how big he gets. 2/12/2015

 

2/12/2015 2/12/2015