World Operating System (WOS)
The wosapp.js module provides a Node.js interface for connecting to the WOS MQTT bus.
const WOSApp = require('./wosapp.js');
const app = new WOSApp();
// Connect to localhost (default)
app.ConnectToWOS("MyApp", onConnect);
// Connect to a remote MQTT server
app.ConnectToWOS("MyApp", onConnect, "mqtt.example.com");Configuration:
- Parameter: Pass the MQTT host as the third parameter to
ConnectToWOS() - Default: Connects to
localhostif no host is specified
The wosapp.py module provides a Python interface for connecting to the WOS MQTT bus.
from wosapp import WOSApp
app = WOSApp()
# Connect to localhost (default)
app.ConnectToWOS("MyApp", 1883, on_connect)
# Connect to a remote MQTT server
app.ConnectToWOS("MyApp", 1883, on_connect, mqttHost="mqtt.example.com")Configuration:
- Parameter: Pass the MQTT host as the
mqttHostparameter toConnectToWOS() - Default: Connects to
localhostif no host is specified
Connection errors will be raised as exceptions and should be handled by the calling code. Errors are also logged for debugging purposes.