My environment is like this ... <ti sensortag="" (registerd)=""> -> <raspberry pi="" (="" node-red="" )=""> -> <iot cloud=""> -> < node-red store mongoDB (bluemix)>
When I receive event message from sensortag, i put event identification from sensortag on Topics and put parameters in payload and dispatch to iot cloud as follows.
iot-2/evt/temperature/fmt/json (Object) { "topic": "iot-2/evt/temperature/fmt/json", "payload": "{"d":{"myName":"sensortag","object":"21.5","ambient":"26.0\"}}" }
However when I receive event message through node-Red, topic looks like overwrite with the name of "status". and all the event message is just "status" as below.
iot-2/type/iotsample-ti-bbst/id/bc6a29ac6536/evt/status/fmt/json
When I retrieve event message from IBM IoT cloud, "Topic" id of my "iot cloud node red" is like below.
iot-2/type/iotsample-ti-bbst/id/bc6a29ac6536/evt/+/fmt/json
Anything wrong with me? or any issue on IBM IoT Cloud side?
Answer by David-Parker (148) | Aug 12, 2014 at 05:01 AM
It's definitely possible to use any eventID, the samples we provide use an eventID of "status" unless they have been modified, what code are you using to publish your event on the "iot-2/evt/temperature/fmt/json" topic?
Answer by B Alton (638) | Aug 12, 2014 at 05:53 AM
Good day,
Thanks for the question.
I just had a quick play and I could not reproduce the problem using the IoT Service alone.
I made up a device that published to:
iot-2/evt/temperature/fmt/json
-Payload: {"d":{"name":"value"}}
The application key I had was able to subscribe and received a message on topic:
iot-2/type/iotsample-ti-bbst/id/TestTag/evt/temperature/fmt/json
-Payload: {"d":{"name":"value"}}
Then, just to be doubly sure, I looked up the last event in the web UI and it gave showed the payload (from the historian feature) as:
{"evt_type":"temperature","timestamp":{},"evt":{"name":"value"}}
That being said, I'm going to guess the problem is in the Node-Red side of things. However, just to be extra sure, what does your historian feature say?
(from the devices view, check the Last Event column)
We may need to find a Node-Red expert to check their side of things as well, but it would help if you inform us of what Last Event gives as the 'Event' of your custom message.
-Ben
Answer by noriando (11) | Aug 12, 2014 at 11:46 PM
Thanks for your response.
My understanding is that I can see only payload data at 'Event' @ dashboard, not Topic. Is there any way to check the contents of topic @ dashboard of registered device?
Good day,
If your device publishes to 'iot-2/evt/WHATEVER/fmt/json', you will be able to see an event of 'WHATEVER' in the portal.
Just to be clear that we're attacking this from the right angle:
From the main site (internetofthings.ibmcloud):
Log in.
Go to the devices tab.
In the 'Last Event' column for the relevant device, click 'More'.
In the panel that appears you should have a table of Event Type, Event and Timestamp.
The Event Type will be 'Message published'. The Event will be 'WHATEVER' in this case (it will be whatever your device published to after the 'evt' sub-topic).
If you click on the row, you will get a pop-up where you can view the payload. For me, is was:
{"evt_type":"WHATEVER","timestamp":{},"evt":{"name":"value"}}
The payload data is there, but it gives you the event details as well - one of which can be used to figure out the topic that you published to.
Alternatively, if you want me to check it out for you, you'll need to get your device sending messages again (it doesn't look like there's any recent activity for your device).
The next thing we may need to check is the application that receives this event - what application are you using to do this? Any configuration you think may be useful to help us?
-Ben
Answer by noriando (11) | Aug 17, 2014 at 10:45 AM
I do not think I can check Topic information at portal. Please see below screen shhot.
PS:My Raspberry Pi crushed few days back ... took some time to recover .. sorry for late reply.
Interesting... in so many ways...
Firstly, my screen is different from yours in that the payload content is different (sadly, I seem to be having trouble with the historian feature right now and can't provide a screenshot).
Secondly, your screenshot seems to suggest that the message was actually published as 'status' - or the device published it under 'iot-2/evt/status/fmt/json' (which is doubly interesting as the sample source code says it should be 'sample').
The problem may exist between your device and our messaging infrastructure - but I really want historian up and running before I can be sure.
So, just saying thanks for the heads up, I'm scratching my head and I'll look into it more tomorrow (or at least try to).
-Ben
Answer by noriando (11) | Aug 17, 2014 at 07:45 PM
Here is my Node-RED console when it send message to IOT Cloud. This is FYI and for tomorrow!!
I'm still not getting too far on this.
Can I ask, do you still have this problem with the latest version of our code?
Can you show how you are using Node-RED?
Answer by B Alton (638) | Aug 18, 2014 at 05:54 AM
Here's what my screen shows (when I get my Fake Tag to publish to 'iot-2/evt/whatever/fmt/json'):
(I've highlighted the parts where it shows my 'whatever' sub-topic)
I'll investigate this further, but for some amazing reason we've got different views in our web browsers (I tried both Firefox and Chrome and got similar info).
-Ben
Answer by noriando (11) | Aug 25, 2014 at 10:36 AM
Sorry for late response. My pi was broken .. and bought new one. Also Sensortag scan is not stable .. getting support from Sandeep for noble.
Well,looks like Iot Cloud recognize event ...
However, when it comes to node-red through bluemix .. value of topic has been changed ... I mean event id become status.
and payload is like this ...
Here is my node-red @ Pi and Bluemix ...
I can think only IOT cloud overwrite my event id ....
how to send custom event from raspberry pi 1 Answer
My application wont start after trying to enable security 2 Answers
how to change the default broker used by iot-app Node in Node-RED? 1 Answer
Device connecting and disconnecting alternatively. 2 Answers
Can't get a JSON object in node red to flow from HTTP request to a Cloudant database in Bluemix 1 Answer