eclipse-hono / hono

Eclipse Hono™ Project
https://eclipse.dev/hono
Eclipse Public License 2.0
450 stars 137 forks source link

How to connect Kura gateway to Hono? #763

Closed mohabh88 closed 6 years ago

mohabh88 commented 6 years ago

Hello there,

I am trying to connect my Kura gateway installed on Raspberry Pi 2 B+ to Hono. However, I could not do that. Is there any detailed documentation on how that is done? That would be very helpful.

For instance, I tried to have minikube and kubectl installed on the same Raspberry Pi, but unfortunately, every time I start them, I get the below errors:

$ minikube start
bash: /usr/local/bin/minikube: cannot execute binary file: Exec format error
$ kubectl version
Illegal instruction

I see in this documentation that it is possible to connect Kura to Hono via MQTT broker directly.

So, is it possible to have Hono on Raspberry Pi at the moment? Otherwise, what is the best way to have them (i.e., Kura and Hono) connected together? I am using Raspbian Jessie 2015-11-21 as the OS for the Raspberry Pi to have Kura running on top of it following this Eclipse IoT tutorial.

Basically, I have Hono installed and running on my local machine via Minikube (Kubernetes) as well as Minishift (OpenShift) and I want to connect them to Kura (running on Raspberry Pi) to form a cluster.

I have searched for this information but nowhere mentions Kura and Hono altogether in details. Thank you in advance and appreciate if you help me.

I look forward to hearing from you, Mohab

mohabh88 commented 6 years ago

I hope that the below information would help further. Here is what I have:

Even I tried to plug the RPI into the local machine directly; the IP address got changed and tried to put the IP address of the minikube instance (e.g., 192.168.99.100) in the broker-url for Kura, but that didn't work as well.

I would like to know how to connect Kura (on RPI) to Hono (minikube and-or minishift instances -- on a local machine) so that the cluster is formed. I'd be grateful and thankful if you shed the light on such integration and if you assisted me.

Awaiting for your reply and thank you so much for your consideration in advance. Mohab

sophokles73 commented 6 years ago

Can you ping the machine that minikube is running on from your Raspberry?

mohabh88 commented 6 years ago

Hello @sophokles73, thank you so much for replying back.

Yes, I can ping my local machine (where minikube is running) from the Raspberry Pi. Here you are a screenshot.

2018-08-08-093519_1280x1024_scrot

This means there are no issues pertaining to the networking setup, right?

sophokles73 commented 6 years ago

can you also ping the minikube node?

mohabh88 commented 6 years ago

No, couldn't ping it. Even tried to perform a telnet to both the local machine as well as the minikube node on port 1883, but they could not be resolved.

2018-08-08-103402_1280x1024_scrot

Is there a way to expose Hono services (including minikube node) outside to the network, any routing rules or so?

sophokles73 commented 6 years ago

you can expose the (relevant) pods' node ports on your local machine by means of the kubectl tool. See kubectl port-forward --help for details.

mohabh88 commented 6 years ago

Thank you @sophokles73 for your prompt reply.

I tried to the above mentioned command kubectl port-forward --help and based on the instructions, I did the following:

$ kubectl port-forward minikube 2376:1883
Error from server (NotFound): pods "minikube" not found
$ kubectl port-forward hono-adapter-kura-57fd99cd-phrrn 2376:1883
Error from server (NotFound): pods "hono-adapter-kura-57fd99cd-phrrn" not found
$ kubectl port-forward hono-adapter-kura 2376:1883
Error from server (NotFound): pods "hono-adapter-kura" not found

I tried with the minikube node, Pod name itself "e.g., hono-adapter-kura-57fd99cd-phrrn" and by deployment name, but they were all not recognized. So which one should be used? Also I tried with the port that is associated with minikube node:

$ minikube ip
192.168.99.100:2376

Should another port be used? E.g., 30000 or so and be redirected to the remote port of 1883, right? Also when you referred to (relevant) pods, for Kura, the pods needed will be hono-adapter-kura as well as hono-adapter-mqtt-vertx?

I am trying to understand so thank you so much for highlighting them to me :)

sophokles73 commented 6 years ago

