Programming Interface¶
The MTM-USBEtherStem is capable of many features. These features are organized into groups called entities. Through these entities we can access the vast features of the MTM-USBEtherStem.
A complete list of all entities and functions can be found in the Module Entities page.
Software Control¶
A BrainStem link can be established that will give the user access to the resources available on the MTM-USBEtherStem. The module can then be controlled via a host running BrainStem APIs or operated independently by running locally embedded, user-defined programs based on Acroname’s BrainStem Reflex language in the RTOS. A BrainStem link to the MTM-USBEtherStem can be established via one of three (3) interfaces: the onboard USB connection, the card-edge USB connection, or through another MTM module using the BrainStemprotocol (more on this interface below). For the USB connection options, once the MTM-USBEtherStem is attached to a host machine, a user can connect to it via software API:
stem.discoverAndConnect(linkType, serialNumber)
The MTM-USBEtherStem can also work within a network of other Brainstem modules, such as in a test fixture, to give access to the capabilities of all networked modules. On the MTM platform, networked modules communicate using the Brainstem protocol, which is transmitted over I2C. Each MTM-USBEtherStem is uniquely addressable via hardware or software to avoid communication conflicts on the I2C bus.
Link and TCP/IP Settings¶
The MTM-USBEtherStem supports host computer connections over its Ethernet jack via TCP/IP sockets. The MTM-USBEtherStem is designed to interact on the local network segment only. Typical setup is a direct Ethernet connection between a host test machine and the MTM-EtherStem. The host can run a DHCP server to provide an IP address to the module or, without a DHCP server, the MTM-USBEtherStem will fall back to a static IP address of 192.168.44.42/24 when it does not receive a response to DHCP requests. In the fallback IP configuration, manually configuring the host machine interface to communicate on this subnet will enable communication to the module.
The module features a limited DHCP client which will not function across a network bridge or other gateway mechanism. The MTM-USBEtherStem will respond to ICMP “ping” requests including broadcast requests. The brainstem API interface performs a discovery process prior to establishing communication with the MTM-EtherStem. Brainstem discovery over IP is accomplished using a UDP multicast request on port 9888, and a response on the stem to the host UDP port 9889. The MTM-USBEtherStem listens for socket connections on TCP port 8000. Firewall rules will need to be configured allowing the outgoing multicast request on 9888 and incoming response on 9889, as well as outgoing socket TCP connections to port 8000.