a more or less open-source aproach to working with GPS sensors using OS X
For this part of the workshop we are going to work with some open-source software
and have a look (or a quick glance) at
how a unix system like os x provides a facility for working with this kind of
software.
Wikipedia on open-source software
What we are going to do:
During this exercise, we will mostly work with the Terminal. You can find it under Applications -> Utilities -> Terminal
The terminal is a text interface for working with the operating system as opposed to the clicking on the object that the slick OS X "Aqua" surface provides..
1. Some things to install first....
Then, you need to install the drivers for the gps as mac os x does not have any generic drivers. (drivers for deluo usb gps are here, the drivers for the serial gps are here)
Fink is also a good thing to install if you want to work with open source software on os x. Because you can use the Advanced Packaging Tool Apt for installing Debian (Linux) packages on your Os X machine.
2.Downloading and Installing GPSD
GPSD is an open-source program that provides an interface for getting data from the GPS for use in self-made programs.
So we have uncompressed the GPSD directory. It contains all the files that we need to compile the gpsd program. This is how you do it:
The reason why we are using sudo is that in order compile a program you need more permissions than the average user. Sudo gives you the administrator permissions.
if everything worked out, we can now connect the GPS and check if the program functions...
if it did not compile for some weird reason, you can download the folder with the compiled gpsd here: gpsd_compiled.tar.gz running this one on a mac should work.
if you type "p" the position (latitude / logitude) is shown
if you type "a" the altitude is shown
if you type "s" the number of located satellites is shown
of course if you are inside, under a bridge or somewhere where there is now sky view, only typing "s" returns anything.
3. DOWNLOADING AND INSTALLING THE BINARY VERSION OF PureData (PD)
Point your browser to
Download: Pd version 0.37-2 compiled for Macintosh. You might also need Tcl/TK for Macintosh OSX .
check in /Library/Frameworks if there is anything like tk.framework and/or tcl.framework (if no, you have to download Tcl/TK. To install, doubleclick the .mpkg package and follow the instructions)
now you should be ready to run pd:
in a Shell (Terminal) type: /Applications/pd-0.37-2/bin/pd
or: you can just click the pd file in /Applications/pd-0.37-2/bin/pd
Simple PD examples (download patches & php files here php_pd.tar.gz)
triggering sounds with a delay:
To test sending data to a pd patch test it: echo 'one 1;' | /Applications/pd-0.37-2/bin/pdsend 2345
subpatch: pd gives you the possibility to use an instance of another patch.
in this case the subpatch is the attack_release.pd file.
4. Making a PHP script to connect PD and GPSD
The way to learn PHP: look up functions on www.php.net and somehow put together a script that works.
(picture below)