signalk-chiplog 1.2.0 → 2.1.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +167 -32
  2. package/README.md +315 -110
  3. package/index.js +125 -41
  4. package/lib/api.js +132 -7
  5. package/lib/crew.js +185 -0
  6. package/lib/database.js +144 -1
  7. package/lib/departure-forecast.js +150 -0
  8. package/lib/detection.js +52 -12
  9. package/lib/entries.js +92 -5
  10. package/lib/events.js +29 -15
  11. package/lib/export.js +12 -1
  12. package/lib/forecast-schedule.js +67 -0
  13. package/lib/formats.js +13 -1
  14. package/lib/influx-history.js +480 -0
  15. package/lib/logbook-pdf.js +326 -13
  16. package/lib/observation-recorder.js +133 -4
  17. package/lib/replay-job.js +174 -0
  18. package/lib/replay.js +231 -0
  19. package/lib/tide-forecaster.js +23 -116
  20. package/lib/track-recorder.js +4 -2
  21. package/lib/track.js +1 -0
  22. package/lib/weather-forecaster.js +147 -0
  23. package/package.json +4 -1
  24. package/public/app.css +140 -9
  25. package/public/entry/entry.css +71 -0
  26. package/public/entry/js/components/CrewDialog.mjs +200 -0
  27. package/public/entry/js/main.mjs +114 -0
  28. package/public/entry/sw.js +1 -0
  29. package/public/js/components/CrewCard.mjs +22 -0
  30. package/public/js/components/PassageView.mjs +117 -32
  31. package/public/js/components/ReplayView.mjs +194 -0
  32. package/public/js/components/TrackMap.mjs +46 -2
  33. package/public/js/components/TrackScrubber.mjs +64 -0
  34. package/public/js/components/WeatherCard.mjs +134 -0
  35. package/public/js/context.mjs +4 -1
  36. package/public/js/format.mjs +13 -0
  37. package/public/js/i18n.mjs +202 -0
  38. package/public/js/log-lines.mjs +29 -0
  39. package/public/js/main.mjs +9 -2
  40. package/public/js/track.mjs +33 -0
  41. package/public/js/weather.mjs +193 -0
