Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Driver connection type #280

Merged
merged 8 commits into from
Jun 20, 2024

Conversation

amrc-benmorrow
Copy link
Contributor

This sits alongside the other connection types (for now) and communicates with an external driver using the new protocol.

Configuration, polling and data packets are implemented. Command packets and error handling is not.

The Device subclasses have been removed. Where they had functionality this has been moved into the DeviceConnections. The Devices now purely handle the Sparkplug side of things, leaving the DeviceConnection to handle the southbound details.

This makes TypeScript a bit more bearable.
We are using the Aedes broker library. Create a broker and perform auth
on clients.

The broker URL to listen on and the location of the passwords for the
drivers are taken from the environment rather than from the config as
these will need to be synchronised with the driver deployment. This
means they are Helm values rather than edge agent config items.
The messages from a driver are too complicated to try to emit as
positional arguments; emit an object instead. This means we can pull out
and validate the data topic name too.
These tasks are too small to go in Jira, and some will probably outlive
this project.
Device represents a Sparkplug Device, and clearly lives on the Edge
Agent side of the divide. It should not have any connection-specific
functionality.

Where there was specific code, this was concerned with arranging to
subscribe to addresses on the southbound connection. Handle this in the
Connection class instead.
This sits alongside the other connection types, for now, and speaks my
new driver protocol. This doesn't handle CMDs or errors correctly yet,
but otherwise works.

I'm not entirely sure how to handle drivers that want to poll
themselves. Currently the EA keeps sending poll messages regardless, and
drivers like OPCUA can just not subscribe, and use the group poll
instruction instead.

I have disabled the watchdog timeout; it fires much too quickly when
you're pretending to be a device manually. I'm not sure a fixed timeout
with no ping is the right thing to do anyway; there are valid reasons
why a connection might not speak for 10s.
@amrc-benmorrow amrc-benmorrow merged commit 9f5dc98 into bmz/edge-split Jun 20, 2024
@amrc-benmorrow amrc-benmorrow deleted the bmz/edge-split-driver branch June 20, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants