How to connect to a Raspberry Pi

Here are the techniques I've used successfully for connecting from my Windows computer to my Raspberry Pi 3 running Raspbian. I experimented with a few techniques because at first I didn't have a WiFi modem, and the modem I did have had only one Ethernet port. After that I got a WiFi modem.

IMPORTANT: Normally you'd turn off your Raspberry Pi by using the shutdown command from a command line or use an option in a graphical user intereface. But we're still just trying to connect to the Pi at this point. If you have problems, don't remove power if it's been on for only a few seconds since there may be data waiting to be written to the SD card. Wait a minute or so before turning it off or watch the SD card indicator light to see when it's been quiet before removing power.

The three possibilities are the following ones and the steps for doing each one is detailed below.

Using an Ethernet cable between Raspberry Pi and the computer.

Using an Ethernet cable between the Raspberry Pi and the computer. This is a direct connection.

Using an Ethernet cable between the Raspberry Pi and the modem.

Using an Ethernet cable between the Raspberry Pi and the modem. The computer either does the same or uses WiFi.

Connecting wirelessly to the Raspberry Pi.

Connecting wirelessly to the Raspberry Pi. The computer either does the same or uses an Ethernet connection to the modem.

Keeping the network connection up when it keeps dropping

However, the Raspberry Pi seemed to be losing the connection after only a minute or so. It turned out that it was configured with power management turned on and something to do with this was causing the problem, though I don't know what specificially. I searched quite a bit for a solution and tried a few things and turning off the power management feature was the best I could come up with. Since I use the Raspberry Pi as an embedded computer that's supposed to be always on, this was a resonable solution for me.

1. On the Raspberry Pi, go to /etc/network. Since I was doing this from a command line terminal, I did:

Go to /etc/network.
Go to the /etc/network directory.

2. Edit the file that you'll find there called interfaces. To do that I first used the "ls" command to verify that it was there and then I used the editor called nano as follows:

Edit the "interfaces" file.
Edit the

3. In the interfaces file, add a line containing "wireless-power off". The line can go anywhere. Notice that I added a comment too so that I'll know what it is if I ever edit the file again.

Adding "wireless-power off".
Adding

4. Save the file by pressing Ctrl-O and exit the editor by pressing Ctrl-X.

5. Restart the Pi. Make sure to use the shutdown command first to give the editor and anything else time to write to the SD card.

Once the Pi was back up I verify that it worked by entering "iwconfig wlan0" from the command line. It gave a bunch of information, including a line saying that power management is off. I no longer lost the network connection.

Verifying that power managment is off.
Verifying that power managment is off.
rimstar.org
Contact:
Liked this? Share it with: