nausto-signalk 0.6.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 CHANGED
@@ -15,7 +15,7 @@ active crew members can read the selected values and history.
15
15
  ## Connect
16
16
 
17
17
  1. Install `nausto-signalk` through Signal K's AppStore, or install the supplied
18
- `.tgz` with `npm install /path/to/nausto-signalk-0.6.0.tgz` from your Signal K configuration directory.
18
+ `.tgz` with `npm install /path/to/nausto-signalk-0.9.0.tgz` from your Signal K configuration directory.
19
19
  2. Enable **Nausto** in Plugin Config. Open **Nausto** under Webapps and sign in to Signal K as an administrator.
20
20
  3. In Nausto, open Boat → Sensors, create a connection and copy its pairing code, or save its QR image.
21
21
  4. Enter the eight-character code, paste a copied code or import the QR image in the plugin. Older
@@ -89,10 +89,14 @@ with at most one ordinary sample per minute. A new source report is forwarded af
89
89
  without a significant change. Re-reading the same timestamped cache never refreshes a reading.
90
90
  Actual state/alarm and quality transitions are saved immediately and wake the sender. The first
91
91
  value is a baseline and keeps the ordinary minute window. A transition window can be sealed and
92
- sent before that minute at the next permitted batch attempt. Requests remain at least 31 seconds
93
- apart; selection checks, queued batches, network failures and server `Retry-After` can delay
94
- delivery. Transitions coalesce durably while waiting. An explicit server delay also blocks new
95
- batches, survives restarts and does not change sealed payloads or measurement identities.
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.
96
100
  Original source time, null values and units are retained. A heartbeat never makes an old reading new.
97
101
  An undated cached value is not sent as a fresh measurement after a restart. A batch window starts
98
102
  when its first observation is captured; missing source times use that conservative window time.
@@ -100,13 +104,15 @@ when its first observation is captured; missing source times use that conservati
100
104
  The private SQLite queue retains up to 10,000 observations, 10 MiB and seven days per connection.
101
105
  Up to five connection profiles are retained locally. When an old profile or oldest batch is evicted,
102
106
  the gap is counted. Rejected batches and exhausted retries remain visible and can be retried explicitly.
103
- 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.
104
108
 
105
109
  ## Switching circuits
106
110
 
107
111
  A path Signal K reports as controllable (`supportsPut`), with an on/off value (true/false, or 1/0
108
112
  on a `.state` path) from a single source, is offered to Nausto as a circuit. It belongs to the same
109
- source as the sensors from that Signal K source. Paths under `steering`, `propulsion`, `navigation`
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`
110
116
  and `notifications` are never offered. There is no activation step and no on-board choice: a boat
111
117
  owner can switch the circuit in Nausto right away, give active crew members the right to switch
112
118
  it, or turn off control for a circuit. At most 16 circuits are offered, those already offered
@@ -130,10 +136,38 @@ the plugin checks the path again: still controllable, same source and same type.
130
136
  done, 405 not supported, another 4xx declined, and 5xx, an error or no answer within 20 seconds
131
137
  unknown. Only a new report from the source confirms the new state. A change is reported at once
132
138
  and an unchanged circuit at least every few minutes. A quiet connection with circuits checks for
133
- commands every 40 seconds. Requests are at least 31 seconds apart, so the plugin sends at most 117
134
- in an hour and never pauses near the end of the hour. If Nausto declines a control
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
135
144
  message, readings continue and switching waits until you choose Retry in the plugin's Details.
136
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.
170
+
137
171
  ## Optional boat GNSS source
138
172
 
139
173
  The plugin can announce a GNSS source when both Nausto and the installed plugin support the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nausto-signalk",
3
- "version": "0.6.0",
3
+ "version": "0.9.0",
4
4
  "description": "Connect selected Signal K boat sensors to Nausto with pairing and durable delivery",
5
5
  "main": "index.cjs",
6
6
  "files": [