Skip to main content

Mac OpenMoco Installation

This is a detailed article on installing OpenMoco-Slim on Mac OSX as well as installing OpenMoco TL Engine to the Arduino. I am not into code or scripting so most of this was foreign to me and I know there must be others who have the same lack of skills. This is meant to help those without those skills and in the process develop the skills needed for OpenMoco.

OK now onto the races. First step is to download and install Xcode Tools from Apple, this may seem unnecessary but it's needed by the following step. The URL to the Xcode download site is http://developer.apple.com/technologies/xcode.html.
To download you need to register but it's pretty quick 2-3 minutes. You can also install Xcode Tools from your original OS installation disk but make sure you are using Xcode Tools 3.1.4 or above. Leopard needs Xcode 3.1.4 and Snow Leopard Needs 3.2. This download is pretty large, almost 1GB, and the finished install occupies over 2.5GB of space. This is also the biggest single install of the bunch. Everything else is much quicker.

Next you need to download and install either Fink or MacPorts, these bits are package managers the are used to install the drivers for serial communication.
Fink > http://www.finkproject.org/download/index.php?phpLang=en
MacPorts > http://www.macports.org/install.php
Make sure you read the installation instructions for the OS you are running, you can head off future issues by reading.

You may ask When am I going to start installing Slim? Well there are a few more things to do but don't worry we are getting there. Download OpenMoco TL engine v0.82 (current version) from the Open Moco site http://openmoco.org/node/23 and unzip. You also need to go to the bottom of the page and download and unzip MsTimer2. I have a folder in the root of my hard drive thats called OpenMoco where I put these. Makes it a bit easier to find.

Lets install the Ardino IDE and get ready for the OpenMoco TL Engine. Go to
http://arduino.cc/en/Main/Software down load and double click to uncompress and then install. It should go pretty quick and easy. Next we need to put MsTimer2 into Arduino's library so it can find it to install with OM. One way to do this is to go to your applications folder, hold down the control key and click and hold (this is for laptops or single button mice, on a 2 button mouse right click to bring up the contextual menu) on the Arduino.app icon.  Then release your mouse clicker on "Show Package Contents" in the menu list.  Navigate through the following folders: Contents/Resources/Java/Libraries and add the MsTimer2 folder inside the Libraries folder.  It loads up when you restart the Arduino Applicaion. Method 2 is to navigate to ~/documents/arduino/ (tilde is a shortcut for users/your account/) make new folder called Libraries and copy MsTimer2 folder into it. Either way works so it's up to you. The files organize a little differently as well.

Now we get to OM-Slim, if we have done our prep this should be painless. One more thing to check is whether a little script in Perl called wget is installed. Open terminal and type in or copy and paste

 wget 'http://www.openmoco.org/downloads/Perl-OpenMoco-Interface-TimeLapse-0.02.zip'

This is a test to see if wget is installed in your system, for some reason wget isn't installed in Leopard by default. After you copy this in hit return if it runs and does not return a line that looks like this -bash: wget: command not found error everything is good. If this error is what you see find wget and install. I found it at Versiontracker http://www.versiontracker.com/dyn/moreinfo/macosx/31606 the install was easy. Run the wget test again if successful find the file and throw away since this is a earlier version we don't need. You may ask are we there yet and yes we are!

Open terminal again and install the serial driver by running this script, if you are using Macports you're good or if you are using Fink change port to fink in the code.

sudo port install p5-device-serialport

Terminal will ask for your administrators passcode enter and hit return. This should run and give back this code . . .

