Raspberry Pi Workshop

Introduction

Welcome to Team STOBOR Raspberry Pi Workshop. This is a STEM Outreach program organized by members of Team# 11088, STOBOR. The workshop lesson plans are prepared by our team. Please feel free to browse the materials here and try the projects. If you would like us to organize a  workshop, please drop us an email : teamstobor@gmail.com with number of attendees, age range and location.

Setup

Prerequisites

Before workshop

  1. Windows or Mac laptop with at least 4GB RAM, 10GB free disk space and microSD or SD card slot.
  2. Pair of headphones
  3. Download and install Pi Bakery
  4. Download and install VNC Viewer
  5. Download and install PuTTY

Workshop day

  1. Ask host for WiFi network name and password. Make a note of this. Make your laptop connect to this network.
  2. Make sure you have all parts listed below.

Caution

The laptop and Raspberry Pi must be on the same wireless network. When using a guest network, if your laptop is on the main network (e.g. 192,168.x.x) and Raspberry Pi on a guest network(e.g. 192.254.x.x.), the connections to Raspberry Pi will fail.

Parts

  1. Raspberry Pi 3
  2. Sense HAT
  3. Micro USB Power supply
  4. USB microphone
  5. 16GB micro SDHC card

Date, Time and Location

Date Time Location Instructors
18th Nov 2017 2pm till 6pm  Stamford, CT Sambasiva Andaluri, Umesh Andaluri, Salil Kamath

Curriculum

Lesson plan

Step Description Instructions
1 Raspbian Install on SD card
  1. Open PiBakery
  2. Clone or download this Github Repository to your PC
  3. import recipe.xml into PiBakery
  4. Change network name and password (see Caution above)
  5. Insert microSD card into SD card jacket.
  6. Insert SD card into laptop
  7. Make sure the SD card drive was selected, Raspbian Full was selected
  8. Click on Write in PiBakery
  9. Eject the SD card from Explorer to safely remove SD card.
2 Assemble Raspberry Pi Follow instructions to assemble the Pi, insert SD card. Show the assembly to members of STOBOR team to make sure you got the right assembly before proceeding with next step.
3 Powering On Power on Raspberry Pi using the supplied power adapter. Since the OS was already installed and WiFi was already configured, you Raspberry Pi should be ready.
4 Sanity Checks We will now perform a series of simple checks to ensure everyone have all the hardware software necessary and all are in working condition. This helps to run the projects quickly and smoothly.

  1. Login to Raspberry Pi desktop using VNC
  2. Open Webbrowser and go to raspberry.org
  3. Open Wolfram enter a simple 2 digit addition
  4. Open Sonic Pi and run an example
  5. Open Webbrowser and go localhost:1880 (to check for Node-Red)
  6. Open Terminal and enter simple commands
5 Node Red
  1.  Simple flow to show input and output to debug
  2. Flow that displays SenseHAT readings to debug
  3. Installing new nodes to palette (add Dashboard)
  4. SenseHAT temperature to show chart in dashboard
6 Mathematica + SenseHAT  1. Try the SenseHAT temperature conversion from Celsius to Fahrenheit.

http://reference.wolfram.com/language/ref/device/SenseHAT.html

Future Workshop Projects or DIY

7 Make your own Amazon Echo Due to changes to Amazon security policy, this project will be demonstrated towards the end of the workshop if time permits. The kit contains all the right components to make this work. You may try this with the help of your parents.

Official Amazon Installation is harder to install and demonstrate. However the AlexaPi guide is relatively painless and easy to use.

8  Markdown note server Learn markdown and install this markdown server on Pi for a custom Evernote type note server. Children can learn cool extensions like mermaid to add diagrams to notes.

https://github.com/sinedied/hads

9 Cloud9 IDE Install Cloud9 IDE on Raspberry Pi. This makes easier for kids to write and run programs without messing around (or overwhelming) with command line.

https://medium.com/@chintanp/using-cloud9-3-0-ide-on-raspberry-pi-954cf2d6ab8e

 

Appendices

Node Red flows

Curated set of node-red flows

Idea Description and links to the flow
Family/Friends tracker On each “user” Raspberry Pi, Capture current location (Don’t know how but could be from WiFi?), send that data to MQTT and publish it on a topic.   One Raspberry Pi to serve as “server” where a world map node subscribes its data from MQTT topic and plots them on the map.
Using microPi to record audio and play it back
 PyBeacon via node-red exec node  https://github.com/teamstobor/raspberry-pi-workshop/blob/master/pybeaconflow.json

References

Description Notes, links etc.
Node-Red Installer After the initial PiBakery install, if anytime raspberry pi was upgraded, then node-red would need to manually installed using the following command if node-red service fails to start using error “Unit nodered.service entered failed state.”
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
Node Red Guide http://noderedguide.com
CURL https://curl.haxx.se/docs/httpscripting.html

Feedback

Task Description
Easy identification of Pi on the net and for the participant In the workshop on 18th Nov, the most time consuming task was to identify each pi on network. In order to do this seamlessly, we would need to  set hostname for each pi. This can be done via PiBakery. However, Windows PCs, cannot identify the Pi using hostname. After some googling, it was suggested by several posts that by installing samba on the Pi, the hostname could be advertised and Windows PCs can connect to the Pi using the hostname.

Another problem was to physically identify each Pi. Since the Pi had a SenseHAT, it would be a good idea to have a unique message or symbol displayed on LED matrix when joystick was pressed. This has to be installed via PiBakery.

Update Pi Bakery recipe to install all software PiBakery recipe should include (workshop attendees will only set Wifi and hostname)

  1. Empty network name and password block
  2. Enable VNC
  3. Enable node-red service
  4. Set hostname (no default)
  5. install npm
  6. install samba
  7. install cloud 9
  8. install hads
  9. reboot
Missing Manage Palette in node-red In the default node-red shipped with Raspbian (Full) the node-red menu does not show “Manage Palette” option. This option is convenient to install extra nodes from node-red UI without requiring to use command line.

When node-red started, it displayed this error “Palette editor disabled : npm command not found”. This was fixed by installed npm using sudo apt-get install npm

Bluetooth Check bluetooth service status using command line sudo service bluetooth status

If we notice any error regarding Sap such as

Nov 21 00:05:05 workshop bluetoothd[733]: Sap driver initialization failed.
Nov 21 00:05:05 workshop bluetoothd[733]:
sap-server: Operation not permitted (1)

 

Add  --noplugin=sap to ExecStart=/usr/lib/bluetooth/bluetoothd line in file  /lib/systemd/system/bluetooth.service

In order to start BLE Beacons from command line

sudo pip install PyBeacon sudo PyBeacon -u http://stobor.club sudo PyBeacon -t
SDHC Card issues Once PiBakery writes the SD card, in order to re-use (or re-format) the card, the card might only show 56MB. This is due to FAT32 partition of 56MB and an extended partition of rest of the disk space. Open the disk partition manager in Windows, delete all partitions. Reformat the SD card in Mac to FAT. There should be an easier way than this.