- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working with SN8205 and Wiced SDK 3.5.2.
For using IBM Bluemix there is perfectly explanation on below link:
WICED IBM IoT Bluemix quickstart
Which i have followed and got worked demo code for Light sensor(I have not attached light sensor but passed random values which is uploaded to web.)
But now when i have changed
Demo application #define MQTT_BROKER_ADDRESS "quickstart.messaging.internetofthings.ibmcloud.com" | |
#define WICED_TOPIC "iot-2/evt/iotsensor/fmt/json" | |
sprintf(clientId_buffer, "d:quickstart:iotqs-sensor:%02X%02X%02X%02X%02X%02X", mac.octet[0],mac.octet[1],mac.octet[2],mac.octet[3],mac.octet[4],mac.octet[5]); |
My application
#define MQTT_BROKER_ADDRESS "0hjmsp.messaging.internetofthings.ibmcloud.com" (Orgnation Id.messaging.internetofthings.ibmcloud.com) | |
#define WICED_TOPIC "iot-2/evt/intex_Mobile/fmt/json" | |
sprintf(clientId_buffer, "d:0hjmsp:intex_Mobile:sigma1"); |
Where client ID is Orgnazation_ID.Device_type.Device_ID.
Then I'm getting below print on Terminal.
===========================Terminal Log===========================
Initializing Light Sensor
[MQTT] Opening connection...Client ID...d:0hjmsp:intex_Mobile:sigma1
Client ID...d:0hjmsp:intex_Mobile:sigma1
---- Success
[MQTT] Publishing...Light value 2021
Message :{"d":{"name":"WICED4343W","amb_light":2021}}
Wait for response error
Wait for response error
Wait for response error Failed publish
===================================================================
On the server side i'm getting error log in device detail
Invalid userID () for device auth: ClientID='d:0hjmsp:intex_Mobile:sigma1', ClientIP=59.95.32.254 | Apr 11, 2016 2:22:05 PM |
Closed connection from 59.95.32.254. The operation is not authorized. 4 times in the last 5 minutes | Apr 11, 2016 2:22:05 PM |
Invalid userID () for device auth: ClientID='d:0hjmsp:intex_Mobile:sigma1', ClientIP=59.95.32.254 | Apr 11, 2016 2:22:07 PM |
Closed connection from 59.95.32.254. The operation is not authorized. | Apr 11, 2016 2:22:07 PM |
Message | Timestamp |
---|---|
Invalid userID (teksun.krishna@gmail.com) for device auth: ClientID='d:0hjmsp:intex_Mobile:sigma1', ClientIP=59.95.32.254 |
I have also tried by using my username and password in mqtt_conn_open even if this error there.
Also tried using Authentication Key and Authentication Token Key.
So how to provide authentication it seems we can pass private key and ca_certificate key but i'm not finding where to get these certificates.
Regards,
Prashant
Solved! Go to Solution.
- Labels:
-
SDK 3.x
-
Web Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Prashant,
The demo provided is for quickstart, for registered users we are working on the demo and will provide you with more details shortly.
You would have to use a auth-user-token based authentication with username and password for security
thnx
vik86
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Prashant,
The demo provided is for quickstart, for registered users we are working on the demo and will provide you with more details shortly.
You would have to use a auth-user-token based authentication with username and password for security
thnx
vik86
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, by adding username and password in mqtt_open() we are able to got working perfectly.
Thanks a lot.
we have also configured subscribing app using mqtt_app_subscribe() this is executing without error and it wait for data.
How can i send data to subscribed app?
Any help in this case will be high appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good you got it to work, publish to a topic and the subscribe to the same topic, you can see same data published on subscriber.
Presently topic is :
#define WICED_TOPIC "iot-2/evt/intex_Mobile/fmt/json" |
Change it to your own topic and subscribe to that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From documents i have found out for subscribing we have to use cmd to evt.
#define WICED_TOPIC "iot-2/cmd/intex_Mobile/fmt/json"
so i have defined this in Subscribe app and in the mqtt_connection_event_cb i have printed debug msg
case WICED_MQTT_EVENT_TYPE_PUBLISH_MSG_RECEIVED:{
WPRINT_APP_INFO(("Receiveed msg\r\n"));
}
break;
this is working properly and printing on console:
[MQTT] Opening connection...Client ID...d:0hjmsp:intex_Mobile:sigma2
---- Success
[MQTT] Subscribing...Success...
Now when i'm publishing data using second SN8205 that data i can see on bluemix server side but not receiving in subscribing app.