0
votes

How could you find the direct location of the IoT. ASAP please!

We have tired many properties but none of them provided us with the current location. We tried using msg.payload.d.az but it only works when device shakes.

1
What do you mean by 'location of the IoT'? You'll need to explain what you're doing for us to understand how to help. - knolleary

1 Answers

0
votes

Node-RED doesn't know where your stuff is, but if your "IoT" knows where it is, and has written that data to the msg object in your flows, you can try the following:

If you aren't sure what property of msg contains the information you want, try opening the tailing logs for your app (the debug console buffer isn't very large, so if your objects are a decent size it will probably get cut off in the GUI) and then inject your flows with a node.warn(msg) thrown at a point in the flow that makes sense. If you don't see what you're looking for, move your node.warn(msg) somewhere else in the flow and see if it is there. Standard debugging procedures follow. You haven't specified anything about your environment, but if you're on Bluemix (best guess? many people seem to do Node-RED from their SDK) and have the CF CLI installed you can just do these command line commands to access the logs:

cf login -a https://api.ng.bluemix.net
enter your credentials, then do:
cf logs <app_name>

Look for the log messages with App in them, as opposed to RTR, they will contain the node.warn(msg) and other node outputs. Bluemix also has logs in the devops gui, but they can be difficult to work with at times.

If you aren't on Bluemix, then see your specific environment documentation for how to access the logs.

You will get everything contained in the message object, and if the property you seek is in msg, you can put the log output into a prettifier and find it.

If you can't find your property after examining the entire content of msg, then you need to trace back through your flows/input sources to ID where you thought it was being added to msg and fix the problem.