eclipse / kuksa.val

kuksa.val
Apache License 2.0
95 stars 51 forks source link

Kuksa val to cloud mqtt #696

Open kulta4 opened 11 months ago

kulta4 commented 11 months ago

Hi, I am trying the same as #15 but in my case I don't have this testclient I want to connect this kuksa val to cloud through mqtt. so how to fix this case i able to do till dbcfeeder to kuksa val (databroker). what should be the next step to connect to cloud? Thank you.

SebastianSchildt commented 11 months ago

There is currently no "generic" component to do that, some discussion in this issue might help https://github.com/eclipse/kuksa.val/issues/684

Specifically for MQTT maybe some of the code here can be recyled https://github.com/SebastianSchildt/kuksa-tasmota-provider

It is all hardcoded to connect to a TASMOTA smart device, but it does show how to subscribe in KUKSA and then sending it to some MQTT topic

kulta4 commented 11 months ago

There is currently no "generic" component to do that, some discussion in this issue might help #684

Specifically for MQTT maybe some of the code here can be recyled https://github.com/SebastianSchildt/kuksa-tasmota-provider

It is all hardcoded to connect to a TASMOTA smart device, but it does show how to subscribe in KUKSA and then sending it to some MQTT topic

Thank you for the update. I have tried this but it doesn't show any signals received there. and this repo also doesn't have discription to follow.

kulta4 commented 11 months ago

Hi SebastianSchildt, While try to run the provide with kuksa databroker I have received an Error message can please help me to implement this.

There is currently no "generic" component to do that, some discussion in this issue might help #684

Specifically for MQTT maybe some of the code here can be recyled https://github.com/SebastianSchildt/kuksa-tasmota-provider

It is all hardcoded to connect to a TASMOTA smart device, but it does show how to subscribe in KUKSA and then sending it to some MQTT topic

Hi SebastianSchildt, While try to run the provide with kuksa databroker I have received an Error message can please help me to implement this.

KUKSA Provider In main Vehicle.Body.Lights.Running.IsOn target is set to True Traceback (most recent call last): File "provider.py", line 59, in asyncio.run(main()) File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "provider.py", line 51, in main await asyncio.gather( File "provider.py", line 39, in serve_static_light async with aiomqtt.Client(hostname=MQTT_HOST, port=MQTT_PORT) as client: File "/home/kulta/.local/lib/python3.8/site-packages/asyncio_mqtt/client.py", line 828, in aenter await self.connect() File "/home/kulta/.local/lib/python3.8/site-packages/asyncio_mqtt/client.py", line 379, in connect await loop.run_in_executor( File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/kulta/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 912, in connect self.connect_async(host, port, keepalive, File "/home/kulta/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 979, in connect_async if port <= 0: TypeError: '<=' not supported between instances of 'str' and 'int'

SebastianSchildt commented 11 months ago

According to the error you likely used a string as port number? The orginal example has a number https://github.com/SebastianSchildt/kuksa-tasmota-provider/blob/08a218c943710c8f8a7d3b77ea05fd85b81f7b6d/provider.py#L26

kulta4 commented 11 months ago

According to the error you likely used a string as port number? The orginal example has a number https://github.com/SebastianSchildt/kuksa-tasmota-provider/blob/08a218c943710c8f8a7d3b77ea05fd85b81f7b6d/provider.py#L26

if I have this code and the kuksa databroker running in my local and I try to connect the with c2e-hono-mqtt-adaptor which I have in AWS and deploy on Kubernetes. where and how can I get the received message from hono.

with this code I changed the MQTT IP as cluster IP of my c2e-hono-mqtt-adaptor and port. in this case the code is running and I got the update from kuksa databroker but the script is not keepalive for this I add the field keepalive=60 but it doesn't work the script is disconnected within 2seconds.

Traceback (most recent call last): File "provider.py", line 59, in asyncio.run(main()) File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "provider.py", line 51, in main await asyncio.gather( File "provider.py", line 43, in serve_static_light async with aiomqtt.Client(hostname=MQTT_HOST, port=MQTT_PORT) as client: File "/home/kulta/.local/lib/python3.8/site-packages/asyncio_mqtt/client.py", line 828, in aenter await self.connect() File "/home/kulta/.local/lib/python3.8/site-packages/asyncio_mqtt/client.py", line 396, in connect raise MqttError(str(error)) from None asyncio_mqtt.error.MqttError: timed out

kulta4 commented 10 months ago

Hi there, Any update on this above case?

SebastianSchildt commented 10 months ago

Hi, I personally have no experience with Hono, I just used a local Mosquitto. Did you verify your MQTT Hono thingy is reachable at all, e.g. with MQTT Explorer or similar tools?

kulta4 commented 10 months ago

Hi, yes, the MQTT is reachable, but it doesn't receive any signals from databroker and unable to get it from hono. Do you have any other suggestion to connect this kuksa databroker to kafka or eclipse hono or eclipse ditto?

Hariprasath-TE commented 10 months ago

Hi, yes, the MQTT is reachable, but it doesn't receive any signals from databroker and unable to get it from hono. Do you have any other suggestion to connect this kuksa databroker to kafka or eclipse hono or eclipse ditto?

Hi kulta, have you connected this kuksa databroker with eclipse hono?