nausto-signalk 0.5.0 → 0.9.0
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.
- package/README.md +77 -9
- package/package.json +1 -1
- package/plugin.cjs +1608 -126
- package/public/index.html +4 -0
- package/public/setup.js +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Nausto for Signal K
|
|
2
2
|
|
|
3
|
-
A Signal K plugin for sharing selected own-vessel sensors with your boat in Nausto
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
A Signal K plugin for sharing selected own-vessel sensors with your boat in Nausto, and for
|
|
4
|
+
switching the on/off circuits Signal K reports as controllable. It runs on the Signal K server,
|
|
5
|
+
uses outgoing HTTPS, and keeps a bounded durable queue during network interruptions. It never
|
|
6
|
+
controls steering, propulsion, navigation or notifications, and never changes calibration or
|
|
7
|
+
maintenance history.
|
|
6
8
|
|
|
7
9
|
## Requirements
|
|
8
10
|
|
|
@@ -13,7 +15,7 @@ active crew members can read the selected values and history.
|
|
|
13
15
|
## Connect
|
|
14
16
|
|
|
15
17
|
1. Install `nausto-signalk` through Signal K's AppStore, or install the supplied
|
|
16
|
-
`.tgz` with `npm install /path/to/nausto-signalk-0.
|
|
18
|
+
`.tgz` with `npm install /path/to/nausto-signalk-0.9.0.tgz` from your Signal K configuration directory.
|
|
17
19
|
2. Enable **Nausto** in Plugin Config. Open **Nausto** under Webapps and sign in to Signal K as an administrator.
|
|
18
20
|
3. In Nausto, open Boat → Sensors, create a connection and copy its pairing code, or save its QR image.
|
|
19
21
|
4. Enter the eight-character code, paste a copied code or import the QR image in the plugin. Older
|
|
@@ -87,10 +89,14 @@ with at most one ordinary sample per minute. A new source report is forwarded af
|
|
|
87
89
|
without a significant change. Re-reading the same timestamped cache never refreshes a reading.
|
|
88
90
|
Actual state/alarm and quality transitions are saved immediately and wake the sender. The first
|
|
89
91
|
value is a baseline and keeps the ordinary minute window. A transition window can be sealed and
|
|
90
|
-
sent before that minute at the next permitted batch attempt.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
sent before that minute at the next permitted batch attempt. A new on/off or alarm value after a
|
|
93
|
+
known reading goes at once, with its sealed window, on Nausto's alarm lane when the server offers
|
|
94
|
+
it; changed availability or quality and numbers keep the ordinary cadence. The alarm lane takes at
|
|
95
|
+
most 50 requests per rolling hour, has its own pause, and a window it does not take goes the
|
|
96
|
+
ordinary way. Ordinary requests remain at least 31 seconds apart; selection checks, queued batches,
|
|
97
|
+
network failures and server `Retry-After` can delay delivery. Transitions coalesce durably while
|
|
98
|
+
waiting. An explicit server delay on the ordinary way also blocks new ordinary batches, survives
|
|
99
|
+
restarts and does not change sealed payloads or measurement identities.
|
|
94
100
|
Original source time, null values and units are retained. A heartbeat never makes an old reading new.
|
|
95
101
|
An undated cached value is not sent as a fresh measurement after a restart. A batch window starts
|
|
96
102
|
when its first observation is captured; missing source times use that conservative window time.
|
|
@@ -98,7 +104,69 @@ when its first observation is captured; missing source times use that conservati
|
|
|
98
104
|
The private SQLite queue retains up to 10,000 observations, 10 MiB and seven days per connection.
|
|
99
105
|
Up to five connection profiles are retained locally. When an old profile or oldest batch is evicted,
|
|
100
106
|
the gap is counted. Rejected batches and exhausted retries remain visible and can be retried explicitly.
|
|
101
|
-
No API or log returns keys, pairing codes, raw batches or private database paths.
|
|
107
|
+
No API or log returns keys, pairing codes, live tickets, raw batches or private database paths.
|
|
108
|
+
|
|
109
|
+
## Switching circuits
|
|
110
|
+
|
|
111
|
+
A path Signal K reports as controllable (`supportsPut`), with an on/off value (true/false, or 1/0
|
|
112
|
+
on a `.state` path) from a single source, is offered to Nausto as a circuit. It belongs to the same
|
|
113
|
+
source as the sensors from that Signal K source, and the readings beside it in the same device
|
|
114
|
+
(the same parent path, such as `boatHub.devices.<id>.power` next to `boatHub.devices.<id>.relayState`)
|
|
115
|
+
are sent with it, so Nausto shows the circuit's button on that sensor's page. Paths under `steering`, `propulsion`, `navigation`
|
|
116
|
+
and `notifications` are never offered. There is no activation step and no on-board choice: a boat
|
|
117
|
+
owner can switch the circuit in Nausto right away, give active crew members the right to switch
|
|
118
|
+
it, or turn off control for a circuit. At most 16 circuits are offered, those already offered
|
|
119
|
+
first, and the plugin's Details list them.
|
|
120
|
+
|
|
121
|
+
A circuit named or identified as a bilge pump or an alarm (such as `bilge`, `lensepumpe` or
|
|
122
|
+
`alarm`) is protected and is never switched off. The plugin reads every name Signal K has for the
|
|
123
|
+
path and its parent, and the path itself, checks this before every call, and a later name change
|
|
124
|
+
never lowers the protection.
|
|
125
|
+
|
|
126
|
+
A circuit named or identified as an anchor windlass, a winch or a propeller or thruster (such as
|
|
127
|
+
`ankerspill`, `windlass`, `vinsj`, `winch`, `propell` or `thruster`, also inside compound words) is
|
|
128
|
+
never offered and never switched, because Nausto cannot tell whether anyone is on board when it
|
|
129
|
+
starts. `anchor` alone does not count, so an anchor light can still be switched. The plugin checks
|
|
130
|
+
the same names at every offer and right before every call, so an offered circuit that gets such a
|
|
131
|
+
name is not called and leaves the next offer.
|
|
132
|
+
|
|
133
|
+
Each command is stored before one Signal K PUT to the handler that owns the path, and a lost
|
|
134
|
+
response or a restart never repeats it. Commands live at most 60 seconds. Right before the call
|
|
135
|
+
the plugin checks the path again: still controllable, same source and same type. Status 200 is
|
|
136
|
+
done, 405 not supported, another 4xx declined, and 5xx, an error or no answer within 20 seconds
|
|
137
|
+
unknown. Only a new report from the source confirms the new state. A change is reported at once
|
|
138
|
+
and an unchanged circuit at least every few minutes. A quiet connection with circuits checks for
|
|
139
|
+
commands every 40 seconds, and fetches a command at once when Nausto wakes it over the live
|
|
140
|
+
connection. The result, and the circuit's reports for 60 seconds after a command, go at once on a
|
|
141
|
+
separate control lane of at most 100 requests per rolling hour; the offer goes the ordinary way.
|
|
142
|
+
Ordinary requests are at least 31 seconds apart, so the plugin sends at most 117 in an hour and
|
|
143
|
+
never pauses near the end of the hour; the lanes never delay them. If Nausto declines a control
|
|
144
|
+
message, readings continue and switching waits until you choose Retry in the plugin's Details.
|
|
145
|
+
|
|
146
|
+
## Live connection
|
|
147
|
+
|
|
148
|
+
The plugin keeps an outgoing WebSocket connection to `wss://nausto.no/integrasjoner/sensors/live`,
|
|
149
|
+
derived from its fixed pairing address and never from a server response. It carries a wake-up
|
|
150
|
+
after a command is ordered in Nausto and, while someone is looking at the boat's sensors in
|
|
151
|
+
Nausto, live readings of the selected sensors; commands, results and the stored readings always go
|
|
152
|
+
over HTTPS. An ordinary request asks for a ten-minute ticket, which is sent only in the WebSocket
|
|
153
|
+
protocol header, never in the address, and renewed with a new connection when less than five
|
|
154
|
+
minutes remain. The ticket is never stored, logged or shown. The connection sends a keepalive every
|
|
155
|
+
45 seconds and reconnects after an interruption with a growing, randomised wait of one second to
|
|
156
|
+
one minute. Details shows whether it is off, connecting or connected, and whether live readings
|
|
157
|
+
are being sent. Without the connection, because live is off in Nausto, the network blocks it or the
|
|
158
|
+
server is older, a command is fetched within 40 seconds as before. A server without the lanes gets
|
|
159
|
+
every request the ordinary way. The connection uses the WebSocket built into Node.js.
|
|
160
|
+
|
|
161
|
+
When Nausto says someone is watching, the plugin sends the latest known reading of each selected
|
|
162
|
+
sensor at once, with the source's own time and the reading's identity, and then each new reading:
|
|
163
|
+
numbers at most once a second, on/off and text at once. A reading without a source time is never
|
|
164
|
+
sent live, so a snapshot or a wait never makes an old reading look new. At most 30 messages go in
|
|
165
|
+
any ten seconds, the snapshot included; what does not fit waits, combined per sensor, so the latest
|
|
166
|
+
value always arrives. A reading that also goes in a batch has the same identity in both. When
|
|
167
|
+
nobody has watched for 15 seconds, or the connection breaks, the plugin stops and discards what
|
|
168
|
+
was waiting. Live readings are kept only in memory and are never stored or logged; the status
|
|
169
|
+
shows only whether they are sent and how many messages.
|
|
102
170
|
|
|
103
171
|
## Optional boat GNSS source
|
|
104
172
|
|