0

I would like to now how I could integrate an electronic lock tracker (JT701) device to hono using the adapters mechanism. The device in question is using Jt600 protocol. Unfortunately for us, we can not change the device in order to use hono API (neither http or mqtt)

Victor Martinez
  • 1,102
  • 2
  • 8
  • 22
  • I am not familiar with the JT600 protocol. What transport does it use? HTTP, raw TCP, UDP? Can you provide a link to the protocol specification? That would make it a lot easier to find some options for how you can connect such a device to Hono. – Kai Hudalla Oct 31 '19 at 15:57
  • If it's HTTP based (as question indicates), then implementing it based on this guide is probably the best option https://www.eclipse.org/hono/docs/dev-guide/custom_http_adapter/ – Dejan Bosanac Oct 31 '19 at 16:11
  • Hi Kai, here you have an example in Java of JT600 protocol. https://github.com/vladyslavyatsun/traccar/blob/master/src/org/traccar/protocol/Jt600Protocol.java. it is a TCP protocol – Victor Martinez Oct 31 '19 at 16:24
  • @DejanBosanac Apologies, maybe my question mislead you. The device protocol is TCP base – Victor Martinez Oct 31 '19 at 16:30
  • @KaiHudalla Here you have some documentation of the protocol. https://github.com/cahitbeyaz/JTServer/blob/master/docs/The%20Protocol%20of%20JT701%20ProductV2.0.pdf – Victor Martinez Oct 31 '19 at 16:36

1 Answers1

2

Hono uses the protocol adapters to mediate between the devices' transport protocol and the AMQP 1.0 protocol which is used internally by Hono and which also used for Hono's north bound (application facing) APIs.

Hono comes with several standard adapters for HTTP, MQTT, AMQP 1.0, LoRaWAN and (experimental) SigFox and CoAP.

If a device uses a proprietary protocol that cannot be mapped/adapted to the endpoints exposed by the standard adapters, then there are two possible ways to make the devices work with Hono:

  1. Implement a custom protocol adapter which exposes an endpoint that implements the device protocol and integrates with Hono's APIs. This process is described at https://www.eclipse.org/hono/docs/dev-guide/custom_http_adapter/ as pointed out already in the comments.
  2. Implement a protocol proxy in front of one of the existing standard adapters. In your case, the proxy would speak JT600 with the device and connect to the AMQP 1.0 adapter, forwarding data hence and forth. This concept is described in https://github.com/eclipse/hono/issues/1478.

The first approach is mostly suitable for implementing new adapters that have the potential of becoming standard adapters to be included with Hono out of the box, e.g. an adapter for a widely used standard protocol. It requires deep understanding of Hono's APIs in order to be properly implemented. The advantage of this approach is that the adapter can become part of Hono's code base.

The second approach is better suited for proprietary protocols that you do not want to expose or if you need/want to have more control over the code itself. The biggest advantage of this approach is that it is easier to do because you only need to integrate with the AMQP 1.0 adapter's device facing endpoints and do not need to care how to integrate with all the other Hono APIs. Note, however, that with this approach you cannot take advantage of Hono's Credentials API for storing credentials used for authenticating devices.

Kai Hudalla
  • 826
  • 1
  • 5
  • 7