0

I am following the Eclipse Hono getting started guide and using the sandbox environment.

I opened git bash terminal and used this command for starting the device to receive commands:

mosquitto_sub -v -h $MQTT_ADAPTER_IP -u $MY_DEVICE@$MY_TENANT -P $MY_PWD -t command/+/+/req/#

I opened another git bash terminal and used this command for the application client to send commands to the device:

java -jar hono-cli-*-exec.jar --hono.client.host=$AMQP_NETWORK_IP --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$MY_TENANT --device.id=$MY_DEVICE --spring.profiles.active=command

But I get this exception when I use the above command:

21:41:45.504 [main] INFO  org.eclipse.hono.cli.Application - Starting Application v1.3.0 on DESKTOP-4SV0QNN with PID 9768 (C:\Users\HP\hono-cli-1.3.0-exec.jar started by HP in C:\Users\HP)
21:41:45.509 [main] INFO  org.eclipse.hono.cli.Application - The following profiles are active: command
21:41:47.092 [main] INFO  org.eclipse.hono.cli.Application - running command line client in role(s): command
21:41:50.249 [main] INFO  org.eclipse.hono.cli.Application - Started Application in 7.064 seconds (JVM running for 10.127)
21:42:17.462 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [hono.eclipseprojects.io:15672, role: unknown] have been made, giving up
21:42:17.595 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - stopping connection attempt to server [hono.eclipseprojects.io:15672, role: unknown] due to terminal error
org.eclipse.hono.connection.ConnectTimeoutException: connection attempt timed out after 5000ms
        at org.eclipse.hono.connection.impl.ConnectionFactoryImpl.lambda$connect$0(ConnectionFactoryImpl.java:153)
        at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:923)
        at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:887)
        at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
        at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:43)
        at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:229)
        at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:221)
        at io.vertx.core.impl.VertxImpl$InternalTimerHandler.run(VertxImpl.java:913)
        at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
        at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:834)
21:42:17.602 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Commander - Error: failed to connect

I have set the environment variables MQTT_ADAPTER_IP, MY_TENANT, MY_DEVICE in the application client terminal and MY_TENANT, MY_DEVICE, MY_PWD, MQTT_ADAPTER_IP in the device terminal.

This is the jdk version in my system:

C:\Users\HP>java -version
java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

Please let know how can I fix this.

Gryu
  • 2,102
  • 2
  • 16
  • 29
nina
  • 27
  • 8
  • Can you try to run `java -jar hono-cli-*-exec.jar --hono.client.host=hono.eclipseprojects.io --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=DEFAULT_TENANT --device.id=4711 --spring.profiles.active=command` And see if the client is able to connect? This way we can rule out network issues as this should work in any case, regardless of which particular tenant or device you have created. – Kai Hudalla Aug 10 '20 at 06:03
  • @KaiHudalla, I get the blockedThreadChecker excetion - WARN i.v.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-0,5,main]=Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 2134 ms, time limit is 2000 ms io.vertx.core.VertxException: Thread blocked – nina Aug 10 '20 at 07:47
  • There was no problem with receiving telemetry data and events from device. The error is when setting the client to send commands to device – nina Aug 10 '20 at 07:53
  • `I get the blockedThreadChecker excetion` That is just a warning which doesn't mean that the client is not working. Can you post the full output of the command I asked you to run? – Kai Hudalla Aug 10 '20 at 08:47

0 Answers0