package/CHANGELOG.md CHANGED
@@ -1,49 +1,169 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to Chiplog are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/).
3
+ All notable changes to Chiplog are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
+ [Semantic Versioning](https://semver.org/).
4
6
 
5
7
  ## [Unreleased]
6
8
 
9
+ ## [2.1.0] - 2026-09-17
10
+
11
+ ### Added
12
+
13
+ - Crew list: a per-passage roster of who is aboard, shown as a compact list on the tablet's main screen and editable
14
+ from a dialog that picks from — and can extend — a global crew roster (name + optional role, e.g. skipper/crew),
15
+ without an admin login the same way a place name can be corrected. A name typed there is added to the roster and
16
+ picked at once, immediately correctable or permanently removable with its own icons, right alongside every other name.
17
+ A new passage starts with the same crew as the one before it, still adjustable. Shown read-only, one member per line,
18
+ in its own card on the webapp's passage page, and in the PDF logbook's departure line; included in the JSON export
19
+ (`GET /entries/:id`'s `crew`, `GET /crew`, `PATCH`/`DELETE /crew/:id`, `PUT /entries/:id/crew`).
20
+ - Marine weather forecast: fetched near the departure position for the next 24 hours when a passage opens (Open-Meteo
21
+ Forecast and Marine, free and keyless, can be turned off with its own setting), shown — titled with the departure
22
+ place — on the passage page as a table every 3 hours (sky and rain, wind as a Beaufort force with direction, speed and
23
+ gusts, waves, swell, pressure, visibility, air and sea temperature, and current), in a full-width block of its own
24
+ above the day's table in the PDF logbook, and in the JSON export (`GET /entries/:id/weather`). Far from the sea, the
25
+ atmospheric part is kept on its own.
26
+ - PDF logbook: the tide forecast's high and low times and heights, and the tanks and batteries noted as the passage
27
+ opened, now print side by side in a block of their own, below the weather forecast and above the day's table.
28
+
29
+ ### Changed
30
+
31
+ - A passage now closes as soon as the boat stops, instead of 30 minutes later: its arrival is named, its arrival reading
32
+ taken and the USB copy written straight away. Leaving again within that tolerance reopens the same passage, the stop
33
+ being kept on its timeline as a stopover line naming the place, as a merge does, followed by a departure line at the
34
+ time the boat set off again — with its instrument reading, and in the PDF as "Departure from" the stopover's place. A
35
+ passage closed from the webapp is never reopened. Casting off from the tablet within the tolerance of an arrival goes
36
+ to the passage that just ended, which carries on once the boat moves. The "Stop duration that ends a passage" setting
37
+ (`stopClosureMinutes`, unchanged) is now titled "Stop duration within which a new departure continues the passage".
38
+ - The "Tide service" setting is now titled "Marine service", since the weather forecast also reads the sea state and
39
+ current from it. The setting itself (`tideUrl`) is unchanged.
40
+
41
+ ### Fixed
42
+
43
+ - A new passage's tide and weather forecasts are fetched as soon as it opens, instead of up to a minute later — or up to
44
+ an hour later when an earlier passage's fetch had kept failing while offline, since the retry delay carried over from
45
+ one passage to the next.
46
+ - On a phone, the webapp no longer scrolls sideways: the top navigation wraps onto a second line when it does not fit,
47
+ and the cards shown side by side on a wide screen (tide, engine and sail, boat status) now shrink to the screen width
48
+ instead of staying 420 px wide.
49
+
50
+ ## [2.0.0] - 2026-09-16
51
+
52
+ ### Added
53
+
54
+ - The passage page has a **Boat status** card: each engine's hour counter, at departure and arrival, and every tank's
55
+ level (and volume) and every battery's charge, voltage and current as noted at departure. Tanks and batteries are
56
+ noted once on the passage as it opens (`startTanks`, `startBatteries`), whether detection or the crew opens it, and
57
+ included in the JSON export.
58
+ - Merging two entries now keeps a record of the stop between them: a `stopover` line on the surviving passage's
59
+ timeline, naming the place and its position — previously that information was silently lost once the merge took the
60
+ later entry's arrival as its own.
61
+ - The passage page's track map now shows a small boat marker at the selected point, pointing along its heading, and a
62
+ scrubber under the map to step back and forth through the track's history — it defaults to the latest point, doubling
63
+ as the current position on a passage in progress. A band below it shows that point's time, SOG, COG, STW, TWS, TWD,
64
+ TWA and AWA. Speed through water now rides along with every track point like wind and heading already did, not just
65
+ the hourly instrument snapshot.
66
+ - Retrospective analysis: a new **Retrospective** page reconstructs past passages for a date range from a
67
+ [signalk-to-influxdb](https://github.com/tkurki/signalk-to-influxdb) history (InfluxDB 1.x, local or remote — a new
68
+ recommended companion plugin), through the exact same detection pipeline used live rather than a separate
69
+ implementation. Runs in the background with a progress bar, refuses a range that overlaps a passage already on record,
70
+ refuses to run at all while a passage is under way (it would be driving that same live passage through the replay's
71
+ detector at the same time), and can be cancelled mid-way without losing what it already reconstructed. Data is matched
72
+ to this server's own vessel identity by default, overridable (`influxSelfContext`) for running it from a different
73
+ Signal K server than the one that wrote the history; a mismatch fails with the vessel contexts actually found, rather
74
+ than reconstructing nothing with no explanation. An InfluxDB that never answers — unreachable, or overloaded — fails
75
+ after 30 seconds with the actual connection problem, rather than hanging indefinitely on a generic "fetch failed". A
76
+ quick first pass reads one mean speed per minute to find when the boat moved, and only those stretches are then
77
+ fetched — one value per track interval — and replayed, committing once per ten simulated minutes, and the page sums up
78
+ what a run added (passages, distance, engine and sail time, track points, events): a month now takes seconds rather
79
+ than the best part of an hour, and no longer holds every raw reading of the range in memory. Requests stay bounded (a
80
+ week for the scan, six hours for a stretch) with a short pause between them, so a multi-week reconstruction cannot
81
+ overwhelm a database sharing a resource-constrained host (a Raspberry Pi) with Signal K itself; cancelling works at
82
+ any stage. A replay wakes the place-naming lookup immediately once it finishes, rather than leaving
83
+ newly-reconstructed departures and arrivals waiting out whatever backoff that chain was already in. Signal K alarms
84
+ are not reconstructed, since a typical InfluxDB history does not archive notifications the way it does a numeric
85
+ reading, nor are weather events while the boat lay still between passages, nor the extra track points live recording
86
+ adds on turns and speed changes.
87
+
88
+ ### Fixed
89
+
90
+ - The arrival instrument snapshot (`entry_end`) is now dated from the moment the passage actually ended, not from the
91
+ later tick that found out about it once the stop had held past the closure threshold (up to `stopClosureMinutes`) — it
92
+ could otherwise sort after an hourly reading taken during that wait, even though the passage had already ended before
93
+ that reading was taken.
94
+
7
95
  ## [1.2.0] - 2026-09-15
8
96
 
9
97
  ### Added
10
98
 
11
- - The tablet app's handwriting pad now fills the whole screen and has a toolbar: fine pen, thick pen, highlighter, eraser, undo and a choice of colour (kept to the theme's colour in night mode). The eraser removes only the points it touches, splitting a stroke instead of deleting all of it; undo now steps back through erasing too, not just strokes. A stroke's colour and tool travel with it to the webapp's timeline and the PDF export, not just the tablet.
99
+ - The tablet app's handwriting pad now fills the whole screen and has a toolbar: fine pen, thick pen, highlighter,
100
+ eraser, undo and a choice of colour (kept to the theme's colour in night mode). The eraser removes only the points it
101
+ touches, splitting a stroke instead of deleting all of it; undo now steps back through erasing too, not just strokes.
102
+ A stroke's colour and tool travel with it to the webapp's timeline and the PDF export, not just the tablet.
12
103
 
13
104
  ### Fixed
14
105
 
15
- - The tablet app's stylus canvas now prevents the default action on every contact, not just the pen's — a resting palm's touch was left to the browser, which could hijack it as a gesture and cancel the pen's in-progress stroke, or show a native text-selection highlight over the canvas. iOS Safari's long-press selection callout on the canvas needed the whole entry app, not just the canvas, to opt out of selection to reliably stay away, plus blocking `selectstart`/`contextmenu`/`dragstart` directly since the CSS alone is unreliable on some iOS versions.
16
- - Quickly lifting and reapplying the pen could have its next stroke silently dropped: the previous contact's pointerup can arrive after the next one's pointerdown, which read as "still drawing" and refused to start the new stroke.
17
- - Worked around an iPadOS Safari/Scribble bug that could swallow a pen's pointer events mid-stroke, dropping strokes or having them mistakenly typed into the comment field, by also preventing the canvas's underlying touch events directly, not just the pointer ones.
18
- - An autopilot engagement, disengagement or mode change now takes an instrument snapshot like every other automatic event, instead of logging the change with no conditions attached.
106
+ - The tablet app's stylus canvas now prevents the default action on every contact, not just the pen's — a resting palm's
107
+ touch was left to the browser, which could hijack it as a gesture and cancel the pen's in-progress stroke, or show a
108
+ native text-selection highlight over the canvas. iOS Safari's long-press selection callout on the canvas needed the
109
+ whole entry app, not just the canvas, to opt out of selection to reliably stay away, plus blocking
110
+ `selectstart`/`contextmenu`/`dragstart` directly since the CSS alone is unreliable on some iOS versions.
111
+ - Quickly lifting and reapplying the pen could have its next stroke silently dropped: the previous contact's pointerup
112
+ can arrive after the next one's pointerdown, which read as "still drawing" and refused to start the new stroke.
113
+ - Worked around an iPadOS Safari/Scribble bug that could swallow a pen's pointer events mid-stroke, dropping strokes or
114
+ having them mistakenly typed into the comment field, by also preventing the canvas's underlying touch events directly,
115
+ not just the pointer ones.
116
+ - An autopilot engagement, disengagement or mode change now takes an instrument snapshot like every other automatic
117
+ event, instead of logging the change with no conditions attached.
19
118
 
20
119
  ## [1.1.0] - 2026-09-15
21
120
 
22
121
  ### Added
23
122
 
24
- - A summary above the logbook's day-grouped list: number of passages, total distance and total time, across every passage logged rather than just the pages currently loaded (`GET /entries/stats`).
25
- - Tide forecast: fetched near the departure position for the next 24 hours when a passage opens (Open-Meteo Marine, free and keyless, configurable and can be turned off), shown on the passage page with the departure's place, the date, time and height of each high/low tide, and the water height curve. Sits next to the engine/sail card, each taking about half the width on a wide screen instead of the full width. Heights are relative to mean sea level, not the chart datum nautical tide tables use, and the app says so (`datum: "msl"` in the API).
26
- - Editing and deleting logbook lines from the webapp's passage page: any line's comment can be corrected, and a manoeuvre or note the crew logged themselves can be deleted (automatic lines — alarms, autopilot, weather, corrections — can only be annotated).
27
- - Highest speed and wind seen on a passage, shown alongside the average speed on the passage page (`maxSpeed`/`maxWindSpeed` in the API). Wind (true and apparent) and heading now ride along with every track point, not just the hourly instrument snapshot, so a gust between snapshots is no longer missed.
28
- - Automatic engine/sail switches now show as a line in the passage log, not just on the engine/sail strip, with the conditions at that moment (`propulsion_change` event).
29
- - Facsimile PDF logbook: A4 landscape, a page per day in ship's time, with time, position, course, speed, wind, barometer, depth, engine or sail and remarks; departure and arrival lines with passage totals, day totals, handwritten notes drawn. Downloadable from the export page in the webapp's language and the device's time zone.
30
- - Engine hours of every engine: each engine's hour counter is recorded in readings, shown at departure and arrival with the hours run on the passage page and in the PDF, and exported as one CSV column per engine and in the JSON (`engineRuntimes`).
31
- - One PDF per passage in the USB copy, in the new logbook language and ship's time zone settings. Existing copies gain their PDFs at the next copy.
123
+ - A summary above the logbook's day-grouped list: number of passages, total distance and total time, across every
124
+ passage logged rather than just the pages currently loaded (`GET /entries/stats`).
125
+ - Tide forecast: fetched near the departure position for the next 24 hours when a passage opens (Open-Meteo Marine, free
126
+ and keyless, configurable and can be turned off), shown on the passage page with the departure's place, the date, time
127
+ and height of each high/low tide, and the water height curve. Sits next to the engine/sail card, each taking about
128
+ half the width on a wide screen instead of the full width. Heights are relative to mean sea level, not the chart datum
129
+ nautical tide tables use, and the app says so (`datum: "msl"` in the API).
130
+ - Editing and deleting logbook lines from the webapp's passage page: any line's comment can be corrected, and a
131
+ manoeuvre or note the crew logged themselves can be deleted (automatic lines — alarms, autopilot, weather, corrections
132
+ — can only be annotated).
133
+ - Highest speed and wind seen on a passage, shown alongside the average speed on the passage page
134
+ (`maxSpeed`/`maxWindSpeed` in the API). Wind (true and apparent) and heading now ride along with every track point,
135
+ not just the hourly instrument snapshot, so a gust between snapshots is no longer missed.
136
+ - Automatic engine/sail switches now show as a line in the passage log, not just on the engine/sail strip, with the
137
+ conditions at that moment (`propulsion_change` event).
138
+ - Facsimile PDF logbook: A4 landscape, a page per day in ship's time, with time, position, course, speed, wind,
139
+ barometer, depth, engine or sail and remarks; departure and arrival lines with passage totals, day totals, handwritten
140
+ notes drawn. Downloadable from the export page in the webapp's language and the device's time zone.
141
+ - Engine hours of every engine: each engine's hour counter is recorded in readings, shown at departure and arrival with
142
+ the hours run on the passage page and in the PDF, and exported as one CSV column per engine and in the JSON
143
+ (`engineRuntimes`).
144
+ - One PDF per passage in the USB copy, in the new logbook language and ship's time zone settings. Existing copies gain
145
+ their PDFs at the next copy.
32
146
  - Screenshots for the Signal K App Store listing (`signalk.screenshots` in `package.json`).
33
147
 
34
148
  ### Changed
35
149
 
36
- - The tablet app's comment and delete actions on a recent entry are now icon buttons, keeping the same touch target size.
150
+ - The tablet app's comment and delete actions on a recent entry are now icon buttons, keeping the same touch target
151
+ size.
37
152
  - Times are shown on the 24-hour clock in English too.
38
153
 
39
154
  ### Fixed
40
155
 
41
- - The log reading in instrument snapshots now comes from `navigation.log` (the total, non-resettable distance log), not `navigation.trip.log`, which a crew resetting the trip counter could zero out mid-passage.
42
- - Renaming a departure or arrival now also renames that place on every later passage that already reused it, as documented; an earlier passage keeps the name it recorded.
156
+ - The log reading in instrument snapshots now comes from `navigation.log` (the total, non-resettable distance log), not
157
+ `navigation.trip.log`, which a crew resetting the trip counter could zero out mid-passage.
158
+ - Renaming a departure or arrival now also renames that place on every later passage that already reused it, as
159
+ documented; an earlier passage keeps the name it recorded.
43
160
  - An alarm's message is no longer repeated as its comment in the passage log.
44
- - The arrival correction field no longer appears, and is refused by the API (`409 entry_active`), on a passage still in progress — it has no arrival yet, only a moving last-seen position.
45
- - A note or handwritten sketch logged live now takes an instrument snapshot too, like a manoeuvre already did, so the conditions it was written in show in the log.
46
- - The App Store icon (`signalk.appIcon`) pointed at a non-existent `icon.svg` at the package root; the icon has always lived at `public/icon.svg`.
161
+ - The arrival correction field no longer appears, and is refused by the API (`409 entry_active`), on a passage still in
162
+ progress it has no arrival yet, only a moving last-seen position.
163
+ - A note or handwritten sketch logged live now takes an instrument snapshot too, like a manoeuvre already did, so the
164
+ conditions it was written in show in the log.
165
+ - The App Store icon (`signalk.appIcon`) pointed at a non-existent `icon.svg` at the package root; the icon has always
166
+ lived at `public/icon.svg`.
47
167
 
48
168
  ## [1.0.0] - 2026-09-13
49
169
 
@@ -53,19 +173,29 @@ First release.
53
173
 
54
174
  #### Logbook
55
175
 
56
- - One logbook entry per passage, opened when the boat gets under way and closed when it arrives, with a configurable tolerance for short stops (30 minutes by default).
57
- - Under way or stopped decided from `navigation.state` published by [signalk-autostate](https://github.com/meri-imperiumi/signalk-autostate), or from speed over ground averaged over 3 minutes when it is absent. Departures and arrivals are dated from raw speed, so the passage starts where the boat actually left.
58
- - signalk-autostate's value is preferred when another source, such as the boat's own AIS transponder, also publishes `navigation.state`. When detection works from speed alone, the apps say why.
176
+ - One logbook entry per passage, opened when the boat gets under way and closed when it arrives, with a configurable
177
+ tolerance for short stops (30 minutes by default).
178
+ - Under way or stopped decided from `navigation.state` published by
179
+ [signalk-autostate](https://github.com/meri-imperiumi/signalk-autostate), or from speed over ground averaged over 3
180
+ minutes when it is absent. Departures and arrivals are dated from raw speed, so the passage starts where the boat
181
+ actually left.
182
+ - signalk-autostate's value is preferred when another source, such as the boat's own AIS transponder, also publishes
183
+ `navigation.state`. When detection works from speed alone, the apps say why.
59
184
  - Passages closed at their last movement after a power cut; passages split by a long stop can be merged back.
60
- - GPS track at a configurable interval (15 s by default), with extra points on turns and speed changes; distance from the track.
61
- - Engine and sail periods from engine revolutions, engine state, `navigation.state` or a configurable default, with manual correction.
185
+ - GPS track at a configurable interval (15 s by default), with extra points on turns and speed changes; distance from
186
+ the track.
187
+ - Engine and sail periods from engine revolutions, engine state, `navigation.state` or a configurable default, with
188
+ manual correction.
62
189
  - Instrument readings at departure, every hour on the hour (configurable), at arrival and with each live manoeuvre.
63
- - Automatic events: Signal K alarms and emergencies, autopilot changes, true wind crossing configurable thresholds, barometer falling over 3 hours.
64
- - Departure and arrival names from known places, then online geocoding (any Nominatim-compatible service, can be turned off); a renamed place is remembered for later passages.
190
+ - Automatic events: Signal K alarms and emergencies, autopilot changes, true wind crossing configurable thresholds,
191
+ barometer falling over 3 hours.
192
+ - Departure and arrival names from known places, then online geocoding (any Nominatim-compatible service, can be turned
193
+ off); a renamed place is remembered for later passages.
65
194
 
66
195
  #### Logbook webapp
67
196
 
68
- - Status bar, passages grouped by day, passage page with map (OpenStreetMap and OpenSeaMap), engine and sail periods, and the log of readings and events, handwritten notes included.
197
+ - Status bar, passages grouped by day, passage page with map (OpenStreetMap and OpenSeaMap), engine and sail periods,
198
+ and the log of readings and events, handwritten notes included.
69
199
  - Corrections: rename departure or arrival, switch an engine or sail period, close, merge and delete passages.
70
200
  - Export of the whole logbook or a date range as JSON, CSV (nautical units) or GPX.
71
201
  - English and French.
@@ -73,7 +203,8 @@ First release.
73
203
  #### Tablet entry app
74
204
 
75
205
  - Installable app at `/signalk-chiplog/entry/`, designed for gloves and wet fingers, with a red night mode.
76
- - Manoeuvre shortcuts, with the sail picked on a sail change; casting off or weighing anchor opens the passage before the boat moves.
206
+ - Manoeuvre shortcuts, with the sail picked on a sail change; casting off or weighing anchor opens the passage before
207
+ the boat moves.
77
208
  - Keyboard notes and stylus handwriting with pressure and palm rejection.
78
209
  - Undo and comment right after each entry; latest entries with edit and delete.
79
210
  - Entries kept on the tablet while the Wi-Fi is down and sent in order when it is back, never twice.
@@ -81,15 +212,19 @@ First release.
81
212
 
82
213
  #### Abandon-ship copy
83
214
 
84
- - One JSON, CSV and GPX file per passage on a USB drive, named to sort by date, written only when new or changed, with obsolete files removed.
85
- - Copied automatically every 15 minutes and at each arrival (both configurable), or on demand; a missing drive is reported in the plugin status and on the export page.
215
+ - One JSON, CSV and GPX file per passage on a USB drive, named to sort by date, written only when new or changed, with
216
+ obsolete files removed.
217
+ - Copied automatically every 15 minutes and at each arrival (both configurable), or on demand; a missing drive is
218
+ reported in the plugin status and on the export page.
86
219
 
87
220
  #### API and data
88
221
 
89
222
  - REST API under `/plugins/signalk-chiplog/api`, documented in [docs/API.md](docs/API.md).
90
223
  - Single SQLite database through Node's built-in `node:sqlite`: no native module to build.
91
224
 
92
- [Unreleased]: https://github.com/ricard33/signalk-chiplog/compare/v1.2.0...HEAD
225
+ [Unreleased]: https://github.com/ricard33/signalk-chiplog/compare/v2.1.0...HEAD
226
+ [2.1.0]: https://github.com/ricard33/signalk-chiplog/compare/v2.0.0...v2.1.0
227
+ [2.0.0]: https://github.com/ricard33/signalk-chiplog/compare/v1.2.0...v2.0.0
93
228
  [1.2.0]: https://github.com/ricard33/signalk-chiplog/compare/v1.1.0...v1.2.0
94
229
  [1.1.0]: https://github.com/ricard33/signalk-chiplog/compare/v1.0.0...v1.1.0
95
230
  [1.0.0]: https://github.com/ricard33/signalk-chiplog/releases/tag/v1.0.0