meshtastic 0.0.131 → 0.0.132
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.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/meshtastic/mqtt.rb +5 -3
- data/lib/meshtastic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55a43435391e779611e5b054b48922b801ede63b8e2a1475ca6231bee6fea0dc
|
|
4
|
+
data.tar.gz: a174043a34c15e67ac5d3633b2f3e7cb4e8043103f1ec772511dfe07ab4e25e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56e964f576c853715ba6991d86e4136f40e2c7aca7a33ab51cc0d395c826738bcc97556b05d3556a611b131520d714a016a9a8fe49235dc8dff0c63cdf3cff16
|
|
7
|
+
data.tar.gz: 9ceb1c0ba1b34b56d44cfdc9c382c2cbee879607555f61671ed4d1d21961ccdb2057b1ce702c74223712191b76382414375ff1a54a63688ff54ba2e6af7fe631
|
data/README.md
CHANGED
|
@@ -30,6 +30,7 @@ At the moment the only module available is `Meshtastic::MQTT`. To view MQTT mes
|
|
|
30
30
|
require 'meshtastic'
|
|
31
31
|
Meshtastic::MQTT.help
|
|
32
32
|
mqtt_obj = Meshastic::MQTT.connect
|
|
33
|
+
puts mqtt_obj.inspect
|
|
33
34
|
Meshtastic::MQTT.subscribe(
|
|
34
35
|
mqtt_obj: mqtt_obj,
|
|
35
36
|
include: '_APP, LongFast'
|
|
@@ -43,6 +44,7 @@ require 'meshtastic'
|
|
|
43
44
|
mqtt_obj = Meshastic::MQTT.connect
|
|
44
45
|
Meshtastic::MQTT.subscribe(
|
|
45
46
|
mqtt_obj: mqtt_obj,
|
|
47
|
+
root_topic: 'msh',
|
|
46
48
|
region: 'US',
|
|
47
49
|
topic: '2/e/LongFast/#',
|
|
48
50
|
psks: { LongFast: 'AQ==' }
|
|
@@ -61,7 +63,9 @@ Meshtastic::MQTT.send_text(
|
|
|
61
63
|
mqtt_obj: mqtt_obj,
|
|
62
64
|
from: client_id,
|
|
63
65
|
to: '!ffffffff',
|
|
64
|
-
|
|
66
|
+
root_topic: 'msh',
|
|
67
|
+
region: 'US',
|
|
68
|
+
topic: '2/e/LongFast/#',
|
|
65
69
|
channel: 93,
|
|
66
70
|
text: 'Hello, World!',
|
|
67
71
|
psks: { LongFast: 'AQ==' }
|
|
@@ -75,6 +79,7 @@ require 'meshtastic'
|
|
|
75
79
|
mqtt_obj = Meshastic::MQTT.connect
|
|
76
80
|
Meshtastic::MQTT.subscribe(
|
|
77
81
|
mqtt_obj: mqtt_obj,
|
|
82
|
+
root_topic: 'msh',
|
|
78
83
|
region: 'US',
|
|
79
84
|
topic: '2/e/LongFast/#',
|
|
80
85
|
psks: { LongFast: 'AQ==' },
|
data/lib/meshtastic/mqtt.rb
CHANGED
|
@@ -255,7 +255,7 @@ module Meshtastic
|
|
|
255
255
|
# to: 'optional - Destination ID (Default: "!ffffffff")',
|
|
256
256
|
# root_topic: 'optional - root topic (default: msh)',
|
|
257
257
|
# region: 'optional - region e.g. "US/VA", etc (default: US)',
|
|
258
|
-
# topic: 'optional - topic to publish to (default: "2/e/LongFast")',
|
|
258
|
+
# topic: 'optional - topic to publish to (default: "2/e/LongFast/#")',
|
|
259
259
|
# channel: 'optional - channel (Default: 6)',
|
|
260
260
|
# text: 'optional - Text Message (Default: SYN)',
|
|
261
261
|
# want_ack: 'optional - Want Acknowledgement (Default: false)',
|
|
@@ -270,9 +270,11 @@ module Meshtastic
|
|
|
270
270
|
opts[:to] ||= '!ffffffff'
|
|
271
271
|
opts[:root_topic] ||= 'msh'
|
|
272
272
|
opts[:region] ||= 'US'
|
|
273
|
-
opts[:topic] ||= '2/e/LongFast'
|
|
273
|
+
opts[:topic] ||= '2/e/LongFast/#'
|
|
274
|
+
opts[:topic] = opts[:topic].to_s.gsub('/#', '')
|
|
274
275
|
opts[:channel] ||= 6
|
|
275
276
|
absolute_topic = "#{opts[:root_topic]}/#{opts[:region]}/#{opts[:topic]}/#{opts[:from]}"
|
|
277
|
+
opts[:topic] = absolute_topic
|
|
276
278
|
opts[:via] = :mqtt
|
|
277
279
|
|
|
278
280
|
# TODO: Implement chunked message to deal with large messages
|
|
@@ -339,7 +341,7 @@ module Meshtastic
|
|
|
339
341
|
to: 'optional - Destination ID (Default: \"!ffffffff\")',
|
|
340
342
|
root_topic: 'optional - root topic (default: msh)',
|
|
341
343
|
region: 'optional - region e.g. 'US/VA', etc (default: US)',
|
|
342
|
-
topic: 'optional - topic to publish to (default: '2/e/LongFast')',
|
|
344
|
+
topic: 'optional - topic to publish to (default: '2/e/LongFast/#')',
|
|
343
345
|
channel: 'optional - channel (Default: 6)',
|
|
344
346
|
text: 'optional - Text Message (Default: SYN)',
|
|
345
347
|
want_ack: 'optional - Want Acknowledgement (Default: false)',
|
data/lib/meshtastic/version.rb
CHANGED