This guide will walk through the steps required to setup a development or production environment to develop software for the Cornell Rocketry Team's launch vehicle controller.
- Install programs and dependencies required for running the controller.
- Bind commonly used USB devices to static aliases, and give the current user permission to access tty USB devices.
- Enable the camera and I2C drivers to be loaded by the kernal on startup.
The development setup script is located in the development/setup.sh
directory. The development script will ensure that the system is up to date, install development tools, and clone full git repos of all development dependencies.
The production setup script is located in the production/setup.sh
directory.
The setup script sets up the environment for the currently logged in user.
git clone https://github.com/CURocketry/RaspberryPiSetup
cd development
./setup.sh
Note that some components of the script require root permissions to execute.
Run sudo raspi-config
to adjust advanced system parameters.
Most development will be conducted remotely without access to a monitor or keyboard. Connecting directly to a laptop might be somewhat finicky, but there are two tested ways to connect. These instructions were tested using Windows 10, and may vary between operating systems.
Internet sharing is required if you want to share an internet connection through your laptop. To enable:
- Go to the Network and Sharing Center -> Change Adapter Settings.
- Right click on the connection you want to share. In this case, it'll probably be Wi-Fi. Right click on Wi-Fi -> properties.
- Go to the "Sharing" tab. Check "Allow other network users to connect through this computer's internet connection." Select "Ethernet" for the "Home networking connection" option.
- A prompt may pop up asking to assign a fixed IP to the Ethernet adapter. Click yes. If that prompt does not show up, that's okay. We'll make sure the settings are correct in the next step.
- Go back to the adapter settings, and right click on Ethernet -> properties. Under the "This connection uses the following items:" heading, look for IPv4, and double click on it.
- Under the window that shows up, make sure that "Use the following IP addresses: is selected, and a reasonable IP on a different subnet is selected. The default is
192.168.137.1
if you shared with the wifi adapter. Also make sure that "Use the following DNS server addresses:" is selected and input8.8.8.8
. Save your settings. - Note that it may require you to disconnect from your current network and reconnect, or to restart your computer for the changes to take effect.
- Ensure that the Ethernet adapter has a fixed IP by following steps 5-7 in the Internet Sharing section.
- Connect the Raspberry Pi to your ethernet port.
- Open up command prompt, and type in
arp -a
. Look for the fixed IP you previously assigned to your ethernet adapter belonging to one of the "Interface" headings. - One of the ip addresses under the
192.168.137.*
subnet will belong to the Raspberry pi if you gave your ethernet adapter an IP address of192.168.137.1
. If you know the MAC address of your raspberry pi, look for it under the Physical address heading. Try connecting using putty or ssh.
Note that these addresses are dynamically allocated and may change each time you reconnect the Raspberry pi.
Using a DHCP server allows the laptop to assign an IP address to the Raspberry pi.
- Download the DHCP Server for Windows, and unzip it.
- Run
dhcpwiz.exe
. Select Ethernet under the "Network Interfaces dialog." If the corresponding ip address reads0.0.0.0
, stop and follow steps 5-7 in the Internet Sharing section. After ensuring that the Ethernet adapter has a fixes IP address, click next. - In the "Supported Protocols" dialog, check HTTP and DNS. Set
8.8.8.8
as the "Forwarding Address". Click next. - Keep the default settings under the "Configuring DHCP for interface dialog." Click next.
- On the "Write INI" dialog, click on the "Write INI file" button. Click next.
- On the final window, make sure that firewall rules are configured. Check "Run DHCP server immediately" and finish.
Anytime that the DHCP server is running, visit localhost
in a web browser to view all assigned IP addresses.
-
On the Raspberry Pi, edit
/etc/resolv.conf
. Try adding the following lines if they are not already there:nameserver 8.8.8.8 nameserver <ethernet_adapter_ip>
Where <ethernet_adapter_ip>
is the fixed ip given to your ethernet adapter on the host machine.
- Use vagrant for seamless setup.