Introduction: Deploy Your Pi

About: One of my hobbies is taking stuff apart and seeing how I can customize it.

Have you ever found yourself wanting to deploy your Pi in a location without internet? Maybe you want to make a wildlife camera, or garden monitor. But how will you be able to fix bugs and put new software on your Pi?

Or do you not feel like shelling out more money for a Monitor that has HDMI support?

In this instructable I am going to show you the tools you need and how to use them. At the end you will be able to install new packages on a Pi without internet connection. You will also be able to work with the Pi without having to buy a screen. You won't be able to both though, unless you have a router where the pi is.

This project was inspired by www.instructables.com/id/Setting-up-a-VNC-Server-on-your-Raspberry-Pi/. I wanted to make it possible to VNC without access to a screen at all.

Materials

  1. Laptop
  2. USB Flash Drive

Are you ready? Lets get started!

Step 1: Installing Programs Without Internet

This step is assuming you have a way to connect to your Pi that is deployed.

To install programs without internet you can follow these very simple steps. On your deployed Pi enter the command:

 apt-get --print-uris --yes install PackageName > packageuri.htm

This will list the URL links of every dependency you need for the package PackageName, and place them in a file called packageuri.htm. You can then move the file to your jump drive and go to a place where there is internet access. Here you can copy and paste the links into the address box and download them to your flash drive.

Now go back to your deployed pi and move them to the /var/cache/apt/archives/partial directory. This is an important step. I haven't been able to get it to work unless you do this. Now, you are almost through. This next step is a little tricky.

Change your directory to the partial folder with the command "cd /var/cache/apt/archives/partial". Now enter the command "ls" to see the files. You must install each of these with the command "sudo dpkg -i file.deb" where file.deb is the name of the dependency. Sounds easy, but you have to do it in a specific order. If you do the wrong ones first it will say something to the effect of, "you are trying to install x but x depends on y and z". That will tell you to install y.deb and z.deb first. They will be in that same folder. To determine what to install first, go for the ones that start with lib, those usually won't need other dependencies to be installed first.

Since Ubuntu is Debian based, like Raspbian, it has a lot of the same commands. So I found a great page about this here if you want more information.

Step 2: SSH

Now for the second part of my instructable. For Pi's that are going to be deployed and thus you don't feel like paying for a screen you can use your laptop or desktop computer to connect to a terminal on your Raspberry Pi. This will enable you to program it and set it up without the need for a connected screen. First, you will need to download some free programs:

Windows Users

Putty - A program that allows you to connect via SSH

IP Scanner - Used to find the IP address of your Pi

Linux Users

All you need is to install the nmap IP scanner with the command "sudo apt-get install nmap"

How to Get it Working

First connect an internet cord from your pi to your router, and another one from the computer you will be using to your router. Boot up the pi. Wait a minute or two for it to finish booting.

Use your scanner and search your network for an IP with a line about the Raspberry Pi Foundation. With the program in windows just use the default by clicking search. For nmap enter the command: sudo nmap -sn 192.168.0.0/24. This will search your network. Take note of the IP.

Now launch Putty if you are using a Windows OS. Then enter "pi@ipaddr" where "ipaddr" is the ip address you wrote down. You will be prompted as to whether you trust the computer you are connecting to. Enter "yes". Now type in your password in the prompt that follows. That will be"raspberry" if this is a fresh install.

For Linux based users just enter "ssh pi@ipaddr", where "ipaddr" is the ip address you wrote down, into the terminal and follow the steps above.

Congratulations on successfully accessing your pi without a screen!

Step 3: VNC

Someone might say, "Well, thats nice but I prefer a GUI because I am not comfortable with the command line. Is that possible?". The answer is "Yes!!". There is a Program called VNC(Virtual Network Computing) that will help us. But assuming that you don't have a screen, first you must set up SSH. So if you skipped that step, please go back and complete it. It won't take long!

First, we will need to install the tightvncserver on our pi. Run "sudo apt-get install tightvncserver"on your pi. Once that is installed, go to the computer you will be using to access your pi. Now download the tightvncviewer from here. Or from a linux computer, sudo apt-get install xtightvncviewer. Now, assuming you left your pi just how it was from the last step, run the program from your computer and enter the ip address you marked down from the last step. Enter your password....and there you go. You will be greeted by the familiar Raspbian Desktop.

Step 4: Happy Hacking!

Now you can install files on your pi without direct internet access! You can access the pi without a screen! And you don't need to enter a terminal with the help of VNC.

I hope you enjoyed it! If you did please vote for me in the Raspberry Pi contest and happy hacking!

Raspberry Pi Contest

Participated in the
Raspberry Pi Contest