I understand that we can add IBMIoT nodes to node-red in bluemix and then read the data from the node and do any processing of the data as required by the use case. For this we need to give a device id to the node. Is it possible to create a flow where the device id is dynamic. Let's say I have 10000 sensors / devices. I want to read the data for each of these sensors in a mulitplexed fashion by changing the device id.
It is impossible to create 10000 device nodes. So, what is the best way to manage this number of sensors / devices?
For the In nodes, set the deviceId to All.
Then use the msg.deviceId property to figure out which deviceId it is. This can also be used to used with the IBM IoT Out node. When msg.deviceId is set on a message sent to the Out node, it will over-ride what is set in the node itself.
If it isn't working for you, please add your code.
We can tick All option (device Id) in IBM IoT node option pop up , which helps to connect all Registered devices with different deviceId to Single IBM IoT Node.
Related
I am trying to connect multiple Nodemcu with Ubidots and finally add one master device that can read all the from other slave devices. Can I do it directly from Ubidots IoT Platform?
Yes, you can do it directly with Ubidots. I recommend you to manage your data using MQTT as a communication protocol. Check out Ubidots Docs for detailed info.
You have to use the publish example for the slave nodes, and from the master node, you must use the subscribe example to get the values from the different variables.
The code of this project can serve as a reference for you to subscribe to multiple variables at the same time.
What is the best (and simplest) way to regularly send data from a database to an IoT device at a certain interval?
In this case I have the data in Google Cloud Datastore, and want to send it to Particle Photons (possibly via Particle Cloud, but not necessarily). But I might also be using other IoT devices and/or other database alternative like Cloud Firestore for instance, in future, so it's great if the solution is easily adoptable to this situation.
Seems like you want some kind of a cron job that takes data from datastore (or any database for that matter) and sends it to your IoT device. Assuming your IoT can be reached via a REST end point, you can use Cloud Scheduler (https://cloud.google.com/scheduler/) and do the logic. The target to the cloud scheduler can be an app engine instance or a cloud function.
I'm working on a e-health simulation project using Castalia simulator. I'm using the ValueReporting application scenario where all sensor nodes send their sampled medical data to a sink node. From there i want to send them to a remote hospital network. For that, i need to connect the sink node to an eventuel router. Is there any way i can achieve this ? Thank you for your help.
I am using a Watson IOT Output (wiotp out) in a Node-RED flow on my Raspberry PI and am having issues with the connection repeatedly disconnecting and then re-connecting.
Here is a screenshot of my Credentials Node and one of my IOT Out Node.
The connection is configured so that I can send messages to the cloud and successfully have them trigger a flow in my cloud Node-RED instance.
The problem I'm having is that when I attempt to send a string array as my payload, very items in the array actually make it through before the service disconnects. I am limited to around 3-5 strings at a time, which is frustrating because I am losing 195-197 of the 200 items I am trying to send to the IOT platform.
How can I keep a persistent connection and make sure my entire payload makes it through to the IOT service?
If you're seeing very frequent disconnects, it can often mean that you're inadvertently performing clientId stealing (i.e., two MQTT clients are fighting over the same clientId). You can confirm this by looking at the device connection logs in the device drilldown panel: you'll see evidence of log messages such as "The client ID was reused."
Ben
I am developing an iPhone application that allows to basically click through a series of actions. These series are predefined and synced with a common configuration server.
That app might be running on multiple devices at the same time. All devices are assumed to have the same series of actions defined on them. All devices are considered equal, there is not a server and multiple clients or something like that.
(Only) one of these devices is used by a person at any given time, it is however possible that the person switches to a different device at any given time. All "passive" devices need to be synchronized with the active one, so that they display the same action.
The whole thing should happen as automatically as possible. No selection of devices, configuration, all devices in the same network take part in the same series of actions.
One additional requirement is that a device could join during a presentation (a series of actions) and needs to jump to the currently active action.
Right now, I see two options to implement the networking/communication part of that:
Bonjour. I have implemented a working prototype that can automatically connect with one (1) other device in the network and communicate with that. I am not sure at this point how much additional work the "multiple devices" requirement is. Would I have to open a set of connections for every device and manually send the sync events to all of them? Is there a better way or does bonjour provide anything to help me with that? What does Bonjour provide given that I want to communicate with every device in the network anyway?
Multicast with AsyncUdpSocket. Simply define a port and send multicast sync events out to that port. I guess the main issue compared to using bonjour with tcp would be that the connection is not safe and packets could be lost. This is however in a private, protected wlan network with low traffic if that would really be an issue. Are there other disadvantages that I'm not seeing? Because that sounds like a relatively easy option at this point...
Which one would you suggest? Or is there another, better alternative that I'm not thinking of?
You should check out GameKit (built in to iOS)--they have a lot of the machinery you need in a convenient package. You can easily discover peers on the network and easily send data back for forth between clients (broadcast or peer to peer)
In my experience Bonjour is perfect for what you want. There's an excellent tutorial with associated source code: Chatty that can be easily modified to suit your purposes.
I hobbled together a distributed message bus for the iphone (no centralized server) that would work great for this. It should be noted that the UI guy made a mess of the code, so thar' be dragons there: https://code.google.com/p/iphonebusmiddleware/
The basic idea is to use bonjour to form a network with leader election. The leader becomes the hub through which all the slaves subscribe to topics of interest. Then any message sent to a given topic is delivered to every node subscribed to said topic. A master disconnection simple means restarting the leader election process.