@marineyachtradar/signalk-plugin 0.2.1 → 0.5.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +48 -70
  2. package/package.json +42 -6
  3. package/plugin/config/schema.d.ts +13 -0
  4. package/plugin/config/schema.d.ts.map +1 -0
  5. package/plugin/config/schema.js +48 -0
  6. package/plugin/config/schema.js.map +1 -0
  7. package/plugin/index.d.ts +2 -0
  8. package/plugin/index.d.ts.map +1 -0
  9. package/plugin/index.js +359 -289
  10. package/plugin/index.js.map +1 -0
  11. package/plugin/mayara-client.d.ts +28 -0
  12. package/plugin/mayara-client.d.ts.map +1 -0
  13. package/plugin/mayara-client.js +102 -194
  14. package/plugin/mayara-client.js.map +1 -0
  15. package/plugin/radar-provider.d.ts +5 -0
  16. package/plugin/radar-provider.d.ts.map +1 -0
  17. package/plugin/radar-provider.js +192 -305
  18. package/plugin/radar-provider.js.map +1 -0
  19. package/plugin/spoke-forwarder.d.ts +30 -0
  20. package/plugin/spoke-forwarder.d.ts.map +1 -0
  21. package/plugin/spoke-forwarder.js +104 -136
  22. package/plugin/spoke-forwarder.js.map +1 -0
  23. package/plugin/types.d.ts +21 -0
  24. package/plugin/types.d.ts.map +1 -0
  25. package/plugin/types.js +3 -0
  26. package/plugin/types.js.map +1 -0
  27. package/public/540.js +2 -0
  28. package/public/540.js.LICENSE.txt +9 -0
  29. package/public/805.js +1 -0
  30. package/public/index.html +27 -39
  31. package/public/main.js +1 -0
  32. package/public/remoteEntry.js +1 -0
  33. package/public/api.js +0 -402
  34. package/public/assets/mayara_logo.png +0 -0
  35. package/public/base.css +0 -91
  36. package/public/control.html +0 -23
  37. package/public/control.js +0 -1155
  38. package/public/controls.css +0 -538
  39. package/public/discovery.css +0 -478
  40. package/public/favicon.ico +0 -0
  41. package/public/layout.css +0 -87
  42. package/public/mayara.js +0 -510
  43. package/public/proto/RadarMessage.proto +0 -41
  44. package/public/protobuf/protobuf.js +0 -9112
  45. package/public/protobuf/protobuf.js.map +0 -1
  46. package/public/protobuf/protobuf.min.js +0 -8
  47. package/public/protobuf/protobuf.min.js.map +0 -1
  48. package/public/radar.svg +0 -29
  49. package/public/render_webgpu.js +0 -886
  50. package/public/responsive.css +0 -29
  51. package/public/van-1.5.2.debug.js +0 -126
  52. package/public/van-1.5.2.js +0 -140
  53. package/public/van-1.5.2.min.js +0 -1
  54. package/public/viewer.html +0 -30
  55. package/public/viewer.js +0 -797
package/README.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # MaYaRa Server SignalK Plugin
2
2
 
