Redesign the Process for Installing a Capture Station; convert CWRU to the New Design

[SOLVED by Steen &Turner 2016-07-17]
This new design is based on a Raspberry Pi 3B, an HDhomerun connect, and a Seagate Expansion 8TB disk with USB hub. UPDATE 2016-10-03: An externally-powered 1TB external disk would be quite adequate, but it may be difficult to find a hard disk smaller than 5TB that is externally-powered.

Related scrolls and resources


UPDATE 2016-10-02: 
  1. If frozen out of ssh on a RPi, attach a display and keyboard, boot, see the GUI, type Ctrl-Alt-F1 to move to the command line on the second tty, and log in with any user.  This works even if the home directory for the user is not available.  The system creates a temporary home directory.
  2. It is useful to have a root user with a password, because root is in /root, not in /home.
  3. Oddly, Red Hen is unable to boot into safe mode using only keyboard combinations. Websites report that safe mode is possible if two RPi pins are connected, but Red Hen has not tried that.

A list of what has already been done to a microSD card (or its image) before you receive it from Red Hen

  1. Format a new 32GB microSD card. Install on it the latest debian linux release for Raspberry Pi. 
  2. Eject and remove the microSD card and insert it into the RPi. For the sake of this tutorial, let's call your RPi "redX." 
  3. 2016-01-07: UPDATE about ssh: As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. This is done using raspi-config: Enter sudo raspi-config in the terminal, first select Interfacing options, then navigate to ssh, press Enter and select Enable or disable ssh serverFor headless setup, SSH can be enabled by placing a file named 'ssh', without any extension, onto the boot partition of the SD card.
  4. You will use a computer with a terminal app to connect to the RPi.  For this tutorial, let's call that computer "Mithras." 
  5. Connect Mithras to the Rpi redX with an ethernet cable.  Connect electrical power to redX. RedX will now be on your local network. Try to find the RPi's IP address on the local network.  Tools include 
    1. PiFinder (which will provide the IP address and the MAC address)
    2. Issuing the command arp -a from Mithras
    3. Issuing netstat-n from Mithras
    4. etc. . . . . 
    5. Let's suppose the IP address is 10.0.1.16
  6. From the terminal on Mithras, log in to redX by issuing the command 
    1. ssh csa@10.0.1.16.  If that doesn't work, and you think that the microSD card thinks that its hostname is, e.g., redalpha, then try ssh csa@redalpha.local
  7. If you are able to log in, excellent.  If not, consider connecting through ssh vnc (instructions to come), or, in a pinch, by connecting a keyboard and monitor directly to redX.  
  8. If it has not already been done, change the RPi hostname to, e.g., redX. Instructions at http://www.howtogeek.com/167195/how-to-change-your-raspberry-pi-or-other-linux-devices-hostname/ 
  9. If it has not already been done, add users and shudders.  Instructions at https://www.raspberrypi.org/documentation/linux/usage/users.md 
  10. If it has not already been done, configure wifi (optional), see  command-line instructions. Note: if the wifi network has no password, then instead of the line psk="PASSWORD," you need a line key_mgmt=NONE  (More discussion below, under editing the config file.) Configuring wifi can also be done through the GUI desktop on the RPi, see instructions. That GUI desktop has a Raspberry Pi Configuration Tool that allows one to change many settings on the pi.
    If the RPi does not have wifi, or you don't want to use it, edit /etc/modprobe.d/raspi-blacklist.conf and add:
    blacklist brcmfmac
    blacklist brcmutil
    -- and/or add this to csa's crontab:
    @reboot sudo ifdown wlan0
  11. Reboot.  From here on out, you should be able to connect with ssh csa@redX.local
  12. Locate, on the most recently installed Capture Station (or elsewhere—ask Steen or Turner), a top-level directory called /nest, which contains the software and scripts that Red Hen adds to the latest Debian system. Copy the /nest directory to Mithras so you can edit the /nest files on Mithras.
  13. Suppose the most recently installed RPi Capture Station is "redalpha." On Mithras, find /nest/cfg/red.config or, lacking that, /nest/cfg/red.config-redalpha.  It will look something like this: 
    1. # Red Hen configuration file for redalpha

      # Established 2016-07-06

      location="Cleveland, Ohio, US, at CWRU"

      FQDN=redalpha.cwru.edu

      ip_address=129.22.114.??

      timezone=America/New_York

      e-mail=csa

      essid="CaseGuest"

      key_mgmt=NONE

      # psk=""

    2. copy this file to a new file titled redhen.config-redX in the same directory and edit this file appropriately.  The new capture station should not need wifi since it will be connected by wired ethernet, but if you have connected redX to wifi, edit the essid and key_mgmt and psk lines in redhen.config-redX. If there is no password on the wifi, leave key_mgmt=NONE in place. If there is a password, delete or comment out (i.e. put a # in front of the line) the key_mgmt=NONE line, and remove the # at the beginning of the psk="" line and place the password between the two quotation marks of that line.  Save the file as redhen.config-redX and then copy that file to be the new redhen.config file, i.e. /nest/cfg/red.config.
  14. As user csa@redhenX.local, copy the /nest directory on Mithras to a new /nest directory on redX.
  15. Establish the appropriate Red Hen tunnel
  16. ........

What needs to be done after you receive a microSD card or its image from Red Hen

  1. Insert the microSD card into your RPi.  (If you have received only an image, format the microSD card and flash it with the image, eject the card and insert it into your RPi.)
  2. Connect the RPi by ethernet cable to the local ethernet network. Connect the RPi to electrical power. From some other computer, e.g. "Mithras," with a terminal on the local ethernet network, confirm that you can log in with ssh csa@redX.local. If you can't, create a direct ethernet connection between Mitras and your RPi, and try to change settings so that redX will be recognized on the local ethernet network.
  3. Make any other local settings to redX that could not be made before the microSD card was configured by the Red Hen directors.
  4. Connect the HDhomerun to ethernet on the same local network and to power. 
  5. Connect the externally-powered external USB hard drive to the RPi and to electrical power.
  6. At this point, the Red Hen staff can take over remotely, to do . . . 
    1. For more detail on configuring the HDhomerun and the hard drive, see Portugal Capture Station and Slick Capture.
    2. Establish automatic scheduling.  Use schedule:
      csa@redalpha:~ $ schedule -h
      Update the recording schedule in crontab using the downloaded schedule from xmltv.
      Syntax (use s to simulate results, without changing the crontab):
      schedule <network name or channel number> <show title> [<tuner #>] [<teletext page #>] [<comment>] [s]
      Enclose any element with a space in quotes:
      schedule "RTP 1" "Telejornal" 1 885 "National evening news" s
      schedule 1 "Telejornal" 1 885 "National evening news" s
      The last four fields are optional.
      The script is designed to run from crontab but can be run manually.
      If you run this script for a show, updating that show will be added to crontab.
    3. Put data transmission scripts into place from redX to UCLA
    4. . . . . .