My requirement is to create Node red app to read a message from n devices and m gateways and publish to IBM IOT as MQTT using MQTT node, also process and store it in cloudant DB. If there any update then the device should subscribe for the commands.
I read from IBM blue mix portal and was able to send and receive the message for gateways using MQTT node to IBM IOT node.
Need clarification on the below,
can use node red simulator to send message from device/gateway
simultaneously (because gateway will send the message directly to IBM Watson IOT but devices always will send a message to gateway)
How to identify or differentiate the message received from device
/Gateway in Watson IOT node
How the sequence of the message published? is in FIFO order?
Time to live for the message? If MQTT broker disconnected then how
the message will be published like i.e how many messages can be
queued and size of the queue?
How can we notify MQTT /device disconnected to the other end
Each message published to the Watson IoT platform has a unique client ID to differentiate the origin of the publisher.
IoT uses a Pub/Sub architecture so messages are published to topics and received by the subscribers. It is not a point-to-point queue architecture.
Message are saved internally by the Watson IoT platform and you have the option of configuring cloudant DB as historian data storage for your messages as described in this tutorial.
Related
Previously I have setup a device to connect to Google Cloud IoT Core and when the device would connect it would get a callback from the server to a topic with the device configuration file.
I am currently moving off of that to a local MQTT broker on a Raspberry Pi with Mosquitto running. What I am trying to do is figure out how to replicate the sending of the configuration file when connected.
Is there a way for other clients to know when a new client connects? If so I could then just have a client running on the Pi that would is responsible for sending messages.
The thought was that the Pi would hold the configuration file of the connected device and once it connects it would be sent back over to it via a topic for that device
Or is there another solution that I dont even know about yet that accomplishes this? I have not set up my own end to end MQTT communication before so I dont exactly have a path forward here
Is there a way for other clients to know when a new client connects?
Not as part of the protocol; but it's simple enough to publish a message upon connection. I can see a few ways of accomplishing your aim:
Publish all of the configurations as retained messages. You would require a 'config' topic per device for this (say config/uniquedevicename). When the client starts up it will subscribe to the relevant topic and receive its configuration (the 'server' would need to publish a message to each of the config channels with the retain flag set).
Upon starting the device publishes a message requesting its configuration; the server is subscribed to the relevant topic and responds with the configuration. You can use preset topics for the response or pass the topic in as part of the request.
For one (or a small number of devices) option 1 would be very simple to implement; however option 2 provides more flexibility.
I'm a student and I have a small IOT project at my university. I tried to connect MQTT Dash to IBM BlueMix IOT Flatform but failed. I can't publish/subscribe data on IBM IOT Platform. What do iI need to do?
all you need to do is generate and APIKey/Token like in:
https://console.bluemix.net/docs/services/IoT/platform_authorization.html#connecting-applications
then, to receive the messages, you need to subscribe to a topic as in
iot-2/type/device_type/id/device_id/cmd/command_id/fmt/format_string
In your case:
iot-2/type/Android/id/samsung/cmd/temperature/fmt/json
Details on publishing and subscribing are here:
https://console.bluemix.net/docs/services/IoT/applications/mqtt.html#mqtt
I have accidentally deleted Watson IoT service on my space. I have created a recent one and tried to configure a mqtt subscriber via node-red to send data to the new service.
It always shows disconnected to the service even though I did all the configuration requirements. ( Server , topic , token authentification .. ).
PS: I am using port 1883 and I have changed the service security to TLS optional.
What should I look up for ? Do I have to change other changed settings ?
I know we can send heartbeat payload through device monitoring topic. But do we have any another way where any IP capable device can send heartbeat to IBM Watson Platform through any IBM services or database for device tracking?
I assume with "any IP capable device" you mean you don't want/can install a MQTT stack?
You can use HTTP(S) instead, as described here
fyi: You don't need the IBM API client, any MQTT library is sufficient then you can also use MQTT instead HTTP(S)
I am building an iOS app to control my Raspberry Pi over MQTT. I want to be able to send control commands from my iPhone to the Pi and have the Pi respond with a status update.
The Pi is running Node-RED and can both send and receive both events and commands to IBM IoT Foundation (verified from a Bluemix Node-RED application).
The iPhone Swift app is using https://cocoapods.org/pods/MQTTClient (Note - does not specifically list IBM IoT as a tested platform).
From the Swift app, I have successfully connected to IBM IoTF and sent events which the Pi receives. I have also successfully subscribed to command topics in the form "iot-2/cmd/streamStarted/fmt/json", but never receive a message. If I try to publish a command in the form "iot-2/cmd/startStream/fmt/json" or subscribe to events in the form "iot-2/evt/streamStarted/fmt/json" or "iot-2/type/myPi/id/<myPiID>/evt/streamStarted/fmt/json", the connection immediately closes.
The bottom line is that I need to get a status message from the Pi to the iPhone in some way. I don't really care if it is an event, a command or something else. I have been successful doing this with test.mosquitto.org, events but not IoT Foundation.
Only applications can send commands to a device. You can't send a command from one device to another. Is the iphone swift app connecting to IoT Foundation as an application or trying to connect as a device?