you need to append -n hono to the kubectl command:

$ kubectl port-forward hono-adapter-kura-57fd99cd-phrrn 11883:1883 -n hono

From your raspi you should then be able to connect to the kura adapter using port 11883 ...

mohabh88 commented 6 years ago

Thank you for the additional pieces of information. Made some progress :)

running the above command with the specified port number seems to work, but not certain if it is functioning well.. I cannot see any output except "Forwarding from 127.0.0.1:11883 -> 1883"

port-forward-hono-kura

On the other side, on raspi, I changed the MqttDataTransport broker-url based on the above changes, but still the status is disconnected.

mqttdatatransport

kura-status-disconnected

Any thoughts on that? Thank you for your continuous assistance Kai :)

sophokles73 commented 6 years ago

the problem is that the forwarded port is exposed on the localhost (127.0.0.1) but not on the network interface that is connected to the PI. There is an issue for extending kubectl to allow binding to all interfaces (0.0.0.0) https://github.com/kubernetes/kubernetes/pull/46517

Can't you simply use the Eclipse Hono Sandbox [1] ?

[1] https://www.eclipse.org/hono/sandbox/

mohabh88 commented 6 years ago

Possible, as a workaround, if I connect (plug in) the raspi to the local machine directly and do the port-forwarding again on localhost (127.0.0.1 or IP address of the local machine itself), Kura gets connected to Hono services? In this case, they will be exposed on the same network (i.e., localhost), right?

And regarding your question (Sandbox), I'd like to use the up and running Hono on both minikube and minishift that I have on my local machine as I am conducting experiments on top of them.

I look forward to hearing back from you :)

sophokles73 commented 6 years ago

@mohabh88 can we close this issue? there is nothing else we (Hono) can do, I guess.

mohabh88 commented 6 years ago

Thank you @sophokles73 for your message. Still the issue I am facing is not resolved yet!

Could you please shed the light more on Eclipse Hono Sandbox you mentioned earlier? I read it carefully, but could not grasp the differences between it and Hono deployed on minikube (even the documentation doesn't show detailed steps to have it like the deployment for Kubernetes, for example). Also, could Sandbox be connected to Eclipse Kura without issues? Using port forwarding may be or any other option?

On a side note: I tried several alternatives, but none worked for me...

I am trying with all possible means to find a solution. So, I would be thankful that you still offer your assistance to find a workaround for such matter. Thank you so much again for your consideration.

sophokles73 commented 6 years ago

If your Raspi has transparent internet access, then simply configure it to connect to the sandbox running at hono.eclipse.org instead of your local minikube deplyoment. The difference is that the sandbox exposes its ports publicly on the internet (which you may be able to connect to from your raspi) whereas your minikube node's Hono ports seem to not be accessible from your local network.

mohabh88 commented 6 years ago

Thank you very much @sophokles73 for your reply.

Based on the information you have shared with me and after re-reading the Sandbox documentation again, I want to ask/make sure that I correctly got what you mean.

  1. In Raspi, I should change the MqttDataTransport broker-url to hono.eclipse.org.
  2. Transparent internet access means that I am not behind the firewall.
  3. Sandbox is pre-deployed with Hono (for Kubernetes, OpenShift, etc.), right? How it can be used/downloaded?
  4. How can Sandbox be used to add data?
  5. Number of devices is limited to 100, how can devices be registered in Sandbox? Same as registering devices for Kubernetes and OpenShift? Starting the consumer, registering devices, send telemetry messages, etc. ...
  6. Hono client is used to access the Sandbox's Telemetry and-or Event APIs, how it can be used and where the following command can be used? $> java -jar target/hono-example-0.6-exec.jar --hono.client.host=hono.eclipse.org --hono.client.port=15671 --hono.client.tlsEnabled=true --hono.client.username=consumer@HONO --hono.client.password=verysecret --spring.profiles.active=receiver
  7. Any specific procedures to activate Grafana dashboard to get the performance metrics?
  8. Where can the steps be found to work on the Sandbox? Are they the same like Kuberbetes and-or OpenShift, but something needs to be changed/added/modified, for example?

If there is a detailed documentation on how to use the Sandbox, I'd be grateful if you pointed me to it so I can continue with such option. Your continued assistance and time are greatly appreciated. Thank you so much :)

sophokles73 commented 6 years ago

Where can the steps be found to work on the Sandbox?

https://www.eclipse.org/hono/sandbox/

mohabh88 commented 6 years ago

Thank you, I already went through that referred page before, that's why based on it I asked the aforementioned questions. Could you please address the above so that I can proceed? Thank you so much again for your consideration.

sophokles73 commented 6 years ago

All of your questions are either answered directly on that page or on the pages linked from it (e.g. the Getting Started Guide). I would suggest that you start doing your homework and try to figure out things on yourself by reading and trying out before asking others to do your work ...

mohabh88 commented 6 years ago

Thank you very much for your reply and suggestion :) I guess I made some progress, but please, correct me if I am mistaken/doing something wrong since I faced some abnormalities.

