AL Tech

From BenningtonWiki
Jump to: navigation, search

The Augmented Library
Tech notes from Fall

Processing+Ruby

Ruby+Processing

Server Access

On a Mac
On the Finder, go to "Go" and then "Connect to Server"

Type in bibliofile.bennington.edu in the server address, then connect

Username: bookmark
Password: serve

On a PC
Go to a file browser window (NOT a web browser) and type \\bibliofile.bennington.edu. Enter the username and password.

MySQL

MySQL root password: serve
bookmark account/pw: bookmark/serve

<source lang="text"> bibliofile:~ $mysql5 -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 134193 Server version: 5.0.45-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database bookmark; Query OK, 1 row affected (0.01 sec) mysql> grant all on bookmark.* to bookmark identified by 'serve'; Query OK, 0 rows affected (0.02 sec) </source>

DB Schema

Patrons

patron id (int)
name (100)
password (5)

Messages

message id (int)
patron id (int)
book id (int)
bookmark id (int)
text (4000)
datetime

Tags

tag id (int)
patron id (int)
text (50)
datetime

Tagged Messages

tag/message id (int)
tag id (int)
message id (int)

Bookmarks

bookmark id (int)
serial number (int)
format (int)
name1
name2

Bookmarks and Messages

bookmark and message id (int)
bookmark id (int)
message id (int)
datetime

Patterns

pattern id (int)
pattern
patron id (int)
datetime

Books

book id (int)
title (150)
barcode (10)
media (int)

Authors

author id (int)
name (100)

Authors and Books

author/book id (int)
author id (int)
book id (int)

Patrons Histories

patron history id (int)
patron id (int)
message id (int)
datetime

Logins

login id (int)
patron id (int)
kind (int, "login" or "logout")
datetime
  • Surrogate keys
  • Don't use auto-increment; generate random long ints instead

Kiosks

  • Create a "joe" account. Admin privileges, password 'serve'.
  • Install Xcode.

Test Xcode installation. <source lang="text"> gcc i686-apple-darwin9-gcc-4.0.1: no input files </source>

  • MacPorts
  • Terminal/bash prefs. Stick this line in .bash_login in your home directory. (ask joe about this)

<source lang="text"> export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/jruby/bin:$PATH:. </source>

  • New Terminal window. Install subversion. This part takes a long time. Why don't you install JRuby and set the system prefs while you're waiting?

<source lang="text"> sudo port install subversion </source> Test subversion installation. <source lang="text"> svn Type 'svn help' for usage. </source>

  • JRuby

<source lang="text"> curl http://dist.codehaus.org/jruby/jruby-bin-1.1.1.tar.gz -O tar xf jruby-bin-1.1.1.tar.gz sudo mv jruby-1.1.1 /opt/local/jruby </source> Test jruby installation <source lang="text"> jruby -e "puts 'Hello Crossett'" Hello Crossett </source> System Preferences

  • Network: Airport off, ethernet using DHCP with manual IP
    • 12.16.114.8 - bookmark1
    • 12.16.114.9 - bookmark2
    • 12.16.114.17 - bookmark3
    • 12.16.114.19 - bookmark4
  • Screensaver off
  • Energy Saver: no sleep, no display sleep, no hard drive sleep, no brightness reduce
  • Sound: no alert volume, no ui, etc. sound effects
  • Sharing: computer name bookmark1, 2, 3, 4 (as above), Personal File Sharing on, Remote Login on
  • Accounts: automatically log in as joe/serve
  • Date & Time: set date & time automatically
  • Software Update: no Check for updates
  • Displays: Show displays in menu bar, 1344x840

Arduino serial driver -- install from the Arduino IDE folder.

Bookmark project <source lang="text"> svn co http://svn.bennington.edu/svn/augmented-library/bookmark </source> Run the project <source lang="text"> cd bookmark/horsies jruby horsies/main.rb --full_screen </source>

Extras
Put a Quit item in the Finder menu, and quit the Finder whenever you're running full screen. <source lang="text"> defaults write com.apple.Finder QuitMenuItem 1 </source>

Bookmark Construction

Batteries

  • Tape two batteries together. Using standard electrical tape. Line them up so that the plus terminals are right next to each other.

Al11.jpg

  • Tin the insides of each battery lead; To tin a wire, apply the tip of your iron to the wire for a second or two, then apply the solder to the wire. The solder should flow freely onto the wire and coat it.

AlB10.jpg (the side facing the corresponding lead on the other battery). AlB9.jpg

  • Tin the outside of one side of each lead.

AlB6.jpg

  • Tin the battery wires.

AlB4.jpg

  • Solder the leads together.

AlB3.jpg

  • Hold the leads with an alligator clip or heatsink clip.

AlB2.jpg

  • Solder battery wires to the leads: red to + and green/black to -.

AlB1.jpg

  • Test that the batteries take a charge.

AlB12.jpg

  • Attach to charger so the charge light goes red.

AlB13.jpg

  • Let it charge. Should take 60 minutes.

AlB14.jpg

HARDWARE instruct-able;

-MATERIALS-

  • 1 Arduino Mini
  • 2 Powerizer Li-ion 3.7v Cell Battery
  • 1 RGB-LED
  • 2 220k Resister (RedRedBrown)
  • 1 270K Resistor (RedPurpleBrown)
  • 1 2.2k Resistor (RedRedRed)
  • 1 Roll of 30AWG stranded wire (white)
  • 1 Switch

