Posted: September 4, 2014
This is my setup log for my second Raspberry Pi. It is a little older, but I think some might find the walk through useful. This could be used to create a robot that is easy to program and control remotely via VNC and SSH. This is more of a "log" of my work than instructions, so a lot of it is cut and paste from the sources listed. Please let me know if you run into questions or problems and I will make updates.
My goal with this one is to set it up to work over WiFi
GUI available via VNC
and run the Propeller SimpleIDE to control the Propeller board
Getting started:
Following Propeller's instructions:
http://learn.parallax.com/propeller-c-set-simpleide/raspberrypi
(The following is cut and pasted from the above site, it is NOT my work!)
Install th?e Operating System
For the best experience, use the New Out Of Box Software (NOOBS) to install the operating system image. There are many Linux distributions for Raspberry Pi, but NOOBS makes it easy to try them all from a single SD image.
Keep default settings but set GUI desktop to start automatically. At the end of the first reboot, the Raspberry Pi Software Configuration Tool will appear. All the defaults are fine, except we recommend setting the GUI desktop to automatically start up after boot.
(The preceding section was cut and pasted from the above site, it is NOT my work!)
Set up VNC so I can connect remotely and ditch the keyboard/mouse:
http://xmodulo.com/2013/12/remote-control-raspberry-pi.html
(The following is cut and pasted from the above site, it is NOT my work!)
Another way to access the entire Raspberry Pi desktop remotely is to install VNC server on Rasberry Pi. Then access the desktop remotely via VNC viewer. Follow instructions below to install VNC server on your Raspberry Pi.
$ sudo apt-get install tightvncserver
After the VNC server is installed, run this command to start the server.
$ vncserver :1
This command will start VNC server for display number 1, and will ask for a VNC password. Enter a password (of up to 8 characters). If you are asked to enter a "view-only" password, just answer it no ('n'). The VNC server will make a configuration file in the current user's home directory. After that, kill the VNC server process with this command.
$ vncserver -kill :1
Next, create a new init.d script for VNC (e.g., /etc/init.d/vncserver), which will auto-start the VNC server upon boot.
Now is a good time to see if you can SSH into the Pi, so you can paste this script in! :)
$ sudo vi /etc/init.d/vncserver
#! /bin/sh
export USER='pi'
eval cd ~$USER
case "$1" in
start)
su -c 'vncserver :1 -geometry 1024x768' $USER
echo "Starting vnc server for $USER";;
stop)
pkill xtightvnc
echo "vnc server stopped";;
\*)
echo "usage /etc/init.d/vncserver (start|stop)"
exit 1 ;;
esac
exit 0
Modify the file permission so it can be executed.
$ sudo chmod 755 /etc/init.d/vncserver
Run the following command to install the init.d script with default run-level.
$ sudo update-rc.d vncserver defaults
Reboot your Raspberry Pi to verify that VNC server auto-starts successfully.
To connect via VNC Use <IP Address>:1
, i.e.:
192.168.1.120:1
(The preceding section was cut and pasted from the above site, it is NOT my work!)
Set up the WiFi card:
Shut down the Pi and unplug it. (If you plug anything into the USB port while it is running you will cause it to reset because of the power surge.
sudo shutdown -h now
Now that you are in via VNC & SSH, unplug the keyboard and plug the WiFi Dongle in its place.
"WiFi Config" is right on the desktop. Run it and set up the WiFi, it is pretty easy.
Get the WiFi IP and test VNC and SSH on it.
Now this will not survive a reboot, so carry on to make it autostart:
http://xmodulo.com/2013/12/remote-control-raspberry-pi.html
sudo vi /etc/network/interfaces
Most of the required stuff was put in there by the GUI app, but not all,
Add:
auto wlan0
So that it looks like:
pi@raspberrypi ~ $ cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa\_supplicant/wpa\_supplicant.conf
iface default inet dhcp
Now reboot to see if it comes up on boot!
sudo shutdown -r now
Test VNC & SSH, and then unplug the keyboard and Ethernet and reboot again to see if we can work "cordless" (we still need power, but this is the idea anyway).
NOTE: To reduce VNC traffic you may want to right click on the CPU monitor and remove it.
You can do the same for the clock, now the screen should be static when nothing is happening, greatly reducing network traffic and WiFi dongle load on the power (battery?), not to mention the CPU load.
You can also set your TightVNC session to 256 color from the client end to reduce traffic some.
NOTE: If you disconnect abruptly, it does appear to keep your session open in the background.
Set up SimpleIDE and program Propeller from Pi:
http://learn.parallax.com/propeller-c-set-simpleide/raspberrypi
(The following is cut and pasted from the above site, it is NOT my work!)
Install SimpleIDE?
(The preceding section was cut and pasted from the above site, it is NOT my work!)
NOTE: If you get "Cannot load empty board type" you probably have a dialogue box that popped up asking about file locations that you did not click "OK" on yet.
Set to Text boot:
As it is now, the Raspberry starts the XWindows GUI on the HDMI interface by default.
This uses a lot of memory, and if you are ONLY using it remotely it is a waste, so do this to make it boot to Text only:
sudo raspi-config
Select "3 Enable Boot to Desktop/Scratch"
Select "Console Text console"
Use right arrow to select ""Reboot: Yes
Now it should boot with a text only prompt, but you can still use VNC to get a GUI!
This seems to make everything a LOT peppier!
Remember you can grab files from your desktop with FTP/SFTP. ;)
Install SFTP Client on Pi:
sudo apt-get install filezilla
When it is done there should be a Filezilla icon under Internet in the menu.
Shutdown:
sudo halt -h
or
sudo shutdown -h now
Then wait, the WiFi dongle blue light will go off, and all lights except for power will eventually quit.
The ACT (green) LED will blink ten times when the Pi is full shut down. Then you can safely unplug it!