This is a step by step guide on how to configure a Raspberry Pi as I did for a wireless robot controller. Please note – some of the software versions may change over time.
Download/Install Raspbian:
If you already have your Pi installed and set up, skip this section
- Plug your SD card into your computer.
- Format the SD card with software here.
- Download NOOBS (offline and network install) here.
- Unpack the .zip file onto your SD card.
- Plug your SD card into your Pi.
Configure Raspbian
- Set up and power up your Raspberry Pi.
- If you are prompted to log in, use pi as the login, and raspberry as the password.
- Configure your keyboard – the Raspberry Pi keyboard file is located here: /etc/default/keyboard
- Use nano command: nano /etc/default/keyboard
- Change the line
XKBLAYOUT="gb"
to the line
XKBLAYOUT="us"
- Use nano command: nano /etc/default/keyboard
- Use reboot command: reboot
- Once the Pi has rebooted and you have logged in again, remove the login prompt for the Raspberry Pi:
- Change to superuser: sudo su
- Use nano command: nano /etc/inittab
- Comment out this line
1:2345:respawn:/sbin/getty 38400 tty1
by adding a # at the beginning
#1:2345:respawn:/sbin/getty 38400 tty1
- Add this line below
1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1
- Your Pi should be good to go. Test that the changes have worked by rebooting: reboot
Get Wireless Connected
- Plug in your Edimax EW-7811Un Wireless Adapter and reboot your Raspberry Pi: reboot
- Check that the Pi is reading the device: lsusb
- Check that the Pi has the right drivers: lsmod
- Change network interfaces: nano /etc/network/interfaces
-
auto wlan0 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
-
- Add your wireless network to the end of your WPA supplicant: nano /etc/wpa_supplicant/wpa_supplicant.conf
- Reboot your system: reboot
- Check your ip address: ifconfig or ifconfig wlan0
Install Python Tools
- Make sure your Raspberry Pi is connected to the internet.
- Enable easy_install from command line: python ez_setup.py
- Install cherrypy: easy_install cherrypy
- Install RPIO: easy_install -U RPIO
Get Files in Place
- Download raspberry_pi_robot_code onto your Raspberry Pi.
- Unzip and move files:
- robot.py, command.py, and start_robot.py should all be placed on your desktop
- robot_server should be moved to: /etc/init.d/
- Open a terminal.
- Make sure all files are owned by root user. If not: sudo chown root /root/desktop/* and sudo chown root /etc/init.d/robot_server
- Make robot_server executable: sudo chmod 755 /etc/init.d/robot_server
- Register the robot_server file with startup: sudo update-rc.d robot_server defaults
You should be able to reboot: reboot and the robot server should start right up. Open an internet browser on another computer in the local network and go to the Raspberry Pi’s IP address.