openJIIDocs
MultispeQ MQTT Tool

API reference

Current MMI commands, environment variables, and Python module boundaries.

This is the reference for the Python development tool at apps/tools/multispeq_mqtt_interface, not the platform MQTT schema. For channels and messages use the generated MQTT API reference.

Console entry point

setup.py registers:

mmi = multispeq_mqtt_interface.main:main

The entry point starts IoTMqttCli, a Python cmd.Cmd loop.

Commands

CommandShortcutMethod
connectcCommandHandler.connect()
disconnectdCommandHandler.disconnect()
pingpCommandHandler.test_connection()
publishmCommandHandler.publish()
continuous_publishkCommandHandler.continuous_publish()
statussCommandHandler.status()
configfCommandHandler.display_config()
set_topictCommandHandler.set_topic_params()
connect_devicevCommandHandler.connect_device()
set_plantnoneCommandHandler.set_plant_data()
helphinherited command help
clearnoneclear terminal and redraw intro
exit / quitq for exitdisconnect and terminate process

The publish method accepts a text argument through cmd.Cmd, but the implementation does not parse or use it as a payload.

Environment variables

NameParsed asDefault
AWS_IOT_ENDPOINTstringrepository-coded development endpoint
AWS_IOT_PORTinteger8883
AWS_IOT_CERT_FILEPATHpathNone
AWS_IOT_PRIVATE_KEY_FILEPATHpathNone
AWS_IOT_CA_FILEPATHpathNone
AWS_IOT_CLIENT_IDstringtest-<uuid>
AWS_IOT_TOPICstringexperiment ingestion template with cli_test_sensor_id
AWS_IOT_KEEP_ALIVEinteger seconds30
AWS_IOT_CLEAN_SESSIONcase-insensitive boolean stringFalse
AWS_IOT_PROXY_HOSTstringNone
AWS_IOT_PROXY_PORTinteger0

AWS_REGION, LOG_LEVEL, and automatic .env loading appeared in older docs but are not consumed by current code.

Python modules

ModulePublic responsibility
main.pyProcess entry and top-level error handling.
cli/interface.pyCommand loop, shortcuts, and help.
cli/commands.pyWorkflow orchestration and in-memory state.
cli/prompts.pyExperiment/protocol, certificate, port, and plant prompts.
utils/config.pyEnvironment parsing, display, path/endpoint validation, topic update.
mqtt/connection.pyAWS IoT mTLS connection lifecycle and callbacks.
mqtt/client.pyJSON serialization, QoS 1 publish, and endpoint ping.
device/device.pyJII-MultispeQ port, connection, SPAD measurement, analysis, and dump file.

Return behavior

  • MQTTConnection.connect() returns True/False after waiting up to ten seconds.
  • MQTTConnection.disconnect() returns True/False after waiting up to three seconds.
  • MQTTClient.publish() returns True after the SDK publish future resolves, otherwise None on handled error.
  • DeviceManager.measure_and_analyze() returns analyzed data or None after printing a caught device error.

These are internal development APIs without compatibility guarantees. Prefer the interactive tool unless you are contributing to it, and cover behavior changes with tests before treating them as stable automation interfaces.

On this page