- Raspberry Pi 3 B/B+
- 1-wire temperature sensor, we used DS18B20
- Servo motor
- Breadboard
- 4.7k Ohm resistor
The connections we made are listed below. Refer to Figure 1 to find what pins to connect to.
- Temperature sensor power to pin 1, 3.3 VDC Power
- Temperature sensor Ground to pin 6, Ground
- Temperature sensor Data to pin 7, GPIO 7
- Resistor between Temperature sensor power and Data
- Servo motor Ground to pin 14, Ground
- Servo motor Power to pin 4, 5.0 VDC Power
- Servo motor Control to pin 32, GPIO 26
Figure 1: GPIO pinout using the Pi4J/WiringPi GPIO numbering scheme.
If something is unclear, there are pictures of how we connected our sensor and servo to the Raspberry Pi, here.
Download "Raspbian Stretch with desktop and recommended software" from here, and follow the installation guide.
Follow this installation guide.
Notes:
- Make sure you select detached mode during installation.
- You need to install maven to compile. ´sudo apt update; sudo apt install maven`.
- Run the command
git clone https://github.com/MartinBrathen/arrowheadClient.gitfrom your terminal, inside your home folder. Our script will not work otherwise. The commandcdwith no arguments will send you to your home folder. - Go to the arrowheadClient repository in your terminal.
- Use
mvn packageinside the arrowheadClient repository.
- Install xterm.
sudo apt install xterm - Enable 1-wire interface. Run
raspi-configin your terminal, press 5 to select interfaces, select 1-wire and enable it. - If you have set a root password you need to run
modprobe w1-gpio && modprobe w1-therm, otherwise this will be done in the temperature provider code.
- Go to the arrowheadClient/Scripts repository in your terminal.
- Run the start_ah_insecure.sh script to start the framework.
./start_ah_insecure.sh - Run
systemctl | grep arrowheadto make sure the framework is running. All six core systems should say "loaded active running". If this is not the case, repeat this step until it you get the desired output. - Run our example with the command
./startUp.sh - Three new terminal windows should pop up, and the example will shortly be running.
- To stop the example, it is very important that you write "stop" in the terminal window of both providers before you close their window. Otherwise they will not be unregistered from the service registy, and this will lead to problems when running the example again.