---> Computing dependencies p5--
---> Fetching perl5.8
---> Attempting to fetch perl-.8.9..from <href="http://distfiles.macports.org/perl5.8
--->"
title="http://distfiles.macports.org/perl5.8
--->"
>://distfiles.macports.org/perl5.8
---></> Verifying checksum()perl5.8
---> Extracting perl5.8
---> Applying patches to perl5.8
---> Configuring perl5.8
---> Building perl5.8
---> Staging perl5.8 into destroot
--->  Installing perl5.8 @5.8.9_3
--->  Activating perl5.8 @5.8.9_3
---> Cleaning perl5.8
---> Fetching perl5
---> Verifying checksum()perl5
---> Extracting perl5
---> Configuring perl5
---> Building perl5
---> Staging perl5 into destroot
--->  Installing perl5 @5.8.9_0
--->  Activating perl5 @5.8.9_0
---> Cleaning perl5
---> Fetching p5--
---> Attempting to fetch Device--.04..from <href="http://distfiles.macports.org/perl5
--->"
title="http://distfiles.macports.org/perl5
--->"
>://distfiles.macports.org/perl5
---></> Verifying checksum()p5--
---> Extracting p5--
---> Configuring p5--
---> Building p5--
---> Staging p5--into destroot
--->  Installing p5-device-serialport @1.04_0
--->  Activating p5-device-serialport @1.04_0
---> Cleaning p5--

This was a successful install!

Next to install OM-Slim, in terminal copy/paste or type in the following . . .

mkdir ~/openmoco
cd ~/openmoco
wget 'http://www.openmoco.org/downloads/Perl-OpenMoco-Interface-TimeLapse-0.03.zip'
unzip  Perl-OpenMoco-Interface-TimeLapse-0.03.zip
cd  Perl-OpenMoco-Interface-TimeLapse-0.03/
perl Makefile.PL
sudo make install
cd ~/openmoco
wget 'http://www.openmoco.org/downloads/openmoco-slim-0.12.zip'
unzip  openmoco-slim-0.12.zip
cd  openmoco-slim-0.12
perl openmoco-slim.pl

You can also do this without using wget if you have downloaded the 2 files already. First go to /Users/your account/ and make a folder called openmoco copy both openmoco-slim-0.12.zip and Perl-OpenMoco-Interface-TimeLapse-0.03.zip” into openmoco and unzip. Then copy and paste this code into terminal and hit return.

cd ~/openmoco
cd Perl-API-TimeLapse-0.03
perl Makefile.PL
sudo make install
cd ~/openmoco
cd openmoco-slim
perl openmoco-slim.pl

If we've done our prep right this should run and install OM-Slim with no problems. If the install went well then now we can move onto the Arduino. Close Terminal open Ardino IDE. Next open OpenMoco TL Engine you put in the root navigate to “openmoco_TE_0.82 > OpenMoco_Timelapse_Engine > OpenMoco_Timelapse_Engine.pde” and open. This will open all the files needed. Next go to the Sketch menu > Import Library > MsTimer2. This will put the last piece into the software to upload to your Arduino. Make sure your Arduino is running and set up according to the getting started instructions at the Arduino site. Hit upload and everything should load to your Arduino.

To run OpenMoco-Slim open Terminal again put in

cd ~/openmoco/openmoco-slim
perl openmoco-slim.pl

Hit return and you're off and running in OpenMoco-Slim!

Thanks to David Garden for contributing additional information.

curl replaced wget on Snow Leopard

F9photo's picture

OSX Snow Leopard does not have wget. A program called curl is the wget replacement (No need to download it). If you like wget you can set an alias for wget to curl -O which does exactly the same thing.

Just type:

echo 'alias wget="curl -O"' >> ~/.bash_profile

Your are done. Now just easy to use wget or curl -O in Terminal.

Carson
www.F9photo.com
@F9photo

a few extras

Hi everyone,

Just thought I'd mention a few of the issues/stumbling blocks that had to be overcome with this set of instructions on my install. Hopefully this will be helpful to someone else following the steps under similar circumstances (these additional steps may or may not be necessary).

1) fink didn't seem to work with the 'p5-device-serialport' install. I couldn't find the fink package manually either.
2) port didn't update the .profile (or other similar profile) during the installation so I had to do that manually that by adding the following lines:
export PATH=/opt/local/bin:$PATH
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
3) after unzipping 'Perl-OpenMoco-Interface-TimeLapse-0.03.zip' the folder became 'Perl-API-TimeLapse-0.03' and needed to be changed if the following steps were to remain the same.

Take care all.