ZeroMQ adapter

You can apply an adapter to your device to add ZeroMQ messaging functionality to your Formant organization. Using this adapter, you can ingest data in ZeroMQ message format into Formant, and send commands from your Formant device to a ZeroMQ message channel.

Getting the adapter

Reach out to us to get the adapter. You can reach us via the Intercom messenger in the bottom-right corner of this page, or by sending an email to [email protected].

Installation

Once you've received the adapter, follow the instructions in Add an adapter to add it to your Formant organization and apply it to your device.

Configuration

Once you've added the adapter to your organization and applied it to your device, you can configure ZeroMQ parameters as seen in Step 4 of Add an adapter.

These will be dependent on your ZeroMQ network settings. For more information, see the ZeroMQ website.

Options you can configure include:

  • Ports scanned by Formant for ZeroMQ-enabled communications
  • Socket configuration
  • Message topic blacklist
  • Commands to be sent by Formant
  • Port over which commands are sent

Test your configuration

You can ensure that the adapter has installed and is configured correctly using the tests provided in the tests folder within the provided zip file.

Using a device

  1. After installing the adapter to your device, extract all files from the provided zip folder.
  2. Open the extracted folder and navigate to tests.
  3. Run a test from the root folder zmq_adapter, e.g., python tests/test_publish.py.
    • For commands, run python tests/test_command.py and issue the command from Formant cloud.

On your local machine

You can test your code without connecting and deploying to a robot. In order to do so, you'll have to modify the adapter not to connect to an external device.

In adapter.py,

  1. Comment out the following code block:
    self.configuration_validator = JsonSchemaValidator(
        self.fclient,
        CONFIG_NAME,
        Adapter.initialize_config,
        validate=False,
    )
  1. Just above that now-commented code block, add the following lines:
Adapter.config = Config(json.loads(open("./tests/config.json").read())\[CONFIG_NAME])
Adapter.is_config_initialized = True

Troubleshooting

If you're having trouble installing or running the ZeroMQ adapter:

  • Check your agent logs for any errors.
  • When running the test programs, check the terminal output for any error messages or warnings.

📘

If you notice an issue with this page or need help, please reach out to us! Use the 'Did this page help you?' buttons below, or get in contact with our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or at [email protected].