There are several things needed to create a framework of understanding for this sub-project.
Since the Raspberry Pi (RPi for short) runs various flavors of Linux, several programming languages are natively available such as C, C++, and Python
So, due to the most of the projects that are being integrated are built in Python, (or have python tools) Python is the first choice. however the native MTConnect agent in built in C and C++. This has no significant impact, since they communicate over a TCP/IP port (7878) by default.
Each CubeSpawn Machine has the following parts:
This leads to an architecture based on state machines
Each of the lower blue boxes represents one machine with an MTConnect adapter, and other software running onboard
Each machine has a RPi onboard in the Electrical module shown above.
Each RPi will need to run the following software when connected to a 3D Printer:
Octoprint – to control the printer, Specifically the version of Octoprint intended for the Raspberry Pi, This provides an interface to upload GCode files, so that the printer can create objects. https://github.com/foosel/OctoPi It also has support for the Smoothieboard, an open source motion control board. Since there is also a Smoothieboard in the electrical module this is essential.
This is the part that needs to be built.
A good article exists Here illustrating the roles and purpose of the Agent and Adapter
The complicated part is the architecture of Octoprint (of which I claim a minimal understanding) But, This thread on the octoprint forums has most of the info I have about the architecture. I recall concluding that a plugin for Octoprint to extract the data from the printers processes and pass it to the adapter became the strategy, after the issue was broached. Due to some unexpected behavior from the API.
The MTConnect Adapter will largely consist of an Octoprint plugin that pulls the XYZ (the printer coordinates) and E (The Extruder position) info from the printer, (and after this works, other details may be added, like temperature, fan speeds etc) outputs it to the Agent ( as key value pairs ) on port 7878 or, via configuration files some other port. .
There are a couple of free tools available to display data output by the agent: Here is one: https://github.com/TrakHound/TrakHound-DeviceMonitor