RPi 3 Setup for MIX

RPi 3 Setup

1. Install OS

1. Download latest Raspian image from https://www.raspberrypi.org/downloads/raspbian/
extract image from zip into your home directory or wherever its convenient
2. Follow instructions on https://www.raspberrypi.org/documentation/installation/installing-images/linux.md to install OS
basic summary:
put the 16gb (8gb min) sdmicro card into your card reader
check what its mounted name is: df -h (it might be something like /dev/sdn1, but what you want to use for the image transfer is just the name without the "1", so /dev/sdn
use dd to transfer the image:
for example, sudo dd bs=4M if=2017-01-11-raspbian-jessie.img of=/dev/sdn

2. boot and set up SSH

connect a keyboard, mouse, and monitor to the rPi and boot it
open terminal and run "sudo raspi-config"
use the advanced options, find ssh, and enable ssh (it will default to pi/raspberry for login/password)

before restarting rpi, run ifconfig to get its IP address



reboot, use ssh to set up remaining items

3. Serial Port


ssh into the rPi, for example: ssh -l pi 192.168.5.116. Password is the default "raspberry" unless you have changed it

From here: http://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/

Do this:

To use add the following line to the /boot/config.txt

$ sudo nano /boot/config.txt

and add:

dtoverlay=pi3-miniuart-bt

And this:

$ sudo nano /boot/config.txt
and add the line (at the bottom):

enable_uart=1

And this: (from here: http://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-raspberry-pi3 which also has some details of the miniuart).

a)to disable the Serial Console edit the file using

sudo nano /boot/cmdline.txt
remove the word phase "console=serial0,115200" or "console=ttyAMA0,115200"

After that the ports should be switched so that the GPIO serial is using the real UART (and BT is using the miniuart).

pi@raspberrypi:~ $ ls -altr /dev/ser*
lrwxrwxrwx 1 root root 7 Jan 18 19:35 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Jan 18 19:35 /dev/serial1 -> ttyS0

4. Install gnu RXTX

see http://angryelectron.com/rxtx-on-raspbian/

sudo apt-get install librxtx-java

installs so's into /usr/lib/jni and RXTX jar into /usr/share/java