handset+activity+system

//Other activity pages://
 * hotline activity system

=Overview= This handset activity system is...
 * a way to create "activities" using the piphone
 * with a branching voice system as the core metaphor and functionality -- e.g., "press 1 to hear more about xyz, or press 2 to leave a voicemail"

Projects for testing or demo:


 * secret message machine? (let's have a specific prototype here...)
 * Sankofa Says game (2014, as featured in IndieCade)

Features we want to create (that take substantial work):
 * support for ID cards, so players can use metro cards or student ID cards in games (probably using RFID)
 * identity tracking -- so we can leave messages for person, etc.
 * sending SMS messages -- probably via Twilio APIs
 * validating player identity by texting them a code to enter
 * remote event trigger -- for example, FTP a file to the Pi in a set directory "remote-events/event-2016-02-08-ringphone.now" --> checks this directory 1 time per second, triggers event, then moves file to subdirectory when done.
 * trigger an event when a player is near. probably with [|bluetooth detection].

Small snippets and short-term projects for general utility:
 * 1) logging usage -- e.g., every time handset is hung up, the system adds a line to a logfile (ideally a single CSV for all games/activities, and that indicates which activity, e.g,. "2016-03-02,23.04,game4SankofaSaysV1.0")
 * 2) a key-value system.
 * 3) perhaps simply using filenames. This could be neat to implement. Each collection would simply get its own directory. For example, if we wanted to look up player NAMES based on their ID, then it might work like this: (1) create a directory for the files -- something like "keydir-PlayerNamesForID"... then (2) create a text file for each pair; so if the ID is 20972 and the name is "JIM-JONES", we just create this file: "playerNamesForID/key.20972.value.JIM-JONES"... and (3) the file itself can either have dummy text or if we actually want more in depth information, we can store logs or whatever.
 * 4) place to store code... it's so simple we might just use dropbox... or we could use github???

=feature1: to register a phone number, and confirm by SMS (Eleanor)= =feature2: to recognize student ID card (Eleanor)= > If the user taps an ID card to the ID card reader, the card's 10-digit number will be registered. Next step would be to connect ID card numbers to phone numbers.
 * Setup with Payphone
 * 1) Raspberry Pi must be connected to internet (either ethernet or wifi). Raspberry Pi must also have keyboard, external monitor/HDMI, power supply, and SD Card/SD Microchip with the python program "capstone-demoOPEN.py" installed.
 * 2) Connect Raspberry Pi to phone via GPIO ribbon.
 * 3) Turn on Raspberry Pi by connecting it to a power source.
 * 4) In the command line, make sure you are in the "pi" directory. Type "sudo python capstone-demoOPEN.py"
 * 5) The Python program should execute on loop
 * User Flow
 * 1) Pick up the payphone
 * 2) Listen to prompt
 * 3) Enter cell phone number
 * 4) Phone number is posted to PHP "playfulcity.net...." and Twillio is called
 * 5) Receive confirmation text message from payphone Twillio account signifying successful registration (message is pre-programmed via linked OpenVBX account)
 * Bugs
 * Potential hardware problem with number keypad press? Or code internal binary problems with GPIO pin processing.
 * Once all bugs are addressed, set up Raspberry Pi to run this program on boot, therefore excluding the need for an external monitor, keyboard, and mouse.

=How to -- basic setup=
 * directory setup:
 * "activities" are stored in the base directory of: "/home/pi/payphone/" ... for example, a game main file might be: "/home/pi/payphone/the-message-game/message-game-v1a.py"
 * generally, audio files just for that game are stored in a subdirectory for that activity... as is any logging specific to that project. The goal is to be able to FTP the activity from one directory (or TAR) and transfer it to a different phone.
 * for remote access to the Raspberry Pi, we are currently using weaved.com for remote SSH access for FTP and VPN

Creating content

 * audio files should be WAV files, converted to mono, and i think 128 kbps... if this is wrong, your sound file might play at the wrong speed or too slowly... but we might have to figure these out by trial and error...

How to send an SMS (and generally connect to Twilio)

 * Twilio is a cloud-based phone backend with some great APIs.
 * sample project (using raspberry pi and python to do SMS): http://readwrite.com/2014/04/23/raspberry-pi-connected-home-fish-text-message-twilio