I looked up a lot on how to use sandboxes (as it is my first time to expose to them "that's why I was asking my questions just to grab the idea). I discovered that any localhost in the issued commands could be replaced by hono.eclipse.org so that sandbox works. I'd be grateful if you correct me in case that I am wrong.

Following the Getting Started Guide for Docker Swarms, I tried the changes accordingly.

First I initiated the swarm on my local machine "using the IP address of eno1 .. not with the ones listed in the below ifconfig attachment.". Then started Hono using the deployment commands, but when I tried to list all the services, nothing was retrieved.

docker_hono_3ifconfig.txt

sudo docker service ls
ID  NAME  MODE  REPLICAS  IMAGE

In the Starting the Consumer step, I issued the below command and changed the localhost inside to hono.eclipse.org; build was successful (But the client shut down after timing out and there was an exception related to SSL as presented in the log)

mvn spring-boot:run -Drun.arguments=--hono.client.host=hono.eclipse.org,--hono.client.username=consumer@HONO,--hono.client.password=verysecret,--message.type=telemetry

docker_hono_3_starting_consumerhono.eclipse.org.txt

that was not the case for using the IP address, where there was an error during the initialization of receiver: failed to connect

docker_hono_3_starting_consumer_localhostIP.txt

For publishing the data, I was able to register the device, retrieve its data and upload telemetry data (that was only done using hono.eclipse.org and HTTPie - the other commands threw errors)

Thank you to tell whether things are going well with such warnings/exceptions occurred. At the end, I looked up a lot on how to make use of the exposed sandbox services and connect that to Kura, but could not achieve such information. I tried the port forwarding again, but could find the pods inside.

Thank you for your time, continued patience and consideration.

sophokles73 commented 6 years ago

First I initiated the swarm on my local machine "using the IP address of eno1 .. not with the ones listed in the below ifconfig attachment.". Then started Hono using the deployment commands, but when I tried to list all the services, nothing was retrieved.

There is nothing to deploy. That's the purpose of the sandbox, you simply use the Hono instance at hono.eclipse.org.

In the Starting the Consumer step, I issued the below command and changed the localhost inside to hono.eclipse.org; build was successful (But the client shut down after timing out and there was an exception related to SSL as presented in the log)

Please read https://www.eclipse.org/hono/sandbox/, it has instructions for starting a consumer ...

mohabh88 commented 6 years ago

Thank you. Now I got things working properly for Sandbox. Appreciate.

I switched back to Kura on Raspi and adjusted the MqttDataTransport broker-url to access the server using hono.eclipse.org, but still it could not connect.

I tried: mqtt://hono.eclipse.org:1883, mqtt://hono.eclipse.org:11883, mqtt://hono.eclipse.org:8883, ssl://hono.eclipse.org:8883 as well as MQTT over WebSockets ws://hono.eclipse.org:80/ws based on the below findings on how to connect to Eclipse Hono.

-- Eclipse IoT Sandboxes. -- Connecting an ESP8266 to Eclipse Hono -- uses Hono Sandbox -- Connecting a GrovePi to Eclipse Hono -- uses Hono Sandbox

Maybe I am using the broker wrong.

sophokles73 commented 6 years ago

You will need to configure Kura with the address and port of the Sandbox's Kura adapter, i.e. mqtt://hono.eclipse.org:1884 (for plain MQTT) or 8884 (for MQTT over TLS). You may also want to take a look at the Kura Adapter User Guide to find out how Kura needs to be configured properly...

mohabh88 commented 6 years ago

I tested the above configurations (Sandbox's Kura address and port(s)), but unluckily, they didn't work. Kura is still in the disconnected status.

Furthermore, I tried them on MQTTLens to see if I can remotely access the server and subscribe to any topic as I did before with iot.eclipse.org (which was successful)... seems that the Sandbox's server is not available at the ports identified.

In the Kura Adapter User Guide, it says: gateways need to provide a username and a password in the MQTT CONNECT packet, so I tried the setup with the credentials needed (e.g., sensor2@DEFAULT_TENANT and the hashed-pwd associated with it jZxT1LMIku7OjiOWEJqRiWrUxSwDy444S8xz9GLKvz9hoaOsxCjhUGtCJD4+cowTjzzvz2piN424BZLsFoWkSA==), it did not work as well.

Here you are the screenshots illustrating the above:

hono_eclipse.zip iot_eclipse.zip Raspi_Kura.zip

I included the "Kura.log" in the Raspi_Kura zip folder. It shows all the exceptions when trying hono.eclipse.org's different configurations as well as while testing iot.eclipse.org that connects successfully.

Possible that something is hindering the server to be accessible? Should the credentials be modified too?

sophokles73 commented 6 years ago

so I tried the setup with the credentials needed (e.g., sensor2@DEFAULT_TENANT and the hashed-pwd associated with it

no need to create new credentials, simply use the default device's credentials which are also used in the getting started guide. The device ID is 4711 the tenant is DEFAULT_TENANT and the auth-id is sensor1

You also need to follow the instructions in the Kura Adapter's User Guide, in paricular

Please refer to the Eclipse Kura documentation on how to configure the gateway’s cloud service connection accordingly. It is important to set the gateway’s topic.context.account-name to the ID of the Hono tenant that the gateway has been registered with whereas the gateway’s client-id needs to be set to the corresponding Hono device ID.

BTW MQTTLens didn't work for me either, I use MQTTFx

mohabh88 commented 6 years ago

Thank you @sophokles73 for referring me to use MQTTFx.

I have been using it since referral, but the broker seems to be unreachable too. Please confirm.

Here you are the configurations I am using in MQTTFx: (Please correct is something is wrong)

MQTT Broker Profile Settings: Broker-address: hono.eclipse.org Broker-port: 1884 Client ID: 4711

User Credentials tab: Username: sensor1@DEFAULT_TENANT Password: (I tried many, but neither one worked): 1) hono-secret 2) verysecret 3) hashed-password 4) jZxT1LMIku7OjiOWEJqRiWrUxSwDy444S8xz9GLKvz9hoaOsxCjhUGtCJD4+cowTjzzvz2piN424BZLsFoWkSA==

