A long time ago on a blog far, far away, I wrote an article called “Set up an MTConnect Agent in three or so steps”. This became one of the most visited articles I have ever written, and is still being viewed four years later. However, much has changed in the MTConnect world in the past four years, so I wanted to take another look at installing an MTConnect agent.
Possibly the biggest change is the development of a new MTConnect agent in NodeJS. From the beginning, MTConnect has striven to adopt popular and open web technologies. This is why the protocol is based on HTTP and XML. NodeJS is a popular and widely-used platform for the web, and continues in that tradition.
Prerequisites
Before installing the NodeJS MTConnect Agent, you will need to make sure NodeJS and NPM are installed on your server. Downloads and instructions for this may be found at the NodeJS Foundation website. You will also want to install Git SCM in order to clone the agent from GitHub.
Installing the Agent
From an open terminal (these commands will work on Unix/Linux or in the Windows command prompt), enter the following:
git clone https://github.com/mtconnect/mtconnect-agent
This will clone the MTConnect agent project into a directory named mtconnect-agent. Next, enter that directory with:
cd mtconnect-agent
Now that you are in the mtconnect-agent directory, use NPM to install the project dependencies:
npm install
NPM will start to download and install all of the project’s dependencies. This will take some time. Once installed, you can run the MTConnect Agent by running:
npm start
When you do this, the MTConnect Agent will start running on its default port of 7000.
Device Configuration
Another major addition to MTConnect in the past four years is an adapter discovery protocol. The agent uses SSDP (Simple Service Discovery Protocol), a standard network discovery protocol, to discover any adapters on the network. Once discovered, it queries them for device information.
At this point, if your devices are new enough to be aware of the discovery protocol, the agent will work. Otherwise, you will likely see the message “Cannot find device:” if you load the agent URL. The next step in this case will be proper device configuration.