Demo materials for C-Tech^2 summer camp.
- First create an account with Blynk.io.
- Create templates and devices for the
water temperature sensor
, and thepower strip
. - Copy/paste the configuration code for each device into a YAML file with the same name as the Python file you are trying to run. For example, for the power strip you will create a file
power_strip.yml
that looks sort of like this:BLYNK_TEMPLATE_ID: "<some id>" BLYNK_DEVICE_NAME: "<some name>" BLYNK_AUTH_TOKEN: "<some auth token"
- Modify the Blynk virtual pin and physical GPIO pin assignments to match those of your Raspberry Pi and Blynk device online.
$ python3 picam_demo.py
# Run object detection script using 180-degree camera rotation.
$ python3 object_detection.py -m ssd_mobilenet_v1_1_metadata_1.tflite -l labelmap.txt -r 180
- Run
sudo raspi-config
and enable the following (requires reboot):Remote GPIO
1-Wire
- If running on macOS ensure that you have XQuartz installed.
- On RPi run the installer script:
$ sudo install_rpi.sh
- Enable X forwarding in
/etc/ssh/sshd_config
via setting:X11Forwarding yes
- Must set
DISPLAY
env variable on RPi. Add the following to~/.bashrc
or~/.zshrc
:# For X11 forwarding export DISPLAY=localhost:10.0
- Download the example TensorFlow Lite model which has been pre-trained on the COCO dataset:
$ curl -L https://tfhub.dev/tensorflow/lite-model/ssd_mobilenet_v1/1/metadata/1?lite-format=tflite --output ssd_mobilenet_v1_1_metadata_1.tflite
- Unzip the model file to reveal a new labels file called
labelmap.txt
:# Will unpack a new file called `labelmap.txt` $ unzip ssd_mobilenet_v1_1_metadata_1.tflite