wiki:PiBotOsInstallation

Version 61 (modified by David Albert, 9 years ago) (diff)

--

Baseline Minibot Raspbian Image Build Instructions

  • Plan A: note that some of the below install steps may already be in the stock image, so don't worry about it if they're already installed)
    1. Download stock Raspian Jessie Light image
    2. Follow these directions for installing it to a uSD card

  • Plan B:
    1. Download and install PiBakery which includes Jessie Light
  • Install PuTTY and use it to connect to the Pi:

Hostname: raspberrypi.local Username: pi Password: raspberry

  • Update to latest software (this will take a while):
      sudo apt-get update
      sudo apt-get upgrade
    
  • Install some useful packages:
      sudo apt-get install i2c-tools
      i2cdetect -y 1
    
  • Install Oracle Java JDK. Do not use stock OpenJDK, its slower.
      sudo apt-get install oracle-java8-jdk
    
    • Then test, by running java -version. It should say java 8, not openjdk.

To access the I/O capabilities of the Pi (and the PiBot hat), you must install additional libraries; either Oracle's Device I/O (DIO) or Pi4J (which uses WiringPi?) or both. You can read about them here. Tutorials are here and here

  • Install Pi4J
      mkdir -p ~/dev;cd ~/dev
      curl -s get.pi4j.com | sudo bash
    
  • Test installation by checking version: pi4j -v
  • Install Oracle Device I/O (DIO) library. See usage here and [http://www.oracle.com/technetwork/articles/java/cruz-gpio-2295970.html
      sudo apt-get install mercurial
      hg clone http://hg.openjdk.java.net/dio/dev jdkdio
      cd jdkdio
      export JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt
      export PI_TOOLS=/usr
      make
      sudo cp -r build/deviceio/lib/* $JAVA_HOME/jre/lib
    
  • Test Device I/O following these directions or these. Projects must be linked with build/jar/dio.jar and reference the appropriate policy files. For example, to run a program:

sudo java -Djava.security.policy=./java.policy -classpath .:./dio.jar -Djdk.dio.registry=./dio.properties DioLed . An example java.policy is:

   // grant all permissions for the DIO framework
   grant {
       permission jdk.dio.DeviceMgmtPermission "*:*", "open";
       permission jdk.dio.gpio.GPIOPinPermission "*:*", "open,setdirection";
       permission jdk.dio.gpio.GPIOPortPermission "*:*";
       permission jdk.dio.i2cbus.I2CPermission "*:*";
       permission jdk.dio.spibus.SPIPermission "*:*";
       permission jdk.dio.uart.UARTPermission "*:*";
   };
  • Install Nano text editor sudo apt-get install nano
  • Install Avahi (mDNS/zeroconf) sudo apt-get install avahi-daemon
  • Update Raspian Configuration sudo raspi-config
    • Activate the Pi Zero's built-in I2C Interface:
      • Use the down arrow to select 'Advanced Options'
      • Arrow down and select 'I2C'
      • Select 'Yes' to enable the I2C Interface
      • Acknowledge the notification confirming the I2C Interface has been enabled
  • Setup WiFi for a Pi Zero
  • Reboot one last time, and log back in. Capture OS image for reuse by
    • ???

Per Minibot config instructions (with baseline image above installed)

  • Update Raspian Configuration sudo raspi-config
    • Customize host name. Reference hostname list for assigned names. Be sure not to duplicate!
    • Select 'expand to use entire sd card'. This will reboot the pi.

Other Miscellaneous Things