This morning I had to set up the MTConnect agent on a Debian Wheezy system. Although I’ve used Ubuntu for several years, this was my first experience with proper Debian. Fortunately for me, there is already an excellent tutorial by Prince on setting up an MTConnect agent on Ubuntu to use as a starting point.
In the process, I found that my Debian install was missing some needed packages. I blame this on my own impatience: rather than wait for the full DVD download, I downloaded the “small CD” ISO image, which is smaller and probably excludes a lot of rarely-used packages.
Here’s what I ended up doing:
1) Install some packages.
apt-get install libxml2 libxml2-dev cmake git build-essential libcppunit-dev
The first few packages are listed on Prince’s blog. I included git so that I could fetch the MTConnect agent repository from GitHub. The build-essentials package probably would’ve been included had I downloaded the full distro DVD, and includes the C++ compiler. The libcppunit-dev package included the CppUnit package needed to build the agent.
2) Fetch the MTConnect agent source code.
git clone https://github.com/mtconnect/cppagent.git
3) Build the agent.
cd cppagent cmake . make
With all of the prerequisite packages in place, the build proceeded smoothly.
4) Run the agent.
cd agent ./agent daemonize
So is the agent running? Let’s check:
nestat -anp --tcp
There it is, running on port 5000. The next thing to do would be to test it with curl, but that’s not installed on this barebones system, either. Falling back to wget:
wget localhost:5000 wget localhost:5000/current
And now I have two files: index.html contains the result of my probe, and current contains the result of my current request. The MTConnect agent is working. Cool beans. On to setting up the adapters…