IBMStreams / streamsx.waterConservation.starterKit

Starter kit for smart and connected sprinkler system using Apache Edgent, Streaming Analytics and Insights for Weather
Apache License 2.0
7 stars 10 forks source link

edgent smart sprinkler app does not connect to Bluemix stage 1 env #10

Open ivanstreams opened 8 years ago

ivanstreams commented 8 years ago

Yesterday I deployed the water conservation sample in the Bluemix stage1 env. I had to make a few changes to work in stage1 env (with the help of Kendrick) but in the end the Bluemix app deployed OK. However, when I try to run the edgent smart sprinkler app, it tries to connect to the wrong mqtt host. It is missing the "staging" from the host name. How can I change that?

C:\Dev_Streams\WaterIvanAuto>java -jar smartsprinkler.edgent-1.1.0.jar UI host configure to: http://WaterIvanAuto.stage1.mybluemix.net Running Simulation: true Moisture: 946.9408616119974 Sprinkler: false Avg: 946.9408616119974 Aug 23, 2016 8:58:14 AM com.ibm.iotf.client.AbstractClient createClient INFO: pool-1-thread-1-2822ab31-0af4-4e3b-8240-314af158b3da: Org ID = cvsmok Client ID = d:cvsmok:iotSprinkler:rPiSprinkler1 Aug 23, 2016 8:58:15 AM com.ibm.iotf.client.AbstractClient connect INFO: pool-1-thread-1-2822ab31-0af4-4e3b-8240-314af158b3da: Connecting client d:cvsmok:iotSprinkler:rPiSprinkler1 to ssl://cvsmok.messaging.internetofthings.ibmcloud.com:8883 (attempt #1)...

My mqtt host name: "mqtt_host": "cvsmok.messaging.staging.internetofthings.ibmcloud.com",

ddebrunner commented 8 years ago

In your device properties try setting the domain property to staging.internetofthings.ibmcloud.com.

ivanstreams commented 8 years ago

Like this?

[device] org = cvsmok domain = staging.internetofthings.ibmcloud.com type = iotSprinkler id = rPiSprinkler1 auth-method = token auth-token = streamers ui-host = http://WaterIvanAuto.stage1.mybluemix.net simulation = true

It did not work...

C:\Dev_Streams\WaterIvanAuto>java -jar smartsprinkler.edgent-1.1.0.jar UI host configure to: http://WaterIvanAuto.stage1.mybluemix.net Running Simulation: true Moisture: 940.600677555731 Sprinkler: false Avg: 940.600677555731 Aug 23, 2016 11:55:25 AM com.ibm.iotf.client.AbstractClient createClient INFO: pool-1-thread-1-0cc9b664-d1a8-4265-a8b1-87e9042baec9: Org ID = cvsmok Client ID = d:cvsmok:iotSprinkler:rPiSprinkler1 Aug 23, 2016 11:55:27 AM com.ibm.iotf.client.AbstractClient connect INFO: pool-1-thread-1-0cc9b664-d1a8-4265-a8b1-87e9042baec9: Connecting client d:cvsmok:iotSprinkler:rPiSprinkler1 to ssl://cvsmok.messaging.internetofthings.ibm cloud.com:8883 (attempt #1)... MqttException (0) - java.net.UnknownHostException: cvsmok.messaging.internetofthings.ibmcloud.com at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:633) at java.lang.Thread.run(Unknown Source) Caused by: java.net.UnknownHostException: cvsmok.messaging.internetofthings.ibmcloud.com at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:70) at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:82) at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:619)

ddebrunner commented 8 years ago

Ok - looks like that domain parameter support is in the IBM IoT client library but not yet in a release.

You could try to build the library and replace the one in Edgent.

https://github.com/ibm-watson-iot/iot-java

molefeskosana commented 5 years ago

Hi, is there a solution to this problem as yet?