(Includes Mosquitto and Aedes Node-RED Broker Setup)
AVstudio Editor runs inside a browser, so it cannot connect to MQTT using raw TCP (1883/8883).
To work with MQTT, you must connect through:
WS (ws://)
WSS (wss:// — required when using HTTPS)
This guide explains how to configure your environment and provides two options:
Option A: Mosquitto with WebSocket support
Option B: Aedes MQTT Broker directly inside Node-RED
Browsers block raw MQTT connections. They only allow WebSockets.
That means:
❌ No: mqtt://192.168.1.10:1883
✔ Yes: ws://192.168.1.10:9001
✔ Yes: wss://mqtt.myserver.com:9443
If your MQTT broker does not expose WS/WSS, AVstudio Editor cannot connect.
Your broker must support:
Provides a WS/WSS port.
If behind a proxy:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-TypeRequired because browsers block insecure WS under HTTPS.
(Kept minimal since main request was Aedes)
Add to mosquitto.conf:
listener 9001
protocol websocketsRestart:
sudo systemctl restart mosquitto(Recommended for testing, small systems, self-contained development setups)
The Aedes MQTT broker node allows Node-RED to run its own broker with built-in WebSocket support — no Mosquitto needed.
Perfect for:
Local development
Small IoT setups
Quick testing
AVstudio demos
Below is the full setup.
In Node-RED:
Go to Menu → Manage Palette → Install
Search for:
node-red-contrib-aedesClick Install
You will now have two new nodes:
Aedes Broker
Aedes Client
Drag Aedes Broker onto the canvas, double-click it, and set:
|
Field |
Value |
|---|---|
|
MQTT Port |
1883 (can leave as default or disable if not needed) |
|
WS Port |
9001 |
|
WSS Port |
optional (9443) |
|
Anonymous Clients |
enable/disable depending on security |
Turn ON:
✔ “Enable WebSocket” (port 9001)
OPTIONAL: “Enable Secure WebSocket (WSS)” (port 9443)
If Node-RED is behind HTTPS or used remotely, you should enable WSS.
Provide certificate files:
Private key
Certificate
CA file (optional)
Example paths:
/etc/ssl/private/server.key
/etc/ssl/certs/server.crtUse these nodes:
Inject → payload “hello from Node-RED”
Aedes Client → Publish
Aedes Client → Subscribe
Debug
Use:
ws://<your-ip>:9001Example:
ws://192.168.1.50:9001
Topic: avstudio/testIf using WSS:
wss://your-domain.com:9443Inside AVstudio, create a DataSource → MQTT.
|
Setting |
Value |
|---|---|
|
Protocol |
WS |
|
Host |
192.168.1.50 |
|
Port |
9001 |
|
Username |
optional |
|
Password |
optional |
|
Client ID |
e.g. avstudio_client_01 |
Full URL:
ws://192.168.1.50:9001wss://mqtt.myserver.com:9443Make sure certificate is valid (or browser will block before AVstudio even tries).
Once connected:
Sensors
Buttons
Sliders
Dynamic text
Page logic
JavaScript blocks
|
Problem |
Cause |
Fix |
|---|---|---|
|
Connection refused |
WS port disabled |
Enable WS in Aedes or Mosquitto |
|
Browser blocks connection |
Using WS on an HTTPS site |
Must use WSS (secure) |
|
No messages |
Wrong topic / access control |
Verify topic name / ACL |
|
Timeout |
Firewall blocks WS port |
Open 9001/9443 |
|
TLS errors |
Invalid certificate |
Use real CA cert or trusted cert |