-
Hi there, I am currently testing the tool to determine if it's suitable for our use case. Currently, my goal if it is possible through the EdgeX Foundry to find a way to detect if a device loses its connection. While exploring the tool's features, I came across the "UpdateLastConnected" parameter, which appears to be useful for this purpose. However, I also noticed that this parameter will be removed in the upcoming version 3.0, as mentioned in the EdgeX Foundry documentation (https://docs.edgexfoundry.org/3.0/microservices/device/Ch-DeviceServices/) and in this PR (edgexfoundry/go-mod-core-contracts#771), which recommends using metrics instead. I have also noticed that Consul only seems to be prepared of pinging services, not devices. Therefore, I am wondering if there is a way to detect when a connection is lost for MQTT or MODBUS devices through the services that offers EdgeX Foundry. Thank you in advance for your help. Best regards, Miguel |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In the original implementation, UpdateLastConnected happens for every event sending out, and it is quite a waste to send the REST to update it. In fact, you can subscribe the event metrics to confirm the last Device Service working timestamp. For the real Device disconnection alerts, it depends on the individual Device Service implementation. The MQTT and Modbus Device Service reference implementation here don't handle it. You can add this kind of logic into the Device Service implementation you need. |
Beta Was this translation helpful? Give feedback.
In the original implementation, UpdateLastConnected happens for every event sending out, and it is quite a waste to send the REST to update it. In fact, you can subscribe the event metrics to confirm the last Device Service working timestamp.
https://docs.edgexfoundry.org/2.3/microservices/general/#service-metrics
v2.3 config:
https://github.com/edgexfoundry/device-modbus-go/blob/251be81c94d6bf2c69d06494166ea5d98cfe24ab/cmd/res/configuration.toml#L19
v3.0 config:
https://github.com/edgexfoundry/edgex-go/blob/6dde6725c068b93be8e99b4859b2725888de99b7/cmd/core-common-config-bootstrapper/res/configuration.yaml#L109
For the real Device disconnection alerts, it depends on the individual Device …