-
Notifications
You must be signed in to change notification settings - Fork 15
Updated Meshtastic Driver for Successful Migration to OSH-Addons #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nickgaray
merged 30 commits into
opensensorhub:master
from
BillBrown341:MeshtasticDriver
Nov 24, 2025
Merged
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
edf253e
Meshtatic Driver
BillBrown341 ceea00d
Merge branch 'opensensorhub:master' into MeshtasticDriver
BillBrown341 ec43c3a
Update Acknoledgement of messages to see personal messages sent by radio
BillBrown341 00f254e
Add Definition to 'destination' field. Added Better Description for t…
BillBrown341 5f7e434
Remove 'System.out.println' to clean up code.
BillBrown341 a1973db
Switched all cases of 'System.err.println' to 'getLogger().error()'
BillBrown341 89b6d1f
Updated All variables to meet consistent naming convention
BillBrown341 6ceeb24
added definition to packet record
BillBrown341 3d777cf
Removed Old Tests that do not work
BillBrown341 26fa39d
Fixed variable naming convention of FOI function
BillBrown341 fd5fdb1
Updated Serial number to be 001 by default instead of meshtastic. Upd…
BillBrown341 2bc89c1
Changed ID for the developer object in build.gradle to my Github profile
BillBrown341 047a10c
Updated 'data record' NAME in Text Msg Control to resolve and competi…
BillBrown341 f5d24d6
Updated Bundle Activator with more meaningful Bundle Activatorclear
BillBrown341 4397ccb
Created more meaningful package name 'org.sensorhub.impl.sensor.mesht…
BillBrown341 d031167
updated doStop() method to update error when stopping sensor
BillBrown341 b4e7032
Updated doStart() to begin processing after handshake has been made w…
BillBrown341 57699ac
Fixed issues with doStop() method
BillBrown341 a8dfff7
added 'foi' to FoiUID to differentiate with sensor UID
BillBrown341 4dcc136
Fixed Naming semantics
BillBrown341 3421f73
Updated Handler and Outputs to implement an Interface to clean up han…
BillBrown341 1a14e64
updated code for unit tests
BillBrown341 5cea76a
Temporarily Removed Unit Tests for Build
BillBrown341 6af97b3
Updated Outputs to VarRateSensorOutput to update sampling period more…
BillBrown341 0c2d499
Removed 'Generated' directory from addons and updated build.gradle to…
BillBrown341 f1db383
Merge branch 'opensensorhub:master' into MeshtasticDriver
BillBrown341 8b5220b
Fixed naming for VarRateSensorOutput
BillBrown341 9e87388
Merge branch 'MeshtasticDriver' of https://github.com/BillBrown341/os…
BillBrown341 b6802d4
Added SensorHubException() when starting the commProvider
BillBrown341 2ec7f16
Configured 'compileJava' task to depend on 'generateProto'
BillBrown341 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "sensors/others/sensorhub-driver-meshtastic/src/main/protobufs"] | ||
| path = sensors/others/sensorhub-driver-meshtastic/src/main/protobufs | ||
| url = https://github.com/meshtastic/protobufs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Meshtastic Driver over Serial Communication | ||
| ## Dependencies | ||
| To work properly, this driver requries a comm module. The driver was tested on a mac using the [sensorhub-comm-jssc](https://github.com/opensensorhub/osh-addons/tree/master/comm/sensorhub-comm-jssc): | ||
|
|
||
|
|
||
| ## Meshtastic Node Configuration | ||
| Prior to using the OSH Meshtastic Driver with a Meshtastic Radio, the radio must be configured with the [Meshtastic Firmware](https://flasher.meshtastic.org/). | ||
| Follow Meshtastic [Getting Started Documentation](https://meshtastic.org/docs/getting-started/) to properly set up a Meshtastic Radio. | ||
|
|
||
| Once the radio has been flashed with Meshtastic Firmware, [connect to the device](https://meshtastic.org/docs/getting-started/initial-config/) to setup it's initial configuration. | ||
|
|
||
| To use this Driver over Serial, you must configure the following Meshtastic Settings: | ||
| - Settings/Serial | ||
| - Make sure ```Enabled``` is **ON** | ||
| - Make sure ```Mode``` is set to ***Protobufs*** | ||
|
|
||
|
|
||
| Once this has been configured, you will need to exit the application and plug your radio directly into the computer running your OSH Node. | ||
|
|
||
| # OSH Node Configuration | ||
| Once your node has been launched. Make sure a ***Communication Provider*** has been selected. (This has been tested | ||
| using the JSSC Serial Comm Provider) and all necessary information has been selected. | ||
|
|
||
| Select ```Apply Changes``` and then ```Start``` the driver. As Meshtastic Protobuf messages are received from your meshtastic radio, | ||
| these messages will appear in the Output of the drier. | ||
|
|
||
| # Text Message Control | ||
| Additionally, a Text Message Control has been added to this driver. If you want to send a direct message, type the node number of | ||
| the node you want to send a message to. If you want to broadcast a message, type 'broadcast' or 'Broadcast' and selct send command. | ||
|
|
||
|
|
||
|
|
||
|
|
||
| # Meshtastic Driver (Serial) | ||
| This driver enables an OSH Node to communicate with a Meshtastic radio over a serial connection using Protobuf messages. | ||
|
|
||
| ## Dependencies | ||
| This driver requires a serial communication module. It has been tested using [sensorhub-comm-jssc](https://github.com/opensensorhub/osh-addons/tree/master/comm/sensorhub-comm-jssc) | ||
|
|
||
| Make sure this communication module is included in your OSH environment before running the driver. | ||
|
|
||
| ## Meshtastic Radio Setup | ||
| 1. Follow the [Meshtastic Getting Started](https://meshtastic.org/docs/getting-started/) guide for initial configuration: | ||
|
|
||
| 2. Flash your radio with the official [Meshtastic Firmware](https://flasher.meshtastic.org/) if not done in step 1: | ||
|
|
||
| 3. After flashing and initial setup, open the [Meshtastic app](https://meshtastic.org/docs/getting-started/initial-config/) and configure the radio’s Serial settings: | ||
| - Settings → Serial | ||
| - Enabled: ON | ||
| - Mode: Protobufs | ||
|
|
||
| 4. Close the Meshtastic app and connect the radio directly to the computer running the OSH Node. ***Note the Port Address*** | ||
|
|
||
| Note: If another application (like the Meshtastic GUI or CLI) is open and using the serial port, the OSH Node will not be able to connect. | ||
|
|
||
| ## OSH Node Configuration | ||
| 1. Launch your OSH Node. | ||
|
|
||
| 2. Select and configure the ***Communication Provider***. | ||
| (This driver has been verified using JSSC Serial Comm Provider) | ||
|
|
||
| 3. Apply the communication settings. | ||
|
|
||
| 4. Start the driver. | ||
|
|
||
| As Protobuf messages are received from the Meshtastic radio, sensor outputs will appear in the driver’s output stream. | ||
|
|
||
| ## Sending Text Messages | ||
|
|
||
| This driver includes support for sending text messages through the Meshtastic network. | ||
|
|
||
| ### To send a message: | ||
|
|
||
| - To message a specific node: enter the Node ID of the destination. | ||
| - To broadcast a message: enter broadcast (case-insensitive). | ||
|
|
||
| Then type your message and select ```Send Command```. | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| plugins { | ||
| id "java" | ||
| id "com.google.protobuf" version "0.9.4" | ||
| } | ||
|
|
||
| description = 'Meshtastic Driver' | ||
| ext.details = "Driver that utilizes a meshtastic Radio pre-configured with meshtastic Node Software to communicate with other meshtastic Radio" | ||
| version = '1.0.0' | ||
|
|
||
|
|
||
| dependencies { | ||
| implementation 'org.sensorhub:sensorhub-core:' + oshCoreVersion | ||
| implementation "com.google.protobuf:protobuf-java:3.25.1" | ||
| testImplementation "junit:junit:4.13.1" | ||
| } | ||
|
|
||
| protobuf { | ||
| protoc { | ||
| // Use protoc matching the runtime protobuf-java version | ||
| artifact = "com.google.protobuf:protoc:3.25.1" | ||
| } | ||
| // Where to place generated sources | ||
| generatedFilesBaseDir = "$projectDir/src/generated" | ||
|
|
||
| // Configure generation tasks | ||
| generateProtoTasks { | ||
| all().each { task -> | ||
| // enable java builtin (default) — leave plugin-free so we get plain java classes | ||
| task.builtins { | ||
| java {} | ||
| } | ||
| // ensure the proto source dir is considered an input (not strictly required, but explicit) | ||
| task.inputs.dir("${projectDir}/src/main/protobufs") | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| // Make sure Gradle sees our non-standard proto source directory | ||
| sourceSets { | ||
| main { | ||
| // add the generated java to the java source set so IDEs/compilation pick them up | ||
| java { | ||
| srcDirs += "$projectDir/src/generated/main/java" | ||
| } | ||
| // tell the Java sourceSet where our proto files are; the plugin will read these | ||
| proto { | ||
| srcDirs = ['src/main/protobufs'] | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test { | ||
| useJUnit() | ||
| } | ||
|
|
||
| // add info to OSGi manifest | ||
| osgi { | ||
| manifest { | ||
| attributes ('Bundle-Vendor': 'Botts Inc') | ||
| attributes ('Bundle-Activator': 'com.sample.impl.sensor.meshtastic.Activator') | ||
BillBrown341 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| // add info to maven pom | ||
| ext.pom >>= { | ||
| developers { | ||
| developer { | ||
| id 'meshtastic' | ||
BillBrown341 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| name 'Bill Brown' | ||
| organization 'Botts Inc' | ||
| organizationUrl '' | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.