#How to Setup a Raspberry Pi 3 for OpenAPS
Much of the information here is derived from the hard work of others at the following sources:
These instructions detail how to configure the Raspberry Pi 3 for OpenAPS using a USB-serial cable. Most of these changes are unnecessary for the Raspberry Pi 2 models. Note that a Windows machine was used to interface with the Pi 3 in developing these instructions and use of a wireless things RF module (e.g. Slice of Radio) is assumed (requires UART access). I've attempted to keep the instructions generic enough so they can be applied to multiple platforms.
- π Write the latest Raspbian Jessie to your SD card as you would for the OpenAPS Raspberry Pi Setup in the latest OpenAPS docs
- π© In order to enable the serial console, navigate to the mounted "boot" partition on your SD card while it is still in your computer and add the following to the config.txt file:
# Enable miniUART
enable_uart=1
# Force the core frequency to maximum
force_turbo=1
This will enable the /dev/ttyS0 mini-UART on the Pi 3 and force the core frequency to the max rather than the default minimum. 3. π Put your SD card in the Pi, connect the serial cable (see pic below) and connect via terminal (putty (windows), screen (linux/mac), etc). The baud rate is 115200. 4. πΊ Update the repository and upgrade the installed packages:
pi@raspberrypi:~ $ sudo apt-get update && sudo apt-get upgrade -y
Update the firmware:
pi@raspberrypi:~ $ sudo rpi-update
Reboot to apply the changes:
pi@raspberrypi:~ $ sudo reboot
- πͺ Continue with the OpenAPS docs pi setup instructions, making sure to complete the following steps:
- setup the user password
- expand the filesystem
- set the timezone
- setup wifi networks
- π Make sure you are able to ssh into the Raspberry Pi 3 before proceeding! In the next step you will disable the serial console, so you want to be sure you can access the Raspberry Pi 3 command line.
- π SSH into the Pi 3
- π― To disable the console, edit the /boot/cmdline.txt file as follows:
pi@raspberrypi:~ $ sudo nano /boot/cmdline.txt
#dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Reboot to apply the change:
pi@raspberrypi:~ $ sudo reboot
- π¨ Proceed with installing OpenAPS dependencies and software. Use /dev/ttyS0 as the mmeowlink port.
Who created this guide? Would you have any interest in helping create a Moto Z mod using the pi hat and incorporating it into AndroidAPS? Let me know and I'd be happy to find a Moto Z and developer Pi Hat mod for you to tinker with!