- code is based on:
sudo apt install fish
chsch
sudo apt install python3-paho-mqtt python3-flask python3-pip python-pip python3-grove-py
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
- connect headers (pins) as specified
- move service files
sudo cp run*.service /lib/systemd/system/
The Raspi1 is connected to 2 GroveUltrasonicRanger, a buzzer and a led.
- Connect the GroveUltrasonicRanger to D5 & D16
- Connect the buzzer to digital port 6
- Connect led to digital port 17
- ssh pi@raspi1
- run
sudo systemctl enable run1.service && sudo systemctl start run1.service
You can change this default values underneath in run1.py trigger_distance = 120 (trigger distance in centimeters) time_a = datetime.time(22, 0) time_b = datetime.time(5, 00) delay = 0.1
Code for Raspi1 under Raspi1 service file:
The Raspi2 is connected to a buzzer and a led.
- Connect the button to D5
- Connect the buzzer to digital port 6
- Connect led to D16
- ssh pi@raspi2
- run
sudo systemctl enable run2.service && sudo systemctl start run2.service
Code for Raspi2 under Raspi2 service file:
Configure both Raspis to be connected to the same network. For low latency communication it is recommended to connect to the same access point. Use for instance wpa_supplicant.conf on both Raspis.