Version 15 (modified by 9 years ago) (diff) | ,
---|
Desktop Preparation
- On your notebook/desktop, install Bonjour Services from Apple. This allows your windows machine to 'just know' the hostname raspberrypi.local. See Bonjour for Windows
- Install Jessie Lite to your sd card Raspbian Jessie OS
Configure Pi Zero
- Connect to Pi:
ssh pi@raspberrypi.local
(password is raspberry) - Configure Pi
- Setup DNS:
sudo nano /etc/resolv.conf
.- add: nameserver 8.8.8.8
- add: nameserver 8.8.4.4
- Configure PiZero?
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
- Activate the option "Expand to use the entire memory card." This will reboot the system after you are done, then continue.
- Activate the Pi Zero's built-in I2C Interface:
- Update to latest software (this will take a while):
sudo apt-get update sudo apt-get upgrade
- Setup DNS:
- Install Oracle Java JDK:
sudo apt-get install oracle-java8-jdk
. Do not use OpenJDK, its slower. - Install git:
sudo apt-get install git
- Install wiringPi:
mkdir ~/dev;cd ~/dev git clone git://git.drogon.net/wiringPi cd wiringPi ./build
Then, test by running "gpio -v" and "man gpio" - Install Pi4J
- See: http://www.savagehomeautomation.com/projects/pi4j-connecting-java-to-the-raspberry-pi.html
- video tutorial
- Easy way, type:
cd ~/dev curl -s get.pi4j.com | sudo bash
- Run a program at startup of Pi/Raspian?:
Check out the following URLs for examples and reference information:
http://www.mikeslab.net/?p=176 http://wiki.debian.org/LSBInitScripts
Highlights from this page:
NOTE: Use ‘sudo’ to perform these operations as root in a Raspbian shell…
Create an LSB style init script for launching a PiBot autonomous startup app.
- I copied rc.local as a starting point and modified it to run my desired - PiBot app as follows:
- sudo cp /etc/init.d/rc.local /etc/init.d/pibot_auto
- sudo vi /etc/init.d/pibot_auto
- Revise the header block to describe PiBot autonomous app
- Revise the do_start() to launch the PiBot autonomous app
- Save and exit editor
- Test/debug the script until it works as desired using these commands:
- sudo /etc/init.d/pibot_auto start
- sudo /etc/init.d/pibot_auto stop
- sudo /etc/init.d/pibot_auto restart When working as desired, register script to run at startup/shutdown:
- sudo update-rc.d pibot_auto defaults If the script is changed (edited) after registering, a ‘reload’ may be necessary as follows:
- sudo systemctl daemon-reload To unregister the script (i.e., stop it from running at startup/shutdown):
- sudo update-rc.d -f pibot_auto remove