So I'm receiving data from an mqtt broker in Node-RED and trying to forward the data to MaxMSP using OSC. In Max it says "binding to port", but it doesn't print out any data when there's new data from the mqtt broker.
I have tried:
- originally the Max was on a different device, but now I'm just trying to make it work on the same machine, so I'm using localhost
- different syntax
- in Max: using [print osc.msg] instead of just [print], no [route]-object,..
- in Node-RED: path of the [OSC]-node without localhost or without the mqtt-topic,..
- different port (mainly 7400 instead of 8080, which seems to be the default OSC port in Max)
Relevant Node-RED json code:
[
{
"id": "c008bd7bfecf40f3",
"type": "mqtt in",
"z": "9a59961da964fce0",
"name": "lightAnalog",
"topic": "IAVS/C3/lightAnalog",
"qos": "0",
"datatype": "utf8",
"broker": "9fd8c170d7677b00",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 140,
"y": 180,
"wires": [
[
"4a23d929de751c8b",
"fb146ae96814d644"
]
]
},
{
"id": "4a23d929de751c8b",
"type": "ui_gauge",
"z": "9a59961da964fce0",
"name": "",
"group": "404cfca60f84dcfd",
"order": 0,
"width": 0,
"height": 0,
"gtype": "compass",
"title": "lightAnalog",
"label": "units",
"format": "{{value}}",
"min": 0,
"max": 10,
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"diff": false,
"className": "",
"x": 390,
"y": 180,
"wires": []
},
{
"id": "fb146ae96814d644",
"type": "osc",
"z": "9a59961da964fce0",
"name": "",
"path": "localhost:8080/IAVS/C3/lightAnalog",
"metadata": false,
"x": 310,
"y": 80,
"wires": [
[]
]
},
{
"id": "9fd8c170d7677b00",
"type": "mqtt-broker",
"name": "Mqtt-Broker",
"broker": "tcp://broker.mqtt.cool",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": "",
"credentials": {}
},
{
"id": "404cfca60f84dcfd",
"type": "ui_group",
"name": "Light",
"tab": "bc78a8d.fba5b58",
"order": 4,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "bc78a8d.fba5b58",
"type": "ui_tab",
"name": "Dashboard",
"icon": "dashboard",
"order": 2,
"disabled": false,
"hidden": false
}
]
Relevant MaxMSP code:
{
"boxes" : [ {
"box" : {
"maxclass" : "newobj",
"text" : "print",
"patching_rect" : [ 647.0, 170.0, 32.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"id" : "obj-33"
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route /IAVS/C3/lightAnalog",
"patching_rect" : [ 755.0, 133.0, 150.0, 22.0 ],
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"id" : "obj-30"
}
}
, {
"box" : {
"maxclass" : "message",
"text" : "port 8080",
"patching_rect" : [ 634.5, 27.0, 59.0, 22.0 ],
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"id" : "obj-29"
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "udpreceive 8080",
"patching_rect" : [ 647.0, 81.0, 97.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"id" : "obj-27"
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-30", 0 ],
"destination" : [ "obj-33", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-27", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-30", 0 ]
}
}
],
"appversion" : {
"major" : 8,
"minor" : 3,
"revision" : 2,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box"
}
In case you don't know how to test the mqtt broker, visit this page, just connect to the first broker, paste IAVS/C3/lightAnaloginto into the topic filter-field and hit subscribe. If you want to test data, just paste IAVS/C3/lightAnaloginto into the destination of the message-field, type something in the message to be sent-field and hit publish.