Difference between revisions of "Provision Mac Mini Server as Last.fm Player"

From rukapedia
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
I'm provisioning a Mac Mini to act as a [http://last.fm Last.fm] music player at [http://casamiacafe.ca Casa Mia Café] in Charlottetown.
 
I'm provisioning a Mac Mini to act as a [http://last.fm Last.fm] music player at [http://casamiacafe.ca Casa Mia Café] in Charlottetown.
 +
 +
The end result, after all the pieces are in place, is that:
 +
 +
* previously-registered customer enters café
 +
* their mobile device (iPhone, Blackberry, etc.) is detected via Bluetooth scanner
 +
* the devices's [http://msdn.microsoft.com/en-us/library/cc510863.aspx Bluetooth device address] is used to look up customer's [http://last.fm Last.fm] username
 +
* the customer's Last.fm library is added to the rotation of playlists playing inside the café (until the customer leaves the café)
  
 
== Mac Mini Setup ==
 
== Mac Mini Setup ==
Line 9: Line 16:
 
* Under ''System Preferences'' | ''Sharing'', turn on ''Screen Sharing'' (with password) and ''File Sharing'' to support remote usage.
 
* Under ''System Preferences'' | ''Sharing'', turn on ''Screen Sharing'' (with password) and ''File Sharing'' to support remote usage.
  
== Set up Harland Scan ==
+
== Install Last.fm Scrobbler ==
 +
 
 +
* Install the official [http://www.last.fm/download Last.fm client for Mac]
 +
 
 +
== Set up Bluetooth Scanning ==
  
 
* Install [http://developer.apple.com/technologies/xcode.html Xcode] (LightBlue won't install without it)
 
* Install [http://developer.apple.com/technologies/xcode.html Xcode] (LightBlue won't install without it)
 
* Install [http://lightblue.sourceforge.net/ LightBlue] (test using [http://lightblue.sourceforge.net/#examples these examples])
 
* Install [http://lightblue.sourceforge.net/ LightBlue] (test using [http://lightblue.sourceforge.net/#examples these examples])
* Install pysqlite2: ''sudo easy_install pysqlite2''
 
 
* Install [http://code.google.com/p/haraldscan/ haraldscan]
 
* Install [http://code.google.com/p/haraldscan/ haraldscan]
 +
** Change references to ''pysqlite2'' to ''sqlite3'' in ''haraldsql.py'' and ''haraldscan.py''
 +
* Modify haraldscan to send information, via REST, to a web server for logging (source code to come)
 +
* Drop a launchd plist file into the ''/Users/casamia/Library/LaunchAgents'' directory so that the scanner runs every 60 seconds:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 +
<plist version="1.0">
 +
<dict>
 +
<key>Label</key>
 +
<string>net.reinvented.haraldscan</string>
 +
<key>ProgramArguments</key>
 +
<array>
 +
<string>/bin/sh</string>
 +
<string>/Users/casamia/Code/launchd/haraldscan.sh</string>
 +
</array>
 +
<key>RunAtLoad</key>
 +
<false/>
 +
<key>StartInterval</key>
 +
<integer>60</integer>
 +
</dict>
 +
</pre>

Latest revision as of 11:23, 11 July 2010

I'm provisioning a Mac Mini to act as a Last.fm music player at Casa Mia Café in Charlottetown.

The end result, after all the pieces are in place, is that:

  • previously-registered customer enters café
  • their mobile device (iPhone, Blackberry, etc.) is detected via Bluetooth scanner
  • the devices's Bluetooth device address is used to look up customer's Last.fm username
  • the customer's Last.fm library is added to the rotation of playlists playing inside the café (until the customer leaves the café)

Mac Mini Setup

  • First boot.
  • Walk through Apple setup (language, keyboard, registration, etc.)
  • Download Microsoft Intellitype drivers from here to support my Natural Ergonomic Keyboard 4000.
  • Install Google Chrome as an alternative to Safari.
  • Under System Preferences | Sharing, turn on Screen Sharing (with password) and File Sharing to support remote usage.

Install Last.fm Scrobbler

Set up Bluetooth Scanning

  • Install Xcode (LightBlue won't install without it)
  • Install LightBlue (test using these examples)
  • Install haraldscan
    • Change references to pysqlite2 to sqlite3 in haraldsql.py and haraldscan.py
  • Modify haraldscan to send information, via REST, to a web server for logging (source code to come)
  • Drop a launchd plist file into the /Users/casamia/Library/LaunchAgents directory so that the scanner runs every 60 seconds:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>net.reinvented.haraldscan</string>
	<key>ProgramArguments</key>
	<array>
		<string>/bin/sh</string>
		<string>/Users/casamia/Code/launchd/haraldscan.sh</string>
	</array>
	<key>RunAtLoad</key>
	<false/>
	<key>StartInterval</key>
	<integer>60</integer>
</dict>