The MQTTFx logs say: "Broker Unavailable"

MQTTFx_logs.txt MQTTFx_configuration.png.zip

On a side note: the above configurations are not working for Kura when mapped as well.

Also, I tried to access the server with the command:

telnet hono.eclipse.org 1884

it disconnects right after a couple of seconds

Trying 35.185.31.194...
Connected to hono.eclipse.org.
Escape character is '^]'.
Connection closed by foreign host.
ctron commented 6 years ago

@mohabh88 Did you register the device with the Hono Device Registry?

mohabh88 commented 6 years ago

Hi @ctron. Yes. I successfully registered the "4711" device to Sandbox using http POST http://hono.eclipse.org:28080/registration/DEFAULT_TENANT device-id=4711

and was able to send telemetry messages via http --auth sensor1@DEFAULT_TENANT:hono-secret POST http://hono.eclipse.org:8080/telemetry temp:=5.

HTTP/1.1 202 Accepted
Content-Length: 0

then I attempted to connect to the server (e.g., from MQTTFx) using the aforementioned credentials, configurations as well as the telnet command (for testing the connection then mapping them to Kura), but it threw Broker Unavailable and the other exceptions forwarded before (i.e., server unreachable).

On a side note: I was able to register 10 devices and they were all HTTP/1.1 202 Accepted when the messages were sent.

