1

I am new to Kura. I read the documentation of Kura but I found no instruction on how to connect an edge device to Kura. More specifically, I have a DHT11 sensor connect to a raspberry Pi named A, I have Kura already installed on another raspi (as a gateway) named B . How can I send the data from the sensor on raspi A to Kura on raspi B over MQTT ? I also took a look into the web UI but only found the option to connect to a cloud service.

dondon
  • 105
  • 1
  • 1
  • 10
  • Why not install Kura on raspi A? You can use Kura to directly access data from the DHT11 and publish the data to the Cloud. This is most common use case for Kura, to act as an edge gateway. – David Woodard Aug 04 '17 at 18:52
  • Yes. I aware of that option. Unluckily, my project requires Kura installed on a gateway raspi between the device raspi and the server. So besides that, I want to know if there is any possible way at the moment to do what I described. If there is none, I will happily to follow your suggestion above. Thank you very much :). – dondon Aug 05 '17 at 08:30
  • If you must use two RPis, there are several ways to communicate between the two. The simplest would probably be to use a serial connection between the two devices. Kura has services for doing serial communication. – David Woodard Aug 23 '17 at 00:01

2 Answers2

0

i'm also a new Kura. You said you must send sensor data to another ras pi, as for me, i must write a driver to collect sensor data from sensor. I read lots of doc, blog,somebody said using pi4j or gpio is the best way. do you have any experience about it? =)

L.anh
  • 11
  • 1
  • It's a little bit off topic here but I will answer anyway. Yes, pi4j is the library for java to control the GPIO pin of raspberry pi, through that you can retrieve the value of the sensor attached to it. However, depending on the type of sensor, pi4j, as well as java, is not always the best. For example, ultrasonic sensor can be read easily by this way, however, temperature/humidity sensor such as DHT11. DHT22 has some problem with the timing in java, therefore it is best to use languages like C or Python. – dondon Aug 23 '17 at 13:18
0

Considering you are not interested in installing Kura on raspi A, a possible stable solution I can think with the tools you have at hand is:

  • Raspi A: create a service that reads your sensor and send it via MQTT to Raspi B. Consider:

    • The format of such data needs to be KuraProtobuf or JSON with this schema:

    {
      "sentOn": 13415414544,
      "metrics: [
        "field1": 5234524,
        "field2": "adsfasd"
      ]
    }
    
    • The topic must be account/client/application/other
  • Raspi B: deploy the Simple Artemis MQTT Broker and create a CloudService connected locally to the broker. Configure it with the proper data format, account and client. Then, create a subscription in such CloudService with the proper application and topic (other)

However, there may be other solutions. For example, the camel routes could provide you a more optimized solution if you have some knowledge.

pinty
  • 479
  • 3
  • 11