Raspberry Pi with Python Cheat Sheet

Resources and code fragments to help you get started coding the Raspberry Pi with Python.

This is a work in progress....

Setting up PuTTY

By Macindroid

  1. Download PuTTY on the computer of your choice.

  2. Download an IP Scanner on your device and search for you pi, note the ip address.

  3. Open PuTTY and enter the IP address of your pi, select SSH and press enter.

  4. In the terminal the opens up enter “pi” as your username and the password you have selected (default is “raspberry”)

Setting up VNC:

By Macindroid

  1. Open up PuTTY and log on

  2. In the terminal, type sudo apt-get install tightvncserver

  3. When asked do you want to continue enter y

  4. Next type sudo apt-get install xrdp into the terminal

  5. In the terminal, type cd /home/pi/.config/autorun followed by sudo nano tightvnc.desktop

  6. In the text editor that opens type:
    [Desktop Entry]
    Type=Application
    Name=TightVNC
    Exec=vncserver:1
    StartupNotify=false
  7. Type ctrl+O and ctrl+X

  8. In the terminal type sudo reboot

Accessing Desktop

By Macindroid

Open Remote Desktop Connection on your device (Windows only) enter the IP of the raspberry pi connect and you are ready to go. If you are using a mac you need to download VNC Viewer then enter the IP of the raspberry pi and you are done.


Connecting to Raspberry Pi via SSH for MacOS users

By Harry Jupp

Unlike a windows computer, the unix core of MacOS allows for a native command line interface called Terminal.

  1. When setting up the pi with a display, navigate to configuration and turn SSH on
  2. Press F4/FN+F4 to bring up Launchpad and open the folder called other, terminal will be in there.
  3. Download Angry IP scanner from http://angryip.org/download/#mac and install it
  4. Run Angry IP and sort by hostname once it has finished searching, the one named raspberrypi is the ip address you need to note down
  5. Open terminal and enter ssh pi@<IP> (replace <IP> with the ip address from step 3)
  6. Type yes when the warning appears
  7. If your Pi is on default settings, enter raspberry when prompted for a password.
  8. Otherwise enter the SSH password for your Pi

Using Filezilla to transfer files between computer and Pi when using SSH

By Harry Jupp

  1. Download filezilla client from https://filezilla-project.org/
  2. Once initialised, go to file, then site manager
  3. In site manager enter the IP into Host, SFTP into protocol, normal into logon, pi into username and raspberry into password then click connect
  4. To transfer files drag from one side to the other which will automatically transfer the file from the Pi to the Computer or vice versa

Updating the software on the Pi to Jessie with Pixel

By Harry Jupp

  1. Open terminal on pi or over SSH, the commands are the same
  2. sudo apt-get upgrade
  3. sudo apt-get dist-upgrade
  4. This will update the OS but won’t give you all of Pixel
  5. sudo apt-get install -y rpi-chromium- mods
  6. sudo apt-get install -y python-sense- emu python3-sense- emu
  7. sudo apt-get install -y python-sense- emu-doc realvnc-vnc- viewer
  8. sudo apt-get install -y realvnc-vnc- server
  9. After all of this is done then your OS will have all the benefits of Jessie with Pixel

Setting up VNC on the Pi – Rasberrian Jessie with Pixel

By Harry Jupp

  1. In the configuration menu, turn on VNC connection
  2. Unlike Jessie, VNC server is set up when Jessie with Pixel is installed

Connecting to the Pi via VNC

By Harry Jupp

  1. Download Angry IP scanner from http://angryip.org/download/#mac and install it
  2. Run Angry IP and sort by hostname once it has finished searching, the one named raspberrypi is the ip address you need to note down
  3. Download VNC viewer from https://www.realvnc.com/download/viewer/macosx/
  4. Once installed open VNC viewer and create a new connection, enter the IP from step 2 into VNC server
  5. Upon launch, click yes at the warning and then enter pi into username and raspberry into password when prompted

Toggle menu