I restarted my machine, removed the Hono instance and tried everything from scratch, but unfortunately since then, everything became abnormal again (e.g., disconnected).

1) Using secure port to access Sandbox and starting the client using: java -jar target/hono-example-0.6-exec.jar --hono.client.host=hono.eclipse.org --hono.client.port=15671 --hono.client.tlsEnabled=true --hono.client.username=consumer@HONO --hono.client.password=verysecret --spring.profiles.active=receiver threw the attached errors

ssl-sandbox.txt ssl-sandbox_without_sudo.txt

(including ERROR o.e.hono.example.ExampleReceiver - Error occurred during initialization of receiver: failed to connect).

-- Pulling the latest from Github (Hono 0.8), hono-example-exec.jar is not found to be executed. I used the old version I have for Hono (0.6).

2) Starting the consumer again started to throw its SSL exception "javax.net.ssl.SSLHandshakeException: General SSLEngine problem" , full log attached: -

starting_consumer_SSL_exception.txt

3) Not able to register and-or send telemetry/event messages.

4) When undeploying the swarm, Error response from daemon: service not found is thrown

swarm_undeploy_service_not_found.txt

5) Still telnet hono.eclipse.org 1884, disconnects right after a couple of seconds

Trying 35.185.31.194...
Connected to hono.eclipse.org.
Escape character is '^]'.
Connection closed by foreign host
sophokles73 commented 6 years ago

Also, I tried to access the server with the command: telnet hono.eclipse.org 1884 it disconnects right after a couple of seconds

It doesn't for me. Are you on a corporate network that does not provide transparent internet access, i.e. are you behind a proxy that (by default) only allows access to standard HTTP ports?

mohabh88 commented 6 years ago

Thank you for your reply. No proxy detected.

Your IP address: 132.207.170.30
Proxyserver: | No proxyserver detected.
You do not have a proxy server or internet filtering activated.

Raw server data:

amibehindaproxy.com says

HTTP_HOST: amibehindaproxy.com
HTTP_USER_AGENT: Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
68.0.3440.106 Safari/537.36
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_CONNECTION: close
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.1
SERVER_PORT: 80
HTTP_X_FORWARD_FOR: 132.207.170.30
HTTP_VIA: not set
ctron commented 6 years ago

@mohabh88 I think that doesn't say anything. You are testing port 80 with that, and are looking for actual HTTP proxies.

Maybe runnng traceroute -T hono.eclipse.org shows a bit more:

Here is what I can see:

traceroute to hono.eclipse.org (35.185.31.194), 30 hops max, 60 byte packets
 1  * * *
 2  87.230.112.2 (87.230.112.2)  0.279 ms  0.352 ms  0.245 ms
 3  ffm-b1-link.telia.net (62.115.144.8)  2.983 ms  3.009 ms  2.897 ms
 4  google-ic-319727-ffm-b1.c.telia.net (62.115.151.27)  3.310 ms  3.352 ms  3.338 ms
 5  216.239.62.45 (216.239.62.45)  3.441 ms 108.170.231.235 (108.170.231.235)  3.531 ms 72.14.237.61 (72.14.237.61)  4.389 ms
 6  108.170.252.18 (108.170.252.18)  3.622 ms 108.170.251.145 (108.170.251.145)  3.968 ms 108.170.251.208 (108.170.251.208)  6.349 ms
 7  209.85.240.113 (209.85.240.113)  3.954 ms 209.85.252.214 (209.85.252.214)  4.033 ms 108.170.236.249 (108.170.236.249)  4.033 ms
 8  209.85.253.185 (209.85.253.185)  13.423 ms  13.905 ms  13.888 ms
 9  216.239.54.150 (216.239.54.150)  89.997 ms 216.239.54.148 (216.239.54.148)  90.201 ms 216.239.54.150 (216.239.54.150)  89.875 ms
