Reputation: 79
I'm following http://m2m.demos.ibm.com/iotstarter.html
I've connected my phone to the IoT service and could see messages in WebUI but provided Node-Red flow seems couldn't connect to IoT data.
I've connected debug node to the IoT In node and don't see any messages.
Authentication type was 'Bluemix' and changed to 'Quickstart' now. Is it related somehow?
[{"id":"2a8baa.ecd60456","type":"comment","name":"Sample 2: IoT Starter accel to color flow","info":"","x":196,"y":275,"z":"3f16d263.e01496","wires":[]},{"id":"b83ddfdb.7b3368","type":"ibmiot in","authentication":"boundService","apiKey":"","inputType":"evt","deviceId":"","applicationId":"","deviceType":"+","eventType":"accel","commandType":"","format":"json","name":"IBM IoT App In","service":"registered","allDevices":true,"allApplications":"","allDeviceTypes":true,"allEvents":false,"allCommands":"","allFormats":false,"x":117,"y":313,"z":"3f16d263.e01496","wires":[["64ebf370.5a0b5c"]]},{"id":"64ebf370.5a0b5c","type":"function","name":"Handle accel","func":"msg.deviceId = msg.payload.d.deviceId;\nmsg.deviceType = msg.payload.d.deviceType;\nmsg.format = \"json\";\n\nvar accelZ = msg.payload.d.acceleration_z;\nvar r = 0.0;\nvar b = 0.0;\nvar g = 0.0;\nif (accelZ > 0) {\n\tg = 255.0;\n} else if (accelZ < 0) {\n\tr = 255.0;\n} else {\n\tr = 104;\n\tg = 109;\n\tb = 115;\n}\na = 1.0;\n\t\nmsg.eventOrCommandType = \"color\";\nmsg.payload = JSON.stringify({\"d\":{\"deviceId\":msg.deviceId, \"r\":r,\"b\":b,\"g\":g,\"alpha\":a}});\n\nreturn msg;","outputs":1,"x":287,"y":313,"z":"3f16d263.e01496","wires":[["56d70240.c2bd14"]]},{"id":"56d70240.c2bd14","type":"ibmiot out","authentication":"boundService","apiKey":"","outputType":"cmd","deviceId":"AAA","deviceType":"iPhone","eventCommandType":"text","format":"json","data":"{\"d\":{\"value\":\"text\"}}","name":"IBM IoT App Out","service":"registered","x":469,"y":313,"z":"3f16d263.e01496","wires":[]}]
Upvotes: 0
Views: 181
Reputation: 2626
The directions in the tutorial state to populate the properties for the ibmiot output node based on the device that was created in Step 2. You should include the deviceID, API key, etc to match the device you registered to your org.
If you require further assistance, let me know your 6 character org.
Upvotes: 0