3
- A native SignalK plugin that connects to a remote [mayara-server](https://github.com/MarineYachtRadar/mayara-server) and exposes its radar(s) via SignalK's Radar API.
3
+ A SignalK plugin that connects to [mayara-server](https://github.com/MarineYachtRadar/mayara-server) and exposes marine radars via SignalK's Radar API. Supports automatic container management via [signalk-container](https://github.com/dirkwa/signalk-container).
4
4
 
5
- ## Overview
5
+ ## Prerequisites
6
6
 
7
- This plugin acts as a thin proxy layer between SignalK and mayara-server. All radar logic (protocol handling, signal processing) runs on mayara-server - this plugin simply forwards control commands and streams radar data.
7
+ - **SignalK Server** with the Radar API **PR [SignalK/signalk-server#2357](https://github.com/SignalK/signalk-server/pull/2357)**
8
+ - **[signalk-container](https://github.com/dirkwa/signalk-container)** plugin (for managed container mode, optional)
9
+ - **Podman** or **Docker** runtime (for managed container mode)
10
+
11
+ ## How It Works
12
+
13
+ The plugin acts as a thin proxy between SignalK and mayara-server. All radar protocol handling runs in mayara-server — this plugin registers as a Radar API provider, forwards control commands, and streams binary spoke data.
8
14
 
9
15
  ```
10
16
  ┌─────────────────────────────────────────────────────────────────┐
@@ -18,32 +24,21 @@ This plugin acts as a thin proxy layer between SignalK and mayara-server. All ra
18
24
  │ │ radarApi.register() binaryStreamManager │
19
25
  │ │ │ │ │
20
26
  │ ┌──────┼────────────────────┼─────────────────────┼─────────┐ │
21
- │ │ │ SignalK Radar API v2 │ │ │
27
+ │ │ │ SignalK Radar API │ │ │
22
28
  │ │ │ /signalk/v2/api/vessels/self/radars/* │ │ │
23
29
  │ └──────┼──────────────────────────────────────────┼─────────┘ │
24
30
  └─────────┼──────────────────────────────────────────┼────────────┘
25
31
  │ HTTP WebSocket│
26
32
  ▼ ▼
27
33
  ┌─────────────────────────────────────────────────────────────────┐
28
- mayara-server
29
- /v2/api/radars/* /v2/api/radars/*/spokes
34
+ mayara-server (container)
35
+ /signalk/v2/api/vessels/self/radars/* .../spokes
30
36
  └─────────────────────────────────────────────────────────────────┘
31
37
  ```
32
38
 
33
- ## Requirements
34
-
35
- - **SignalK Server** PR 2158 (with Radar API support)
36
- - **mayara-server** running and accessible on the network
37
-
38
39
  ## Installation
39
40
 
40
- ### From npm (recommended)
41
-
42
- ```bash
43
- npm install @marineyachtradar/signalk-plugin
44
- ```
45
-
46
- ### From source
41
+ Install from the **SignalK App Store** or from source:
47
42
 
48
43
  ```bash
49
44
  git clone https://github.com/MarineYachtRadar/mayara-server-signalk-plugin
@@ -57,77 +52,60 @@ npm link @marineyachtradar/signalk-plugin
57
52
 
58
53
  ## Configuration
59
54
 
60
- Enable the plugin in SignalK Admin UI and configure:
55
+ The plugin provides a custom configuration panel in the SignalK Admin UI.
61
56
 
62
- | Setting | Description | Default |
63
- |---------|-------------|---------|
64
- | **Host** | IP address or hostname of mayara-server | `localhost` |
65
- | **Port** | HTTP port of mayara-server REST API | `6502` |
66
- | **Use HTTPS/WSS** | Enable secure connections (requires TLS on mayara-server) | `false` |
67
- | **Discovery Poll Interval** | How often to poll for new/disconnected radars (seconds) | `10` |
68
- | **Reconnect Interval** | How often to retry when mayara-server is unreachable (seconds) | `5` |
57
+ ### Container Mode (default)
69
58
 
70
- ## Features
59
+ With **signalk-container** installed, the plugin automatically pulls and manages the `ghcr.io/marineyachtradar/mayara-server` container image using host networking for radar multicast discovery.
71
60
 
72
- - **Multi-radar support**: Automatically discovers and manages all radars connected to mayara-server
73
- - **Full Radar API**: Implements SignalK's RadarProviderMethods interface
74
- - Power control (off/standby/transmit)
75
- - Range selection
76
- - Gain, sea clutter, and rain clutter adjustment
77
- - ARPA target acquisition and tracking
78
- - **Binary spoke streaming**: Uses SignalK's built-in binaryStreamManager for efficient data delivery
79
- - **Auto-reconnection**: Handles network disconnections gracefully
80
- - **Integrated GUI**: Includes the MaYaRa radar display webapp
61
+ - **Image version** select `latest`, `main`, or a specific release tag
62
+ - **Check** pulls the selected tag and compares against the running container
63
+ - **Update** pulls, stops, removes, and recreates the container with the new image
64
+ - **Arguments** (advanced) — optional CLI args like `--brand furuno --interface eth0`
81
65
 
82
- ## API Endpoints
66
+ Without arguments, mayara-server auto-discovers all radar brands on all network interfaces.
83
67
 
84
- Once configured, the plugin exposes radars at:
68
+ ### External Mode
85
69
 
86
- - `GET /signalk/v2/api/vessels/self/radars` - List all radars
87
- - `GET /signalk/v2/api/vessels/self/radars/{id}` - Radar info
88
- - `GET /signalk/v2/api/vessels/self/radars/{id}/capabilities` - Capability manifest
89
- - `GET /signalk/v2/api/vessels/self/radars/{id}/state` - Current state
90
- - `PUT /signalk/v2/api/vessels/self/radars/{id}/controls/{control}` - Set control
91
- - `GET /signalk/v2/api/vessels/self/radars/{id}/targets` - ARPA targets
92
- - `WS /signalk/v2/api/vessels/self/radars/{id}/stream` - Binary spoke data
70
+ Set **Managed container** to off to connect to a mayara-server instance running elsewhere:
93
71
 
94
- ## GUI
72
+ - **Host** — IP address or hostname
73
+ - **Port** — HTTP port (default: 6502)
95
74
 
96
- The radar display is available at:
97
- ```
98
- http://your-signalk-server:3000/@marineyachtradar/signalk-plugin/
99
- ```
75
+ ### Radar Display
100
76
 
101
- ## Development
77
+ The webapp redirects to mayara-server's built-in GUI at `http://<host>:6502/gui/`.
102
78
 
103
- After cloning, install dependencies and build the GUI:
79
+ ## Features
80
+
81
+ - **Container management**: Pull, update, and run mayara-server via signalk-container
82
+ - **Multi-radar support**: Auto-discovers all radars connected to mayara-server
83
+ - **Full Radar API**: Power, range, gain, sea/rain clutter, ARPA targets
84
+ - **Binary spoke streaming**: Forwards protobuf spoke data via SignalK's binaryStreamManager
85
+ - **Auto-reconnection**: Handles disconnections with configurable retry
86
+ - **Update detection**: Compare running container image against registry
87
+
88
+ ## Development
104
89
 
105
90
  ```bash
106
91
  npm install
107
92
  npm run build
108
93
  ```
109
94
 
110
- To use a local `mayara-gui` checkout (sibling directory) instead of npm:
111
-
112
- ```bash
113
- npm run build -- --local-gui
114
- ```
95
+ ### Scripts
115
96
 
116
- For development linking:
97
+ - `npm run format` — prettier + eslint --fix
98
+ - `npm run lint` — eslint check
99
+ - `npm run build` — compile TypeScript + webpack config panel
100
+ - `npm run test` — run tests (vitest)
101
+ - `npm run build:all` — lint + build + test
117
102
 
118
- ```bash
119
- npm link
120
- cd ~/.signalk
121
- npm link @marineyachtradar/signalk-plugin
122
- ```
103
+ ## Related Projects
123
104
 
124
- > **Note:** The `public/` directory is gitignored but included in the npm tarball.
125
- > It's built automatically during `npm publish` via `prepublishOnly`.
105
+ - **[mayara-server](https://github.com/MarineYachtRadar/mayara-server)** Standalone radar server
106
+ - **[signalk-container](https://github.com/dirkwa/signalk-container)** Container manager for SignalK
107
+ - **[signalk-server#2357](https://github.com/SignalK/signalk-server/pull/2357)** — Radar API for SignalK server
126
108
 
127
109
  ## License
128
110
 
129
- Apache-2.0 - See [LICENSE](LICENSE)
130
-
131
- ## Contributing
132
-
133
- See [CONTRIBUTING.md](CONTRIBUTING.md)
111
+ Apache-2.0 See [LICENSE](LICENSE)
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@marineyachtradar/signalk-plugin",
3
- "version": "0.2.1",
3
+ "version": "0.5.0-beta.2",
4
4
  "description": "MaYaRa Radar - Connect SignalK to mayara-server",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
7
- "build": "node build.js",
8
- "prepublishOnly": "node build.js",
9
- "test": "echo \"No tests yet\" && exit 0"
7
+ "format": "prettier --write 'src/**/*.ts' 'test/**/*.ts' && eslint --fix 'src/**/*.ts' 'test/**/*.ts'",
8
+ "lint": "eslint 'src/**/*.ts' 'test/**/*.ts'",
9
+ "build": "tsc && node build.js && webpack",
10
+ "build:config": "webpack",
11
+ "build:all": "npm run lint && npm run build && npm run test",
12
+ "test": "vitest run",
13
+ "prepublishOnly": "npm run build"
10
14
  },
11
15
  "keywords": [
12
16
  "signalk-node-server-plugin",
@@ -14,7 +18,8 @@
14
18
  "signalk-category-instruments",
15
19
  "radar",
16
20
  "marine",
17
- "mayara"
21
+ "mayara",
22
+ "signalk-plugin-configurator"
18
23
  ],
19
24
  "signalk": {
20
25
  "displayName": "MaYaRa Radar (Server)",
@@ -29,13 +34,44 @@
29
34
  "plugin/**/*",
30
35
  "public/**/*"
31
36
  ],
37
+ "signalk-plugin-enabled-by-default": true,
32
38
  "engines": {
39
+ "node": ">=20",
33
40
  "signalk": ">=2.0.0"
34
41
  },
35
42
  "dependencies": {
36
- "@marineyachtradar/mayara-gui": "^0.6.0",
43
+ "@sinclair/typebox": "^0.34.0",
37
44
  "ws": "^8.14.0"
38
45
  },
46
+ "peerDependencies": {
47
+ "signalk-container": ">=0.1.0"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "signalk-container": {
51
+ "optional": true
52
+ }
53
+ },
54
+ "devDependencies": {
55
+ "@babel/core": "^7.29.0",
56
+ "@babel/preset-react": "^7.28.5",
57
+ "@eslint/js": "^9.0.0",
58
+ "@signalk/server-api": "^2.24.0",
59
+ "@types/express": "^5.0.0",
60
+ "@types/node": "^20.0.0",
61
+ "@types/ws": "^8.5.0",
62
+ "eslint": "^9.26.0",
63
+ "eslint-config-prettier": "^10.0.0",
64
+ "eslint-plugin-prettier": "^5.0.0",
65
+ "prettier": "^3.0.0",
66
+ "typescript": "^5.5.0",
67
+ "typescript-eslint": "^8.0.0",
68
+ "babel-loader": "^10.1.1",
69
+ "react": "^19.2.4",
70
+ "react-dom": "^19.2.4",
71
+ "vitest": "^3.0.5",
72
+ "webpack": "^5.105.4",
73
+ "webpack-cli": "^7.0.2"
74
+ },
39
75
  "repository": {
40
76
  "type": "git",
41
77
  "url": "git+https://github.com/MarineYachtRadar/mayara-server-signalk-plugin"
@@ -0,0 +1,13 @@
1
+ import { Static } from '@sinclair/typebox';
2
+ export declare const ConfigSchema: import("@sinclair/typebox").TObject<{
3
+ managedContainer: import("@sinclair/typebox").TBoolean;
4
+ mayaraVersion: import("@sinclair/typebox").TString;
5
+ mayaraArgs: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
6
+ host: import("@sinclair/typebox").TString;
7
+ port: import("@sinclair/typebox").TNumber;
8
+ secure: import("@sinclair/typebox").TBoolean;
9
+ discoveryPollInterval: import("@sinclair/typebox").TNumber;
10
+ reconnectInterval: import("@sinclair/typebox").TNumber;
11
+ }>;
12
+ export type Config = Static<typeof ConfigSchema>;
13
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEhD,eAAO,MAAM,YAAY;;;;;;;;;EA4CvB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigSchema = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ exports.ConfigSchema = typebox_1.Type.Object({
6
+ managedContainer: typebox_1.Type.Boolean({
7
+ default: true,
8
+ title: 'Manage mayara-server via signalk-container',
9
+ description: 'Disable to connect to an external mayara-server instance'
10
+ }),
11
+ mayaraVersion: typebox_1.Type.String({
12
+ default: 'latest',
13
+ title: 'Container image version'
14
+ }),
15
+ mayaraArgs: typebox_1.Type.Array(typebox_1.Type.String(), {
16
+ default: [],
17
+ title: 'mayara-server arguments',
18
+ description: 'e.g. ["--brand", "furuno", "--interface", "eth0"]'
19
+ }),
20
+ host: typebox_1.Type.String({
21
+ default: 'localhost',
22
+ title: 'mayara-server host',
23
+ description: 'IP address or hostname (only used when not managing container)'
24
+ }),
25
+ port: typebox_1.Type.Number({
26
+ default: 6502,
27
+ title: 'mayara-server port',
28
+ minimum: 1,
29
+ maximum: 65535
30
+ }),
31
+ secure: typebox_1.Type.Boolean({
32
+ default: false,
33
+ title: 'Use HTTPS/WSS'
34
+ }),
35
+ discoveryPollInterval: typebox_1.Type.Number({
36
+ default: 10,
37
+ title: 'Discovery poll interval (seconds)',
38
+ minimum: 5,
39
+ maximum: 60
40
+ }),
41
+ reconnectInterval: typebox_1.Type.Number({
42
+ default: 5,
43
+ title: 'Reconnect interval (seconds)',
44
+ minimum: 1,
45
+ maximum: 30
46
+ })
47
+ });
48
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAEnC,QAAA,YAAY,GAAG,cAAI,CAAC,MAAM,CAAC;IACtC,gBAAgB,EAAE,cAAI,CAAC,OAAO,CAAC;QAC7B,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,4CAA4C;QACnD,WAAW,EAAE,0DAA0D;KACxE,CAAC;IACF,aAAa,EAAE,cAAI,CAAC,MAAM,CAAC;QACzB,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,yBAAyB;KACjC,CAAC;IACF,UAAU,EAAE,cAAI,CAAC,KAAK,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE;QACpC,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,mDAAmD;KACjE,CAAC;IAEF,IAAI,EAAE,cAAI,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,gEAAgE;KAC9E,CAAC;IACF,IAAI,EAAE,cAAI,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,KAAK;KACf,CAAC;IACF,MAAM,EAAE,cAAI,CAAC,OAAO,CAAC;QACnB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,eAAe;KACvB,CAAC;IAEF,qBAAqB,EAAE,cAAI,CAAC,MAAM,CAAC;QACjC,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,mCAAmC;QAC1C,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,iBAAiB,EAAE,cAAI,CAAC,MAAM,CAAC;QAC7B,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,8BAA8B;QACrC,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,EAAE;KACZ,CAAC;CACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}