10  209.85.255.244 (209.85.255.244)  101.183 ms  101.320 ms  101.340 ms
11  216.239.41.240 (216.239.41.240)  100.707 ms 216.239.41.242 (216.239.41.242)  100.746 ms 66.249.94.31 (66.249.94.31)  100.884 ms
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  194.31.185.35.bc.googleusercontent.com (35.185.31.194)  101.144 ms  101.296 ms  101.432 ms
mohabh88 commented 6 years ago

@ctron, thank you for your guidance.

Here you are the requested output:

traceroute to hono.eclipse.org (35.185.31.194), 30 hops max, 60 byte packets
 1  gateway (132.207.170.1)  0.436 ms  0.410 ms  0.397 ms
 2  192.168.202.33 (192.168.202.33)  0.356 ms  0.358 ms  0.356 ms
 3  132.207.3.5 (132.207.3.5)  1.037 ms  1.016 ms  1.012 ms
 4  polymtl-gw.mg.risq.net (206.167.128.105)  1.250 ms  1.238 ms  1.226 ms
 5  132.202.51.173 (132.202.51.173)  0.954 ms  1.188 ms  0.928 ms
 6  dmtrl-uq.risq.net (192.77.55.246)  1.169 ms  1.347 ms  1.298 ms
 7  imtrl-rq.risq.net (192.77.55.245)  1.294 ms  1.285 ms  1.268 ms
 8  google-mtrl.risq.net (192.77.55.218)  1.247 ms  1.419 ms  1.399 ms
 9  108.170.251.18 (108.170.251.18)  1.694 ms 108.170.251.5 (108.170.251.5)  2.256 ms 108.170.251.50 (108.170.251.50)  1.676 ms
10  74.125.37.198 (74.125.37.198)  26.434 ms  26.443 ms 108.170.236.0 (108.170.236.0)  10.673 ms
11  216.239.57.251 (216.239.57.251)  17.626 ms  17.636 ms 216.239.57.249 (216.239.57.249)  22.550 ms
12  216.239.40.20 (216.239.40.20)  32.925 ms  32.938 ms  32.931 ms
13  72.14.236.197 (72.14.236.197)  27.697 ms 72.14.237.109 (72.14.237.109)  26.937 ms 216.239.50.11 (216.239.50.11)  27.035 ms
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  194.31.185.35.bc.googleusercontent.com (35.185.31.194)  27.429 ms  27.489 ms  27.478 ms
ctron commented 6 years ago

Now can you do openssl s_client -connect hono.eclipse.org:8883 and see which certificate you get as a response?

For me this is:

subject=/CN=hono.eclipse.org
issuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
mohabh88 commented 6 years ago

For me it is the same. This is what i can see:

subject=/CN=hono.eclipse.org
issuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3

Would you like me to post the whole output of the command and certificate?

mohabh88 commented 6 years ago

I retried the receiver again... it got connected (at: 10:35:47.833), then the connection got lost right after (at 10:35:55.778) and the attempts to reconnect started till it gave up.

traces:

sudo java -jar hono-example-0.6-SNAPSHOT-exec.jar --hono.client.host=hono.eclipse.org --hono.client.port=15671 --hono.client.tlsEnabled=true --hono.client.username=consumer@HONO --hono.client.password=verysecret --spring.profiles.active=receiver

  ______     _ _                  _    _                   
 |  ____|   | (_)                | |  | |                  
 | |__   ___| |_ _ __  ___  ___  | |__| | ___  _ __   ___  
 |  __| / __| | | '_ \/ __|/ _ \ |  __  |/ _ \| '_ \ / _ \ 
 | |___| (__| | | |_) \__ \  __/ | |  | | (_) | | | | (_) |
 |______\___|_|_| .__/|___/\___| |_|  |_|\___/|_| |_|\___/ 
                | |                                        
                |_|                                        

Eclipse Hono Example Client  (v0.6-SNAPSHOT)
using Spring Boot  (v1.5.8.RELEASE)

Go to https://www.eclipse.org/hono for more information.

