PowerShell Script to Pull Telemetry from
Below is a PowerShell script that provides a simple GUI for selecting node names from a list and then pulls telemetry using the meshtastic --request-telemetry Python CLI command. This script assumes you have Python and the Meshtastic CLI installed and available in your system PATH.meshtastic+1
Features:
GUI list box for selecting one or more nodes.learn.microsoft+1
Executes the telemetry request for each selected node.
Displays the output in the PowerShell window.
powershell
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
List of Meshtastic node IDs (replace with your actual node IDs)
$nodeList = @('!ba4bf9d0', '!28979058', '!')
Create the form
form=New−ObjectSystem.Windows.Forms.Formform.Text = 'Meshtastic Telemetry Request'
form.Size=New−ObjectSystem.form.StartPosition = 'CenterScreen'
Label
label=New−ObjectSystem.Windowlabel.Location = New-Object System.Drawing.Point(10,10)
label.Text = 'Select one or more nodes:'
label)
ListBox for node selection
listBox=New−ObjectSystem.WinlistBox.Location = New-Object System.Drawing.Point(10,40)
listBox.SelectionMode = 'MultiExtended'
nodeList)
listBox)
OK Button
OKButton=New−ObjectSystem.WOKButton.Location = New-Object System.Drawing.Point(60,160)
OKButton.Text = 'Request'
form.DialogResult = [System.Windows.Forms.DialogResult]OK
form.Controls.Add($OKButton)
Cancel Button
CancelButton=New−ObjectSystCancelButton.Location = New-Object System.Drawing.Point(180,160)
CancelButton.Text = 'Cancel'
form.DialogResult = [System.Windows.Forms.DialogResult]Cancel
form.Controls.Add($CancelButton)
Show the form
result=form.ShowDialog()
if (result -eq [System.Windows.Forms.DialogResult]<REDACTED>OK) {
selectedNodes = listBox.SelectedItemsforeach(node in selectedNodes) {
Write-Host "Requesting telemetry from node node..."
output = & meshtastic --request-telemetry --dest node
Write-Host nodeList entries with your actual node IDs.
You can further enhance the script to display results in the GUI if needed.
Requirements:
Python and Meshtastic CLI installed and available in your system PATH.advancedinstaller+1
Run the script in a PowerShell environment that supports Windows Forms (not PowerShell Core on systems).lazyadmin+1
This approach leverages PowerShell’s ability to run external Python commands and create simple GUIs for user interaction.techtarget+2
Share
Export