0

I'm having trouble in starting MQTT Client in Eclipse Hono.
I'm using The following command to start the client

java -jar hono-example-0.6-exec.jar --hono.client.host=hono.eclipse.org --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --spring.profiles.active=receiver --tenant.id=bob 

which starts the client accepting telemetry data produced by the device, but didn't catch the data published through MQTT.

What may be wrong with this approach?

zx485
  • 28,498
  • 28
  • 50
  • 59

1 Answers1

1

The command you are using does not start an MQTT client but starts the receiver for consuming (AMQP 1.0) messages from devices belonging to tenant bob. In order to see something happening, you need to have a device that belongs to tenant bob publish some data. If you want to use MQTT for that purpose you may want to use the mosquitto_pub command line client as described in the Getting Started guide. However, make sure that you use the correct username and password. From what I can see in the device registry on hono.eclipse.org you have registered a device with id 1112 and auth-id sensor1. So the command to publish should look something like:

mosquitto_pub -h hono.eclipse.org -u sensor1@bob -Pthepasswordyouregistered -t telemetry -m "hello"

Again, make sure to replace thepasswordyouregistered with the real password that you have registered for device 1112.

Kai Hudalla
  • 826
  • 1
  • 5
  • 7
  • Thanks for your help sir, actually I was confused in the client service that I have to start a new client in order to receive messages passed through MQTT adapter. – Shailesh Arya Oct 29 '18 at 13:38
  • Have you been able to publish and receive messages following the steps outlined in my answer? If so, it would be nice if you could accept the answer. – Kai Hudalla Oct 29 '18 at 21:00