10:35:32.249 [main] INFO  org.eclipse.hono.example.Application - Starting Application v0.6-SNAPSHOT on m4122-01 with PID 32359 (/home/moaly/Documents/hono-master-3/example/target/hono-example-0.6-SNAPSHOT-exec.jar started by root in /home/moaly/Documents/hono-master-3/example/target)
10:35:32.253 [main] INFO  org.eclipse.hono.example.Application - The following profiles are active: receiver
10:35:32.317 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@39ed3c8d: startup date [Wed Aug 29 10:35:32 EDT 2018]; root of context hierarchy
10:35:33.138 [main] INFO  org.eclipse.hono.example.Application - Starting example client in role receiver
10:35:34.629 [main] INFO  org.eclipse.hono.example.Application - Started Application in 2.896 seconds (JVM running for 3.523)
10:35:47.833 [vert.x-eventloop-thread-0] DEBUG o.e.h.client.impl.AbstractHonoClient - receiver open [source: telemetry/DEFAULT_TENANT]
10:35:47.833 [vert.x-eventloop-thread-0] INFO  o.e.hono.example.ExampleReceiver - Receiver [tenant: DEFAULT_TENANT, type: telemetry] created successfully, hit ctrl-c to exit
10:35:55.778 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - lost connection to server [hono.eclipse.org:15671]
10:35:56.780 [vert.x-eventloop-thread-0] INFO  o.e.hono.example.ExampleReceiver - attempting to re-connect to Hono ...
10:35:59.909 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - starting attempt [#1] to re-connect to server [hono.eclipse.org:15671]
10:36:03.029 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - starting attempt [#2] to re-connect to server [hono.eclipse.org:15671]
10:36:05.142 [vert.x-eventloop-thread-0] DEBUG o.e.hono.client.impl.HonoClientImpl - max number of attempts [2] to re-connect to peer [hono.eclipse.org:15671] have been made, giving up

The connection seems not stable?

MQTTFx screenshots: small update: -

After several attempts; the connection got established, MQTTFx once got connected using the credentials, then the connection was lost causing the client to be reset.

mqttfx_status.zip

sophokles73 commented 6 years ago

We had some infrastructure problems on hono.eclipse.org which I have fixed. Note that I have also removed all devices, tenants and credentials as part of the fix except for the DEFAULT_TENANT, the default device (4711) and its default credentials (sensor1@DEFAULT_TENANT/hono-secret). However, you should now be able to connect again using MQTTfx ...

mohabh88 commented 6 years ago

Thank you so much @sophokles73 and @ctron. Now I am able to connect to the server (hono.eclipse.org) as well as connect Kura (on Raspberry Pi) to Hono's Sandbox :)

sophokles73 commented 6 years ago

glad to hear it

johnMinelli commented 4 years ago

am I late to join the conversation? i've a similar (but newer) configuration:

i need to connect the two. since mine verison is kura 4 i need to use the mqtt adapter. i've exposed the pod and the adapter can be reached in LAN with 192.168.1.145:31883 (mqtt) e :30883 (mqtts). i've configured a device "device1" with a password "password"

curl -i -X PUT -H 'Content-Type: application/json' --data-binary '[{ "type": "hashed-password", "auth-id": "device1", "secrets": [{ "pwd-plain": "password" }]}]' http://10.96.104.235:28080/v1/credentials/DEFAULT_TENANT/device1

i guess i'm messing up with auth/topic/username identifier since the log on kura says "unable to connect" so kura reach Hono i guess...(however i've made the registration of the device from the raspberry network so the enpointS are reachable from external)

kura_log.txt

image

sophokles73 commented 4 years ago

@johnMinelli Have you also registered your device using the devices resource? It is not enough to register credentials, you also need to register the device's identity ... Please refer to the Getting Started guide for details how to register a device properly.

Regarding the configuration of the connection in Kura:

johnMinelli commented 4 years ago

Thanks for the reply I solved re-deployng Hono

andrew-kratik commented 3 years ago

Hello @sophokles73 Could you please advice any manual how to make kura to send telemetry data in Ditto format (using Hono+Ditto on server) I was able to connect Kura to Hono server but can't find any info how to force Kura to send telemetry data in required time/format. Thanks

sophokles73 commented 3 years ago

@andrew-kratik Your question does not seem to be related to this issue (apart from the title), is it? Also, this issue is already resolved and closed. Could you therefore please create a new issue for your question or use one of the other options outlined on the Hono website?