RPi GPIO: Adding switches and lights

Goal:

Create a pair of LED’s and push buttons on my RPi which can run scripts. ?One will shut down the Pi (updated here), the other will rsync a directory to a USB. Also I will read the status of a UPS. This may/will become more complicated since the UPS doesn’t have any useful interface (requiring an Arduino to:

  • Watch the UPS battery voltage and tell the RPi to power down.
  • Monitor whether mains power is applied.
  • Once mains is re-powered, restart the RPi after a UPS shut down using the hardware reset pins on the Pi.)
Instructions:
  1. As in these RPi ubuntu instructions I installed python.. I removed sudo from the last command to make the command output happy
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip
pip install RPi.GPIO
  1. Initially I set up a breadboard as in this youtube video (using the linked files)
    from time import sleep
    import RPi.GPIO as GPIO
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(12, GPIO.OUT)
    while 1:
     GPIO.output(12, False)
     sleep(1)
     GPIO.output(12, True)
     sleep(1)

    Continue reading “RPi GPIO: Adding switches and lights”

Install Samba on Ubuntu (on an RPi 2)

Note: The RPi2 with officially supported Ubuntu is proving problematic, I want to move to something more reliable.

After installing Ubuntu on my RPi, I’ll now install Samba. This will allow USB drives attached to the RPi to be accessed by other computers, making the RPi into a NAS device.

  1. Install Samba:
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install samba
  2. Duplicate original samba settings:
    sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old

    Continue reading “Install Samba on Ubuntu (on an RPi 2)”

Installing Ubuntu on a RPi

  1. I will be using  Ubuntu 16.04 LTS ‘classic’.
    On the RPi site they mention Rpi pic
    the Snappy version of Ubuntu for IoT. This is not the one I want, as it doesn’t use the normal Ubuntu method for getting software (apt-get). The classic Ubuntu image is linked here. This image has SSH pre-installed, so you can boot without ever using a monitor.
    Writing the image to an SD card on Windows can be done with Win32 Disk Imager
    Continue reading “Installing Ubuntu on a RPi”

DNScrypt with Ubuntu 14.04 on RPi 2

EDIT: Instructions remade for Ubuntu 16.02

Got this working on a Raspberry Pi 2 by using several sets of instructions… All commands are done on the command line in a terminal instance.

    1. These instructions got the actual software onto my machine. Since there is no build for ubuntu, the code must be compiled on the local machine – starting with the dependent encryption suite ‘libsodium’ first .
      • From the linked instructions “I also recommend installing the build-essential packages in case you’re missing compilers.”
        apt-get install build-essential
      • Download the libsodium to a useable directory, I used /media/libsodium which I created first using
        sudo mkdir /media/libsodium
        cd /media/libsodium

        Continue reading “DNScrypt with Ubuntu 14.04 on RPi 2”

Installing an FTP server on RPi 2 running ubuntu

My RPi 2 is running Ubuntu-trusty from here, and I needed to add an FTP server. The FTP server will host a folder on a ntfs USB drive. Initially I tried vsftpd, but the vsftpd FTP server sucks and I ended up using a different FTP, proftpd. What I did was loosely based around these instructions.

  1. install proftpd from a terminal window:
    sudo apt-get update
    sudo apt-get install proftpd

    (when a window popped up, I (eventually) I installed as a service since the other option requires more stuff I haven’t installed)

  2. Modify config file using nano text editor:
    sudo nano /etc/proftpd/proftpd.conf

    Continue reading “Installing an FTP server on RPi 2 running ubuntu”

Raspberry PI 2 as a NAS device with torrenting

Update: Installing Ubuntu 14.04 is here (Supported through early 2019).
Note: The RPi2 with officially supported Ubuntu is proving problematic, I want to move to something more reliable.

GOAL:

Use a Raspberry PI as a NAS Seed Box (Network Attached Storage running torrent software). RPi 2 is perfect for this due to running at very low electrical low power and being faster than a Fast Ethernet bottleneck. I initially bought a RPi version 1B which I returned as it couldn’t send files over a wired LAN at 10MB per second (basically the bottleneck for Fast Ethernet (100mbps)). Also I can use a thin client for torrenting on my PC with Deluge rather than just a webUI.

Setup:

  • RPi version 2B running Ubuntu (yay linux).
  • USB Drive formatted in NTFS.
  • Install Samba (windows file sharing).
  • Install Deluge torrent software with a web interface (deluge also supports a remote thin client 🙂 ).

Instructions:

Using a HDMI monitor and keyboard:

  1. Install Ubuntu.
    Continue reading “Raspberry PI 2 as a NAS device with torrenting”