kahu-signalk 0.0.7 → 0.0.8

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 KAHU Earth AS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ # KAHU Radar Hub protocol
2
+ *A radar crowdsourcing protocol*
3
+
4
+ Contribute AIS and ARPA targets from your vessel to crowdsourcing for marine safety!
5
+
6
+ This is the ptotocol specification used by our plugins and clients as well as server code (e.g. [radarhub-opencpn](https://github.com/KAHU-radar/radarhub-opencpn) and [radarhub-signalk](https://github.com/KAHU-radar/radarhub-signalk)) that lets you upload AIS and radar ARPA targets (or any NMEA) to an internet server.
7
+ The communication protocol is based on [Apache Avro](https://avro.apache.org/) and batches track points so that the overhead for each point above timestamp and lat/lon is low, meaning it is designed to be as bandwidth conservative as possible.
8
+
9
+ Note: This protocol does **not** use the Avro RPC mechanism, as it is not well supported in all languages, and adds extra requirements such as adding run-length framing to each message. Instead, it relies on a simple union of message types.
10
+
11
+ ## Database schema
12
+
13
+ The protocol includes a client side database schema used to cache tracks in an sqlite3 database. It is provided as a series of migration SQL files, to be applied in alphabetical order.
@@ -0,0 +1,24 @@
1
+ create table if not exists target (
2
+ target_id integer primary key autoincrement,
3
+ uuid varchar(36) unique
4
+ );
5
+
6
+ create table if not exists target_position (
7
+ id integer primary key autoincrement,
8
+ timestamp datetime default current_timestamp,
9
+ target_id integer references target(id),
10
+ target_distance float,
11
+ target_bearing float,
12
+ target_bearing_unit text,
13
+ target_speed float,
14
+ target_course float,
15
+ target_course_unit text,
16
+ target_distance_unit text,
17
+ target_name text,
18
+ target_status text,
19
+ latitude float,
20
+ longitude float,
21
+ target_latitude float,
22
+ target_longitude float,
23
+ sent integer default false
24
+ );
@@ -0,0 +1,3 @@
1
+ CREATE INDEX idx_sent ON target_position(sent);
2
+ CREATE INDEX idx_target_id ON target_position(target_id);
3
+ CREATE INDEX idx_sent_target_id_timestamp ON target_position(sent, target_id, timestamp);
@@ -0,0 +1,71 @@
1
+ {"name": "kahu.Proto", "type": "record",
2
+ "fields": [
3
+ {"name": "Message", "type": [
4
+ {"name": "kahu.Call", "type": "record",
5
+ "fields": [
6
+ {"name": "Call", "type": {
7
+ "name": "kahu.CallMessage", "type": "record",
8
+ "fields": [
9
+ {"name": "id", "type": "int"},
10
+ {"name": "Call", "type": [
11
+ {"name": "kahu.LoginMessage", "type": "record",
12
+ "fields": [{"name": "Login", "type": {
13
+ "name": "kahu.Login", "type": "record",
14
+ "fields": [
15
+ {"name": "apikey", "type": "string"}
16
+ ]
17
+ }}]},
18
+ {"name": "kahu.SubmitMessage", "type": "record",
19
+ "fields": [{"name": "Submit", "type": {
20
+ "name": "kahu.Submit", "type": "record",
21
+ "fields": [
22
+ {"name": "uuid", "type": ["null", "string"], "logicalType": "uuid"},
23
+ {"name": "route", "type": {
24
+ "type": "array", "items": {
25
+ "name": "kahu.LineString",
26
+ "type": "record",
27
+ "fields": [
28
+ {"name": "lat", "type": "float"},
29
+ {"name": "lon", "type": "float"},
30
+ {"name": "timestamp", "type": "float"}
31
+ ]
32
+ }}},
33
+ {"name": "nmea", "type": ["null", "string"]},
34
+ {"name": "start", "type": "long", "logicalType": "timestamp-millis"}
35
+ ]
36
+ }}]}
37
+ ]}
38
+ ]}}
39
+ ]},
40
+ {"name": "kahu.Response", "type": "record",
41
+ "fields": [
42
+ {"name": "Response", "type": {
43
+ "name": "kahu.ResponseMessage", "type": "record",
44
+ "fields": [
45
+ {"name": "id", "type": "int"},
46
+ {"name": "Response", "type": [
47
+ {"name": "kahu.ErrorResponseMessage", "type": "record",
48
+ "fields": [{"name": "Error", "type": {
49
+ "name": "kahu.ErrorResponse", "type": "record",
50
+ "fields": [
51
+ {"name": "exception", "type": "string"}
52
+ ]
53
+ }}]},
54
+ {"name": "kahu.LoginResponseMessage", "type": "record",
55
+ "fields": [{"name": "Login", "type": {
56
+ "name": "kahu.LoginResponse", "type": "record",
57
+ "fields": []
58
+ }}]},
59
+ {"name": "kahu.SubmitResponseMessage", "type": "record",
60
+ "fields": [{"name": "Submit", "type": {
61
+ "name": "kahu.SubmitResponse", "type": "record",
62
+ "fields": [
63
+ {"name": "uuid", "type": ["null", "string"], "logicalType": "uuid"}
64
+ ]
65
+ }}]}
66
+ ]}
67
+ ]}}
68
+ ]}
69
+ ]}
70
+ ]
71
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kahu-signalk",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Contribute AIS and ARPA targets from your vessel to crowdsourcing for marine safety!",
5
5
  "keywords": [
6
6
  "signalk-node-server-plugin",