Construction

  • SOLDERING sequence: [*/when looking up from the bottom/*}
  • Reset 2.2k Resistor to pin 22 [pin 3 up on the bottom right]

Ali1.jpg

  • Reset switch to pin 22 and to Ground [square hole bottom right]hot glue in place Reverse curl lead to resistor wire splunk

Ali2.jpg

  • power(+)pin 21 [pin 4 up on the bottom right] trim excess off resistor

Ali3.jpg Ali4.jpg Ali5.jpg

  • ground(-) pin 23 to LED pin 3

Ali6.jpg

PREPARE BOARD FOR TESTING [see testing board example]

Alibi7.jpg Alibi8.jpg Ali9.jpg Ali10.jpg Ali11.jpg

Board Testing

On a prototype board:

  • connect power (+) to Pin 21
  • ground(-) to Pin 23 . . . . which are the second and fourth pin on the top-right.

Power can be from a charger or a charged battery.

  • connect RX to Pin 1
  • connect TX to Pin 2

Once the Arduino Mini is attached upload the Arduino code and verify that it uploads successfully. An error will indicate a problem in what has been completed so far.

Construction Cont.

Connecting the LED:

  • Connect a 270k Resistor to Pin 12 . . . . and LED Pin 4
  • Connect a 220k Resistor to Pin 13(16) . . . . and LED Pin 2
  • Connect a 220k Resistor to Pin 14(8) . . . . and LED Pin 1

Updates

Wednesday, February 27, 2008

We hoped to create an RGB sequence on the arduino today but due to the fact that we weren't using an updated enough program and that the aduino mini was "stale" we were unable to see it completed today. Rebecca plans to work on it this week and hopefully be done by Saturday evening.

Hannah is playing around with processing and is going to create a program that fills a computer screen and hides the dock, etc...

Jess is dying and we love her.

Luce is going to educate herself on processing.

Saturday, March 1, 2008

Joe and Rebecca got the arduino mini to work today at 4:35 today, marking the beginning of the 3 day test, which means in the middle of class on Tuesday we'll see if it makes it. The color is cycling an RGB LED.

Sunday, March 9, 2008

Hannah converted last weeks program of box moving from processing to r-process. She is working on writing the program for Serial IO,as well as working on writing the program for fetching a string from bibliofile.

Rebecca got the RGB LED to work. The HSV to RGB now works (mostly) correctly. The light is hooked up to the computer in the AL room and by issuing serial commands in lowercase letters, you can change the pattern.

Wednesday, March 13, 2008

Jess is making a list of ideas for each element in the wireframes so that we get a sense of all the pieces that will be needed when we're writing the code.

We plan to code this weekend.

Hannah is working on asking the database for a 6 letter word, and then sending it down to the arduino.

Footnote

* Bold values indicate statistical significance from 0 at the 0.05 level using a 2-sided sign test of the null hypothesis. [1]

Exporting Records from Library Database

1. Open Millenium, aug/library then aug/lib.
2. Choose empty file and select "search records"
3. In field, select "material type"
4. For Condition, select "equal to"
5. Value A, select books
6. Append
7. For Operator, select "or"
8. Repeat steps 3 and 4
9. For Value A select reference, periodicals, vhs, or dvd and apply the same steps as before to these
10. Select "search"
11. Then highlight group and select, "Export records"
12. Type is "Bibliographic"
13. Field is "marc tag", marc field is 245|ab (this helps to make the title shorter)
14. Append and then select from bibliographic and items what you desire.

Bookmark Serial Numbers

To set a bookmark's serial number, connect it in the Arduino IDE and turn on the serial monitor. Type "!serixxxx" into the Send box, where 'xxxx' is the serial number padded with leading zeros. For example, to set the serial number for the ground floor (2) Owl (form 6), send "!seri0017". The serial number is repeated in the wink message sent back from the bookmark. "!wink0017!wink0017!wink0017!wink0017..."

+---------------+------+-------+
| serial_number | form | floor |
+---------------+------+-------+
|             1 |    1 |     1 |
|             2 |    1 |     2 |
|             3 |    1 |     3 |
|             4 |    2 |     1 |
|             5 |    2 |     2 |
|             6 |    2 |     3 |
|             7 |    3 |     1 |
|             8 |    3 |     2 |
|             9 |    3 |     3 |
|            10 |    4 |     1 |
|            11 |    4 |     2 |
|            12 |    4 |     3 |
|            13 |    5 |     1 |
|            14 |    5 |     2 |
|            15 |    5 |     3 |
|            16 |    6 |     1 |
|            17 |    6 |     2 |
|            18 |    6 |     3 |
|            19 |    7 |     1 |
|            20 |    7 |     2 |
|            21 |    7 |     3 |
|            22 |    8 |     1 |
|            23 |    8 |     2 |
|            24 |    8 |     3 |
|            25 |    9 |     1 |
|            26 |    9 |     2 |
|            27 |    9 |     3 |
+---------------+------+-------+

forms
1 Apollo Lunar Module
2 Drum
3 Duchamp's Fountain
4 Martha Graham
5 To Kill a Mockingbird
6 Minerva's Owl
7 Jocasta's Brooch
8 Ockham's Razor
9 Yeast Cell