@meri-imperiumi/signalk-meshtastic 1.1.1 → 1.1.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.
package/README.md CHANGED
@@ -91,6 +91,9 @@ Metrics used:
91
91
 
92
92
  ## Changes
93
93
 
94
+ * 1.1.2 (2025-09-25)
95
+ - Added support for the new roles from Meshtastic 2.7 (`ROUTER_LATE` and `CLIENT_BASE`)
96
+ - Fixed issue with sending a bell with alerts that have sound enabled
94
97
  * 1.1.1 (2025-09-18)
95
98
  - Fixed empty response text message to digital switching actions
96
99
  - Added support for the proposed Signal K MOB position specification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meri-imperiumi/signalk-meshtastic",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Signal K plugin for interfacing with the Meshtastic LoRa mesh network",
5
5
  "scripts": {
6
6
  "test": "eslint ."
package/plugin/index.js CHANGED
@@ -146,6 +146,14 @@ function nodeToSignalK(app, node, nodeInfo, settings) {
146
146
  role = 'tak_tracker';
147
147
  break;
148
148
  }
149
+ case 11: {
150
+ role = 'router_late';
151
+ break;
152
+ }
153
+ case 12: {
154
+ role = 'client_base';
155
+ break;
156
+ }
149
157
  default: {
150
158
  break;
151
159
  }
@@ -454,7 +462,7 @@ module.exports = (app) => {
454
462
  {
455
463
  state: 'warn',
456
464
  lower: 0,
457
- upper: 2,
465
+ upper: 5,
458
466
  message: 'Not connected to device',
459
467
  },
460
468
  {
@@ -823,7 +831,7 @@ module.exports = (app) => {
823
831
  return;
824
832
  }
825
833
  let bell = '';
826
- if (v.value.method && v.value.method.indexOf('sound')) {
834
+ if (v.value.method && v.value.method.indexOf('sound') !== -1) {
827
835
  // Trigger audible bell on receiving Meshtastic devices
828
836
  bell = '\u0007 ';
829
837
  }
@@ -840,30 +848,32 @@ module.exports = (app) => {
840
848
  if (v.path.indexOf('notifications.mob.') === 0) {
841
849
  // This is a notification about a MOB beacon, create waypoint
842
850
  let mobPosition;
843
- let mmsi = 9712234567;
844
851
  let mobVessel = {
845
852
  name: 'MOB beacon',
846
- mmsi,
853
+ mmsi: '9712234567',
847
854
  };
848
- if (v.value.data && v.value.data.position) {
849
- // There is a proposal to include position in the notification
850
- mobPosition = v.value.data.position;
851
- if (v.value.data.mmsi) {
852
- mobVessel.mmsi = mmsi;
853
- }
855
+ if (v.value.data && v.value.data.mmsi) {
856
+ mobVessel.mmsi = v.value.data.mmsi;
857
+ }
858
+ if (v.value.position) {
859
+ // signalk-mob-notifier and freeboard-sk include position in the notification
860
+ mobPosition = v.value.position;
854
861
  } else {
855
862
  // See if the MOB can be found from Signal K tree
856
- mmsi = v.path.split('.').at(-1);
863
+ const mmsi = v.path.split('.').at(-1);
857
864
  mobVessel = app.signalk.root.vessels[`vessels.urn:mrn:imo:mmsi:${mmsi}`];
858
865
  if (mobVessel && mobVessel.navigation.position) {
859
866
  mobPosition = mobVessel.navigation.position;
867
+ if (mobPosition.value) {
868
+ mobPosition = mobPosition.value;
869
+ }
860
870
  }
861
871
  }
862
- if (!mobPosition) {
872
+ if (!mobPosition || !mobPosition.latitude) {
863
873
  return;
864
874
  }
865
875
  const setWaypointMessage = create(Protobuf.Mesh.WaypointSchema, {
866
- id: mmsi,
876
+ id: mobVessel.mmsi,
867
877
  latitudeI: Math.floor(mobPosition.latitude / 1e-7),
868
878
  longitudeI: Math.floor(mobPosition.longitude / 1e-7),
869
879
  expire: Math.floor((new Date().getTime() / 1000) + (1 * 60 * 60)),