0

I am working with Bluemix tutorial recipe "Real Time Data Analysis Using IBM Watson IoT Platform Analytics" presented here: https://developer.ibm.com/recipes/tutorials/real-time-data-analysis-using-ibm-watson-iot-platform-analytics

I am not seeing the behavior in my Watson IoT dashboard as described; the phone device does connect and register itself but I see no events or data. In the node server logs a couple things seem concerning:

  1. 404 on fetch of util.js; in fact that file is not in my code repository downloaded from the recipe's github.

  2. Three deprecated warnings:

    ...deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead at node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:56:20

    ...deprecated limit: Restrict request size at location of read at node_modules/express/node_modules/connect/lib/middleware/multipart.js:86:15

    ...deprecated methodOverride: use method-override npm module instead at app.js:63:17

The phone device shows some fluttering data values but stays in state "connecting". On the WatsonIoT dashboard it shows registered but "Disconnected".

Is the missing util.js a fatal condition? If not then how next to troubleshoot it as I am new to the whole package?

ValerieLampkin
  • 2,620
  • 13
  • 27
JWPerry
  • 95
  • 6

1 Answers1

2

Solved. The recipe checks for whether it needs to create its cloudant database, unaware that I'm sharing my cloudant service instance with other apps; it finds a db exists, blithely assumes that's the one it needs, and skips the create. Change app.js from:

cloudant.db.list(function(err, all_dbs) {
    if (all_dbs.length == 0) {
        // first time -- need to create the iotzone-devices database
        cloudant.db.create('device_credentials', function()

to e.g.:

cloudant.db.list(function(err, all_dbs) {
    if (all_dbs.indexOf(dbName) < 0) {
        // first time -- need to create the iotzone-devices database
        cloudant.db.create(dbName, function()
        [etc...]

With the db in place, WatsonIoT accepts events coming from phone and shows the data as expected.

I found this by following the print statements in log.

JWPerry
  • 95
  • 6