mirror of
https://github.com/meshtastic/python.git
synced 2025-12-31 03:47:55 -05:00
Compare commits
91 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b864bbdd5f | ||
|
|
5a740eddc3 | ||
|
|
fdced6f225 | ||
|
|
3d772845f9 | ||
|
|
72326d467e | ||
|
|
a0944961b5 | ||
|
|
1fa61ece93 | ||
|
|
288d0bb884 | ||
|
|
28a2aa47e8 | ||
|
|
069056edad | ||
|
|
19bd510975 | ||
|
|
7979efc0a1 | ||
|
|
66866a4c65 | ||
|
|
e6fb066fe5 | ||
|
|
5841979566 | ||
|
|
529f50edc6 | ||
|
|
5895e8fb4d | ||
|
|
49dcf71116 | ||
|
|
5778552380 | ||
|
|
592ecc9997 | ||
|
|
1aaa205cc9 | ||
|
|
ff5a0927fa | ||
|
|
607127d46e | ||
|
|
cf61a5d39d | ||
|
|
69b2599abb | ||
|
|
533e50de9d | ||
|
|
12b99f80dc | ||
|
|
0193ca052f | ||
|
|
e0af620cbe | ||
|
|
80367232ae | ||
|
|
1c480bd74f | ||
|
|
ba05de263c | ||
|
|
f045c3bc2b | ||
|
|
9ec5f33a85 | ||
|
|
e1cc657059 | ||
|
|
9c3dce4bbb | ||
|
|
5418539275 | ||
|
|
3103640688 | ||
|
|
86beb2f212 | ||
|
|
dd1c96fcba | ||
|
|
b282baadb7 | ||
|
|
fccb38fced | ||
|
|
700a7e27d3 | ||
|
|
bb1c40c7f8 | ||
|
|
407490c654 | ||
|
|
dfd61af346 | ||
|
|
a85b4ad985 | ||
|
|
eacffa79fa | ||
|
|
ca5449f1b8 | ||
|
|
6751f5bd53 | ||
|
|
c5c70fe83e | ||
|
|
0c0cd81253 | ||
|
|
553a03e40f | ||
|
|
b50190aeb0 | ||
|
|
bc231a8a9d | ||
|
|
c1c9cb8139 | ||
|
|
0a915e305d | ||
|
|
308eb1f321 | ||
|
|
d576c0e30b | ||
|
|
e63d4c3a30 | ||
|
|
2041e81101 | ||
|
|
f396374fa8 | ||
|
|
1a0db63f32 | ||
|
|
0d32a83e66 | ||
|
|
7ac3328db8 | ||
|
|
4f72987a29 | ||
|
|
aa5af53348 | ||
|
|
030ee8554c | ||
|
|
80d447d64b | ||
|
|
bfac5a418c | ||
|
|
a3b09f028a | ||
|
|
930292aaad | ||
|
|
1d3b59a7e0 | ||
|
|
d54b518bfd | ||
|
|
ccb8bb83a6 | ||
|
|
076e865f77 | ||
|
|
8ceb9faf2d | ||
|
|
b15e5f516a | ||
|
|
e161d75986 | ||
|
|
084473a340 | ||
|
|
74d6d4d634 | ||
|
|
38ac4298a0 | ||
|
|
9b2c0e7954 | ||
|
|
62472034f1 | ||
|
|
13cfc19841 | ||
|
|
4955ab8df2 | ||
|
|
de39c98e50 | ||
|
|
51378bb0eb | ||
|
|
aff3bdd78e | ||
|
|
e9a8e26e76 | ||
|
|
83439679c1 |
90
.github/workflows/build_executables.yml
vendored
90
.github/workflows/build_executables.yml
vendored
@@ -1,90 +0,0 @@
|
|||||||
name: Build and publish standalone executables
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build-and-publish-mac:
|
|
||||||
runs-on: macos-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
|
|
||||||
- name: Setup code signing
|
|
||||||
env:
|
|
||||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
||||||
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
|
||||||
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
|
||||||
security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" meshtastic.keychain
|
|
||||||
security default-keychain -s meshtastic.keychain
|
|
||||||
security unlock-keychain -p "$MACOS_KEYCHAIN_PASSWORD" meshtastic.keychain
|
|
||||||
security import certificate.p12 -k meshtastic.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
|
||||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PASSWORD" meshtastic.keychain
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
env:
|
|
||||||
MACOS_SIGNING_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }}
|
|
||||||
run: |
|
|
||||||
pip install pyinstaller
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install .
|
|
||||||
pyinstaller -F -n meshtastic --collect-all meshtastic --codesign-identity "$MACOS_SIGNING_IDENTITY" meshtastic/__main__.py
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: meshtastic_mac
|
|
||||||
path: dist
|
|
||||||
|
|
||||||
build-and-publish-ubuntu:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
pip install pyinstaller
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install .
|
|
||||||
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: meshtastic_ubuntu
|
|
||||||
path: dist
|
|
||||||
|
|
||||||
|
|
||||||
build-and-publish-windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
pip install pyinstaller
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install .
|
|
||||||
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: meshtastic_windows
|
|
||||||
path: dist
|
|
||||||
35
.github/workflows/publish_to_pypi.yml
vendored
35
.github/workflows/publish_to_pypi.yml
vendored
@@ -1,35 +0,0 @@
|
|||||||
name: Publish PyPI
|
|
||||||
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Python 3.9
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.9
|
|
||||||
- name: Install pypa/build
|
|
||||||
run: >-
|
|
||||||
python -m
|
|
||||||
pip install
|
|
||||||
build
|
|
||||||
--user
|
|
||||||
- name: Build a binary wheel and a source tarball
|
|
||||||
run: >-
|
|
||||||
python -m
|
|
||||||
build
|
|
||||||
--sdist
|
|
||||||
--wheel
|
|
||||||
--outdir dist/
|
|
||||||
.
|
|
||||||
- name: Publish to PyPI
|
|
||||||
uses: pypa/gh-action-pypi-publish@master
|
|
||||||
with:
|
|
||||||
username: __token__
|
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
||||||
179
.github/workflows/release.yml
vendored
Normal file
179
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
name: Make Release
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: "Release version (Example: 1.0.0, must match 'version' in setup.py)"
|
||||||
|
required: true
|
||||||
|
default: '1.0.0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release_create:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Create GitHub release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
id: create_release
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
prerelease: true
|
||||||
|
release_name: ${{ github.event.inputs.version}}
|
||||||
|
tag_name: ${{ github.event.inputs.version}}
|
||||||
|
body: |
|
||||||
|
Autogenerated by github action, developer should edit as required before publishing...
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
|
||||||
|
publish_to_pypi:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python 3.9
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
|
||||||
|
- name: Install pypa/build
|
||||||
|
run: >-
|
||||||
|
python -m
|
||||||
|
pip install
|
||||||
|
build
|
||||||
|
--user
|
||||||
|
|
||||||
|
- name: Build a binary wheel and a source tarball
|
||||||
|
run: >-
|
||||||
|
python -m
|
||||||
|
build
|
||||||
|
--sdist
|
||||||
|
--wheel
|
||||||
|
--outdir dist/
|
||||||
|
.
|
||||||
|
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
with:
|
||||||
|
user: __token__
|
||||||
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
|
build-and-publish-mac:
|
||||||
|
runs-on: macos-latest
|
||||||
|
needs: release_create
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python 3.9
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
|
||||||
|
- name: Setup code signing
|
||||||
|
env:
|
||||||
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||||
|
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
||||||
|
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
||||||
|
security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" meshtastic.keychain
|
||||||
|
security default-keychain -s meshtastic.keychain
|
||||||
|
security unlock-keychain -p "$MACOS_KEYCHAIN_PASSWORD" meshtastic.keychain
|
||||||
|
security import certificate.p12 -k meshtastic.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
||||||
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PASSWORD" meshtastic.keychain
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
MACOS_SIGNING_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }}
|
||||||
|
run: |
|
||||||
|
pip install pyinstaller
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install .
|
||||||
|
pyinstaller -F -n meshtastic --collect-all meshtastic --codesign-identity "$MACOS_SIGNING_IDENTITY" meshtastic/__main__.py
|
||||||
|
|
||||||
|
- name: Add mac to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.release_create.outputs.upload_url }}
|
||||||
|
asset_path: dist/meshtastic
|
||||||
|
asset_name: meshtastic_mac
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
build-and-publish-ubuntu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: release_create
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python 3.9
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
pip install pyinstaller
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install .
|
||||||
|
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
|
||||||
|
|
||||||
|
- name: Add ubuntu to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.release_create.outputs.upload_url }}
|
||||||
|
asset_path: dist/meshtastic
|
||||||
|
asset_name: meshtastic_ubuntu
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Add readme.txt to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.release_create.outputs.upload_url }}
|
||||||
|
asset_path: standalone_readme.txt
|
||||||
|
asset_name: readme.txt
|
||||||
|
asset_content_type: text/plain
|
||||||
|
|
||||||
|
build-and-publish-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
needs: release_create
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python 3.9
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
pip install pyinstaller
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install .
|
||||||
|
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
|
||||||
|
|
||||||
|
- name: Add windows to release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.release_create.outputs.upload_url }}
|
||||||
|
asset_path: dist/meshtastic.exe
|
||||||
|
asset_name: meshtastic_windows
|
||||||
|
asset_content_type: application/zip
|
||||||
11
.github/workflows/update_protobufs.yml
vendored
11
.github/workflows/update_protobufs.yml
vendored
@@ -15,6 +15,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git pull --recurse-submodules
|
git pull --recurse-submodules
|
||||||
git submodule update --remote --recursive
|
git submodule update --remote --recursive
|
||||||
|
|
||||||
|
- name: Download nanopb
|
||||||
|
run: |
|
||||||
|
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.4-linux-x86.tar.gz
|
||||||
|
tar xvzf nanopb-0.4.4-linux-x86.tar.gz
|
||||||
|
mv nanopb-0.4.4-linux-x86 nanopb-0.4.4
|
||||||
|
|
||||||
|
- name: Re-generate protocol buffers
|
||||||
|
run: |
|
||||||
|
./bin/regen-protos.sh
|
||||||
|
|
||||||
- name: Commit update
|
- name: Commit update
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'github-actions'
|
git config --global user.name 'github-actions'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Add files or directories matching the regex patterns to the blacklist. The
|
# Add files or directories matching the regex patterns to the blacklist. The
|
||||||
# regex matches against base names, not paths.
|
# regex matches against base names, not paths.
|
||||||
ignore-patterns=mqtt_pb2.py,channel_pb2.py,environmental_measurement_pb2.py,admin_pb2.py,radioconfig_pb2.py,deviceonly_pb2.py,apponly_pb2.py,remote_hardware_pb2.py,portnums_pb2.py,mesh_pb2.py,storeforward_pb2.py
|
ignore-patterns=mqtt_pb2.py,channel_pb2.py,environmental_measurement_pb2.py,admin_pb2.py,radioconfig_pb2.py,deviceonly_pb2.py,apponly_pb2.py,remote_hardware_pb2.py,portnums_pb2.py,mesh_pb2.py,storeforward_pb2.py,cannedmessages_pb2.py
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
[](https://open.vscode.dev/meshtastic/Meshtastic-python)
|
[](https://open.vscode.dev/meshtastic/Meshtastic-python)
|
||||||

|

|
||||||
[](https://codecov.io/gh/meshtastic/Meshtastic-python)
|
[](https://codecov.io/gh/meshtastic/Meshtastic-python)
|
||||||
|

|
||||||
|
|
||||||
A python client for using [Meshtastic](https://www.meshtastic.org) devices. This small library (and example application) provides an easy API for sending and receiving messages over mesh radios. It also provides access to any of the operations/data available in the device user interface or the Android application. Events are delivered using a publish-subscribe model, and you can subscribe to only the message types you are interested in.
|
A python client for using [Meshtastic](https://www.meshtastic.org) devices. This small library (and example application) provides an easy API for sending and receiving messages over mesh radios. It also provides access to any of the operations/data available in the device user interface or the Android application. Events are delivered using a publish-subscribe model, and you can subscribe to only the message types you are interested in.
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
# workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628
|
# workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628
|
||||||
|
|
||||||
if [[ $OSTYPE == 'darwin'* ]]; then
|
if [[ $OSTYPE == 'darwin'* ]]; then
|
||||||
sed -i -E 's/^\(import.*_pb2\)/from . \1/' meshtastic/*.py
|
sed -i '' -E 's/^\(import.*_pb2\)/from . \1/' meshtastic/*.py
|
||||||
|
# automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/Meshtastic-protobufs/issues/27)
|
||||||
|
sed -i '' -E "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py
|
||||||
else
|
else
|
||||||
sed -i -E 's/^import.*_pb2/from . \0/' meshtastic/*.py
|
sed -i -e 's/^import.*_pb2/from . \0/' meshtastic/*.py
|
||||||
|
# automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/Meshtastic-protobufs/issues/27)
|
||||||
|
sed -i -e "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/Meshtastic-protobufs/issues/27)
|
|
||||||
sed -i '' -e "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# example config using camelCase keys
|
# example config using camelCase keys
|
||||||
owner: Bob TBeam
|
owner: Bob TBeam
|
||||||
|
ownerShort: BOB
|
||||||
|
|
||||||
channelUrl: https://www.meshtastic.org/d/#CgUYAyIBAQ
|
channelUrl: https://www.meshtastic.org/d/#CgUYAyIBAQ
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# example configuration file with snake_case keys
|
# example configuration file with snake_case keys
|
||||||
owner: Bob TBeam
|
owner: Bob TBeam
|
||||||
|
owner_short: BOB
|
||||||
|
|
||||||
channel_url: https://www.meshtastic.org/d/#CgUYAyIBAQ
|
channel_url: https://www.meshtastic.org/d/#CgUYAyIBAQ
|
||||||
|
|
||||||
@@ -14,3 +15,4 @@ user_prefs:
|
|||||||
send_owner_interval: 2
|
send_owner_interval: 2
|
||||||
screen_on_secs: 31536000
|
screen_on_secs: 31536000
|
||||||
wait_bluetooth_secs: 31536000
|
wait_bluetooth_secs: 31536000
|
||||||
|
location_share: 'LocEnabled'
|
||||||
|
|||||||
26
examples/scan_for_devices.py
Normal file
26
examples/scan_for_devices.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
"""Program to scan for hardware
|
||||||
|
To run: python examples/scan_for_devices.py
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import meshtastic
|
||||||
|
from meshtastic.supported_device import get_unique_vendor_ids, active_ports_on_supported_devices
|
||||||
|
from meshtastic.util import detect_supported_devices
|
||||||
|
|
||||||
|
# simple arg check
|
||||||
|
if len(sys.argv) != 1:
|
||||||
|
print(f"usage: {sys.argv[0]}")
|
||||||
|
print("Detect which device we might have.")
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
|
vids = get_unique_vendor_ids()
|
||||||
|
print(f'Searching for all devices with these vendor ids {vids}')
|
||||||
|
|
||||||
|
sds = detect_supported_devices()
|
||||||
|
if len(sds) > 0:
|
||||||
|
print('Detected possible devices:')
|
||||||
|
for d in sds:
|
||||||
|
print(f' name:{d.name}{d.version} firmware:{d.for_firmware}')
|
||||||
|
|
||||||
|
ports = active_ports_on_supported_devices(sds)
|
||||||
|
print(f'ports:{ports}')
|
||||||
20
info/mac/heltec.txt
Normal file
20
info/mac/heltec.txt
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
ioreg -p IOUSB > /tmp/d
|
||||||
|
|
||||||
|
> | +-o CP2102 USB to UART Bridge Controller@14400000 <class AppleUSBDevice, id 0x10005c048, registered, matched, active, busy 0 (9 ms), retain 12>
|
||||||
|
|
||||||
|
|
||||||
|
system_profiler SPUSBDataType > /tmp/b
|
||||||
|
|
||||||
|
37a38,50
|
||||||
|
> CP2102 USB to UART Bridge Controller:
|
||||||
|
>
|
||||||
|
> Product ID: 0xea60
|
||||||
|
> Vendor ID: 0x10c4 (Silicon Laboratories, Inc.)
|
||||||
|
> Version: 1.00
|
||||||
|
> Serial Number: 0001
|
||||||
|
> Speed: Up to 12 Mb/s
|
||||||
|
> Manufacturer: Silicon Labs
|
||||||
|
> Location ID: 0x14400000 / 53
|
||||||
|
> Current Available (mA): 500
|
||||||
|
> Current Required (mA): 100
|
||||||
|
> Extra Operating Current (mA): 0
|
||||||
10
info/mac/rak4631_19003.txt
Normal file
10
info/mac/rak4631_19003.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
> | +-o WisCore RAK4631 Board@14400000 <class AppleUSBDevice, id 0x10005c158, registered, matched, active, busy 0 (18 ms), retain 14>
|
||||||
|
|
||||||
|
|
||||||
|
/dev/cu.usbmodem14401
|
||||||
|
|
||||||
|
% ls -al /dev/*modem*
|
||||||
|
crw-rw-rw- 1 root wheel 0x9000005 Jan 29 15:32 /dev/cu.usbmodem14401
|
||||||
|
crw-rw-rw- 1 root wheel 0x9000004 Jan 29 15:31 /dev/tty.usbmodem14401
|
||||||
18
info/mac/rak4631_5005.txt
Normal file
18
info/mac/rak4631_5005.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
no device plugged in
|
||||||
|
% ioreg -p IOUSB > /tmp/a
|
||||||
|
|
||||||
|
device plugged in, in "boot" mode
|
||||||
|
% ioreg -p IOUSB > /tmp/b
|
||||||
|
|
||||||
|
device plugged in, botted to Meshtastic firmware
|
||||||
|
% ioreg -p IOUSB > /tmp/c
|
||||||
|
|
||||||
|
(venv) sweet Meshtastic-python % diff /tmp/a /tmp/b (with most info removed)
|
||||||
|
> | +-o Feather nRF52840 Express@14400000 <class AppleUSBDevice, id 0x10005c0ff, registered, matched, active, busy 0 (22 ms), retain 16>
|
||||||
|
|
||||||
|
diff /tmp/a /tmp/c (with most info removed)
|
||||||
|
> | +-o WisCore RAK4631 Board@14400000 <class AppleUSBDevice, id 0x10005c134, registered, matched, active, busy 0 (17 ms), retain 14>
|
||||||
|
|
||||||
|
|
||||||
|
Meshtastic detected port on /dev/cu.usbmodem14401
|
||||||
21
info/mac/tbeam.txt
Normal file
21
info/mac/tbeam.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
meshtastic detected port: /dev/cu.usbmodem53230050571
|
||||||
|
|
||||||
|
ioreg -p IOUSB > /tmp/c
|
||||||
|
|
||||||
|
> | +-o USB Single Serial@14400000 <class AppleUSBDevice, id 0x10005bff7, registered, matched, active, busy 0 (15 ms), retain 14>
|
||||||
|
|
||||||
|
|
||||||
|
system_profiler SPUSBDataType > /tmp/a
|
||||||
|
|
||||||
|
> USB Single Serial:
|
||||||
|
>
|
||||||
|
> Product ID: 0x55d4
|
||||||
|
> Vendor ID: 0x1a86
|
||||||
|
> Version: 4.43
|
||||||
|
> Serial Number: 5323005057
|
||||||
|
> Speed: Up to 12 Mb/s
|
||||||
|
> Location ID: 0x14400000 / 50
|
||||||
|
> Current Available (mA): 500
|
||||||
|
> Current Required (mA): 134
|
||||||
|
> Extra Operating Current (mA): 0
|
||||||
16
info/mac/tlora.txt
Normal file
16
info/mac/tlora.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
diff of ioreg -p IOUSB
|
||||||
|
|
||||||
|
> | +-o USB Single Serial@14300000 <class AppleUSBDevice, id 0x10005bf0f, registered, matched, active, busy 0 (18 ms), retain 14>
|
||||||
|
|
||||||
|
|
||||||
|
Diff of system_profiler SPUSBDataType
|
||||||
|
< USB Single Serial:
|
||||||
|
<
|
||||||
|
< Product ID: 0x55d4
|
||||||
|
< Vendor ID: 0x1a86
|
||||||
|
< Version: 4.43
|
||||||
|
< Speed: Up to 12 Mb/s
|
||||||
|
< Location ID: 0x14300000 / 46
|
||||||
|
< Current Available (mA): 500
|
||||||
|
< Current Required (mA): 134
|
||||||
|
< Extra Operating Current (mA): 0
|
||||||
3
info/readme.txt
Normal file
3
info/readme.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Gathering OS-level info for devices.
|
||||||
|
|
||||||
|
This info might be helpful for developers detecting info about devices.
|
||||||
85
info/ubuntu/heltec_v2.txt
Normal file
85
info/ubuntu/heltec_v2.txt
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
Run on Ubuntu 20
|
||||||
|
|
||||||
|
Command:
|
||||||
|
lsusb -d 10c4: -v
|
||||||
|
|
||||||
|
Output:
|
||||||
|
Bus 001 Device 091: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
|
||||||
|
Device Descriptor:
|
||||||
|
bLength 18
|
||||||
|
bDescriptorType 1
|
||||||
|
bcdUSB 1.10
|
||||||
|
bDeviceClass 0
|
||||||
|
bDeviceSubClass 0
|
||||||
|
bDeviceProtocol 0
|
||||||
|
bMaxPacketSize0 64
|
||||||
|
idVendor 0x10c4 Silicon Labs
|
||||||
|
idProduct 0xea60 CP210x UART Bridge
|
||||||
|
bcdDevice 1.00
|
||||||
|
iManufacturer 1
|
||||||
|
iProduct 2
|
||||||
|
iSerial 3
|
||||||
|
bNumConfigurations 1
|
||||||
|
Configuration Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 2
|
||||||
|
wTotalLength 0x0020
|
||||||
|
bNumInterfaces 1
|
||||||
|
bConfigurationValue 1
|
||||||
|
iConfiguration 0
|
||||||
|
bmAttributes 0x80
|
||||||
|
(Bus Powered)
|
||||||
|
MaxPower 100mA
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 0
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 2
|
||||||
|
bInterfaceClass 255 Vendor Specific Class
|
||||||
|
bInterfaceSubClass 0
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 2
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x81 EP 1 IN
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x01 EP 1 OUT
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
|
||||||
|
|
||||||
|
Command:
|
||||||
|
esptool.py chip_id
|
||||||
|
|
||||||
|
Output:
|
||||||
|
esptool.py v3.2
|
||||||
|
Found 3 serial ports
|
||||||
|
Serial port /dev/ttyUSB0
|
||||||
|
Connecting....
|
||||||
|
Detecting chip type... Unsupported detection protocol, switching and trying again...
|
||||||
|
Connecting.....
|
||||||
|
Detecting chip type... ESP32
|
||||||
|
Chip is ESP32-D0WDQ6 (revision 1)
|
||||||
|
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
|
||||||
|
Crystal is 40MHz
|
||||||
|
MAC: 24:0a:c4:fc:be:f0
|
||||||
|
Uploading stub...
|
||||||
|
Running stub...
|
||||||
|
Stub running...
|
||||||
|
Warning: ESP32 has no Chip ID. Reading MAC instead.
|
||||||
|
MAC: 24:0a:c4:fc:be:f0
|
||||||
|
Hard resetting via RTS pin...
|
||||||
118
info/ubuntu/rak4631_19003.txt
Normal file
118
info/ubuntu/rak4631_19003.txt
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
|
||||||
|
Note: Meshtastic firmware was installed when running these commands
|
||||||
|
|
||||||
|
$ ls -al /dev/ttyACM*
|
||||||
|
crw-rw---- 1 root dialout 166, 0 Jan 29 21:50 /dev/ttyACM0
|
||||||
|
|
||||||
|
lsusb -d 239a: -v
|
||||||
|
|
||||||
|
Bus 001 Device 097: ID 239a:8029
|
||||||
|
Couldn't open device, some information will be missing
|
||||||
|
Device Descriptor:
|
||||||
|
bLength 18
|
||||||
|
bDescriptorType 1
|
||||||
|
bcdUSB 2.00
|
||||||
|
bDeviceClass 239 Miscellaneous Device
|
||||||
|
bDeviceSubClass 2
|
||||||
|
bDeviceProtocol 1 Interface Association
|
||||||
|
bMaxPacketSize0 64
|
||||||
|
idVendor 0x239a
|
||||||
|
idProduct 0x8029
|
||||||
|
bcdDevice 1.00
|
||||||
|
iManufacturer 1
|
||||||
|
iProduct 2
|
||||||
|
iSerial 3
|
||||||
|
bNumConfigurations 1
|
||||||
|
Configuration Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 2
|
||||||
|
wTotalLength 0x004b
|
||||||
|
bNumInterfaces 2
|
||||||
|
bConfigurationValue 1
|
||||||
|
iConfiguration 0
|
||||||
|
bmAttributes 0xa0
|
||||||
|
(Bus Powered)
|
||||||
|
Remote Wakeup
|
||||||
|
MaxPower 100mA
|
||||||
|
Interface Association:
|
||||||
|
bLength 8
|
||||||
|
bDescriptorType 11
|
||||||
|
bFirstInterface 0
|
||||||
|
bInterfaceCount 2
|
||||||
|
bFunctionClass 2 Communications
|
||||||
|
bFunctionSubClass 2 Abstract (modem)
|
||||||
|
bFunctionProtocol 0
|
||||||
|
iFunction 0
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 0
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 1
|
||||||
|
bInterfaceClass 2 Communications
|
||||||
|
bInterfaceSubClass 2 Abstract (modem)
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 4
|
||||||
|
CDC Header:
|
||||||
|
bcdCDC 1.20
|
||||||
|
CDC Call Management:
|
||||||
|
bmCapabilities 0x00
|
||||||
|
bDataInterface 1
|
||||||
|
CDC ACM:
|
||||||
|
bmCapabilities 0x02
|
||||||
|
line coding and serial state
|
||||||
|
CDC Union:
|
||||||
|
bMasterInterface 0
|
||||||
|
bSlaveInterface 1
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x81 EP 1 IN
|
||||||
|
bmAttributes 3
|
||||||
|
Transfer Type Interrupt
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0008 1x 8 bytes
|
||||||
|
bInterval 16
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 1
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 2
|
||||||
|
bInterfaceClass 10 CDC Data
|
||||||
|
bInterfaceSubClass 0
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x01 EP 1 OUT
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x82 EP 2 IN
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
|
||||||
|
$ lsusb
|
||||||
|
Bus 002 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120
|
||||||
|
Bus 002 Device 002: ID 8087:8000 Intel Corp.
|
||||||
|
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
Bus 001 Device 097: ID 239a:8029
|
||||||
|
Bus 001 Device 002: ID 8087:8008 Intel Corp.
|
||||||
|
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||||
|
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
|
||||||
|
Note: esptool.py chip_id does not detect device
|
||||||
148
info/ubuntu/rak4631_5005.txt
Normal file
148
info/ubuntu/rak4631_5005.txt
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
|
||||||
|
Note: Device has Meshtastic firmware installed.
|
||||||
|
|
||||||
|
$ ls -al /dev/ttyACM*
|
||||||
|
crw-rw---- 1 root dialout 166, 0 Jan 29 21:44 /dev/ttyACM0
|
||||||
|
|
||||||
|
$ lsusb -d 239a: -v
|
||||||
|
|
||||||
|
Bus 001 Device 098: ID 239a:0029
|
||||||
|
Couldn't open device, some information will be missing
|
||||||
|
Device Descriptor:
|
||||||
|
bLength 18
|
||||||
|
bDescriptorType 1
|
||||||
|
bcdUSB 2.00
|
||||||
|
bDeviceClass 239 Miscellaneous Device
|
||||||
|
bDeviceSubClass 2
|
||||||
|
bDeviceProtocol 1 Interface Association
|
||||||
|
bMaxPacketSize0 64
|
||||||
|
idVendor 0x239a
|
||||||
|
idProduct 0x0029
|
||||||
|
bcdDevice 1.00
|
||||||
|
iManufacturer 1
|
||||||
|
iProduct 2
|
||||||
|
iSerial 3
|
||||||
|
bNumConfigurations 1
|
||||||
|
Configuration Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 2
|
||||||
|
wTotalLength 0x0062
|
||||||
|
bNumInterfaces 3
|
||||||
|
bConfigurationValue 1
|
||||||
|
iConfiguration 0
|
||||||
|
bmAttributes 0xa0
|
||||||
|
(Bus Powered)
|
||||||
|
Remote Wakeup
|
||||||
|
MaxPower 100mA
|
||||||
|
Interface Association:
|
||||||
|
bLength 8
|
||||||
|
bDescriptorType 11
|
||||||
|
bFirstInterface 0
|
||||||
|
bInterfaceCount 2
|
||||||
|
bFunctionClass 2 Communications
|
||||||
|
bFunctionSubClass 2 Abstract (modem)
|
||||||
|
bFunctionProtocol 0
|
||||||
|
iFunction 0
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 0
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 1
|
||||||
|
bInterfaceClass 2 Communications
|
||||||
|
bInterfaceSubClass 2 Abstract (modem)
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 4
|
||||||
|
CDC Header:
|
||||||
|
bcdCDC 1.20
|
||||||
|
CDC Call Management:
|
||||||
|
bmCapabilities 0x00
|
||||||
|
bDataInterface 1
|
||||||
|
CDC ACM:
|
||||||
|
bmCapabilities 0x02
|
||||||
|
line coding and serial state
|
||||||
|
CDC Union:
|
||||||
|
bMasterInterface 0
|
||||||
|
bSlaveInterface 1
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x81 EP 1 IN
|
||||||
|
bmAttributes 3
|
||||||
|
Transfer Type Interrupt
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0008 1x 8 bytes
|
||||||
|
bInterval 16
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 1
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 2
|
||||||
|
bInterfaceClass 10 CDC Data
|
||||||
|
bInterfaceSubClass 0
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x02 EP 2 OUT
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x82 EP 2 IN
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 2
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 2
|
||||||
|
bInterfaceClass 8 Mass Storage
|
||||||
|
bInterfaceSubClass 6 SCSI
|
||||||
|
bInterfaceProtocol 80 Bulk-Only
|
||||||
|
iInterface 5
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x03 EP 3 OUT
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x83 EP 3 IN
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
|
|
||||||
|
$ lsusb
|
||||||
|
Bus 002 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120
|
||||||
|
Bus 002 Device 002: ID 8087:8000 Intel Corp.
|
||||||
|
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
Bus 001 Device 098: ID 239a:0029
|
||||||
|
Bus 001 Device 002: ID 8087:8008 Intel Corp.
|
||||||
|
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||||
|
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
|
||||||
|
Note: esptool.py chip_id does not detect device
|
||||||
1
info/ubuntu/readme.txt
Normal file
1
info/ubuntu/readme.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
info run on ubuntu
|
||||||
94
info/ubuntu/tbeam.txt
Normal file
94
info/ubuntu/tbeam.txt
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
Run on Ubuntu 20
|
||||||
|
|
||||||
|
Command:
|
||||||
|
lsusb -d 1a86: -v
|
||||||
|
|
||||||
|
Output:
|
||||||
|
Bus 001 Device 096: ID 1a86:55d4 QinHeng Electronics
|
||||||
|
Device Descriptor:
|
||||||
|
bLength 18
|
||||||
|
bDescriptorType 1
|
||||||
|
bcdUSB 1.10
|
||||||
|
bDeviceClass 2 Communications
|
||||||
|
bDeviceSubClass 0
|
||||||
|
bDeviceProtocol 0
|
||||||
|
bMaxPacketSize0 8
|
||||||
|
idVendor 0x1a86 QinHeng Electronics
|
||||||
|
idProduct 0x55d4
|
||||||
|
bcdDevice 4.43
|
||||||
|
iManufacturer 0
|
||||||
|
iProduct 2
|
||||||
|
iSerial 3
|
||||||
|
bNumConfigurations 1
|
||||||
|
Configuration Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 2
|
||||||
|
wTotalLength 0x0043
|
||||||
|
bNumInterfaces 2
|
||||||
|
bConfigurationValue 1
|
||||||
|
iConfiguration 0
|
||||||
|
bmAttributes 0xa0
|
||||||
|
(Bus Powered)
|
||||||
|
Remote Wakeup
|
||||||
|
MaxPower 134mA
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 0
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 1
|
||||||
|
bInterfaceClass 2 Communications
|
||||||
|
bInterfaceSubClass 2 Abstract (modem)
|
||||||
|
bInterfaceProtocol 1 AT-commands (v.25ter)
|
||||||
|
iInterface 0
|
||||||
|
CDC Header:
|
||||||
|
bcdCDC 1.10
|
||||||
|
CDC Call Management:
|
||||||
|
bmCapabilities 0x00
|
||||||
|
bDataInterface 1
|
||||||
|
CDC ACM:
|
||||||
|
bmCapabilities 0x02
|
||||||
|
line coding and serial state
|
||||||
|
CDC Union:
|
||||||
|
bMasterInterface 0
|
||||||
|
bSlaveInterface 1
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x83 EP 3 IN
|
||||||
|
bmAttributes 3
|
||||||
|
Transfer Type Interrupt
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0010 1x 16 bytes
|
||||||
|
bInterval 1
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 1
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 2
|
||||||
|
bInterfaceClass 10 CDC Data
|
||||||
|
bInterfaceSubClass 0
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x02 EP 2 OUT
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0020 1x 32 bytes
|
||||||
|
bInterval 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x82 EP 2 IN
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
106
info/ubuntu/tlora.txt
Normal file
106
info/ubuntu/tlora.txt
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
|
||||||
|
Run on Ubuntu 20
|
||||||
|
|
||||||
|
Note: Device has Meshtastic firmware installed
|
||||||
|
|
||||||
|
|
||||||
|
$ lsusb
|
||||||
|
Bus 002 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120
|
||||||
|
Bus 002 Device 002: ID 8087:8000 Intel Corp.
|
||||||
|
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
Bus 001 Device 099: ID 1a86:55d4 QinHeng Electronics
|
||||||
|
Bus 001 Device 002: ID 8087:8008 Intel Corp.
|
||||||
|
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||||
|
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
(venv) mikekinney@top:~/Meshtastic-python/info/ubuntu$ lsusb -d 1a86: -v
|
||||||
|
|
||||||
|
Bus 001 Device 099: ID 1a86:55d4 QinHeng Electronics
|
||||||
|
Couldn't open device, some information will be missing
|
||||||
|
Device Descriptor:
|
||||||
|
bLength 18
|
||||||
|
bDescriptorType 1
|
||||||
|
bcdUSB 1.10
|
||||||
|
bDeviceClass 2 Communications
|
||||||
|
bDeviceSubClass 0
|
||||||
|
bDeviceProtocol 0
|
||||||
|
bMaxPacketSize0 8
|
||||||
|
idVendor 0x1a86 QinHeng Electronics
|
||||||
|
idProduct 0x55d4
|
||||||
|
bcdDevice 4.43
|
||||||
|
iManufacturer 0
|
||||||
|
iProduct 2
|
||||||
|
iSerial 0
|
||||||
|
bNumConfigurations 1
|
||||||
|
Configuration Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 2
|
||||||
|
wTotalLength 0x0043
|
||||||
|
bNumInterfaces 2
|
||||||
|
bConfigurationValue 1
|
||||||
|
iConfiguration 0
|
||||||
|
bmAttributes 0xa0
|
||||||
|
(Bus Powered)
|
||||||
|
Remote Wakeup
|
||||||
|
MaxPower 134mA
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 0
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 1
|
||||||
|
bInterfaceClass 2 Communications
|
||||||
|
bInterfaceSubClass 2 Abstract (modem)
|
||||||
|
bInterfaceProtocol 1 AT-commands (v.25ter)
|
||||||
|
iInterface 0
|
||||||
|
CDC Header:
|
||||||
|
bcdCDC 1.10
|
||||||
|
CDC Call Management:
|
||||||
|
bmCapabilities 0x00
|
||||||
|
bDataInterface 1
|
||||||
|
CDC ACM:
|
||||||
|
bmCapabilities 0x02
|
||||||
|
line coding and serial state
|
||||||
|
CDC Union:
|
||||||
|
bMasterInterface 0
|
||||||
|
bSlaveInterface 1
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x83 EP 3 IN
|
||||||
|
bmAttributes 3
|
||||||
|
Transfer Type Interrupt
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0010 1x 16 bytes
|
||||||
|
bInterval 1
|
||||||
|
Interface Descriptor:
|
||||||
|
bLength 9
|
||||||
|
bDescriptorType 4
|
||||||
|
bInterfaceNumber 1
|
||||||
|
bAlternateSetting 0
|
||||||
|
bNumEndpoints 2
|
||||||
|
bInterfaceClass 10 CDC Data
|
||||||
|
bInterfaceSubClass 0
|
||||||
|
bInterfaceProtocol 0
|
||||||
|
iInterface 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x02 EP 2 OUT
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0020 1x 32 bytes
|
||||||
|
bInterval 0
|
||||||
|
Endpoint Descriptor:
|
||||||
|
bLength 7
|
||||||
|
bDescriptorType 5
|
||||||
|
bEndpointAddress 0x82 EP 2 IN
|
||||||
|
bmAttributes 2
|
||||||
|
Transfer Type Bulk
|
||||||
|
Synch Type None
|
||||||
|
Usage Type Data
|
||||||
|
wMaxPacketSize 0x0040 1x 64 bytes
|
||||||
|
bInterval 0
|
||||||
106
info/windows/heltec.txt
Normal file
106
info/windows/heltec.txt
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
Run from Windows 10
|
||||||
|
|
||||||
|
Might work... (nope)
|
||||||
|
Get-PnpDevice -Class 'USB' -PresentOnly | Format-List
|
||||||
|
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List > b
|
||||||
|
> Compare-Object (get-content a) (Get-Content b)
|
||||||
|
|
||||||
|
InputObject SideIndicator
|
||||||
|
----------- -------------
|
||||||
|
Caption : CP2102 USB to UART Bridge Controller <=
|
||||||
|
Description : CP2102 USB to UART Bridge Controller <=
|
||||||
|
Name : CP2102 USB to UART Bridge Controller <=
|
||||||
|
Status : Error <=
|
||||||
|
ConfigManagerErrorCode : CM_PROB_FAILED_INSTALL <=
|
||||||
|
DeviceID : USB\VID_10C4&PID_EA60\0001 <=
|
||||||
|
PNPDeviceID : USB\VID_10C4&PID_EA60\0001 <=
|
||||||
|
CompatibleID : {USB\Class_FF&SubClass_00&Prot_00, USB\Class_FF&SubClass_00, USB\Class_FF} <=
|
||||||
|
HardwareID : {USB\VID_10C4&PID_EA60&REV_0100, USB\VID_10C4&PID_EA60} <=
|
||||||
|
FriendlyName : CP2102 USB to UART Bridge Controller <=
|
||||||
|
InstanceId : USB\VID_10C4&PID_EA60\0001 <=
|
||||||
|
Problem : CM_PROB_FAILED_INSTALL <=
|
||||||
|
ClassGuid : <=
|
||||||
|
Manufacturer : <=
|
||||||
|
PNPClass : <=
|
||||||
|
Class : <=
|
||||||
|
Service : <=
|
||||||
|
InstallDate : <=
|
||||||
|
Availability : <=
|
||||||
|
ConfigManagerUserConfig : False <=
|
||||||
|
CreationClassName : Win32_PnPEntity <=
|
||||||
|
ErrorCleared : <=
|
||||||
|
ErrorDescription : <=
|
||||||
|
LastErrorCode : <=
|
||||||
|
PowerManagementCapabilities : <=
|
||||||
|
PowerManagementSupported : <=
|
||||||
|
StatusInfo : <=
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem <=
|
||||||
|
SystemName : DESKTOP-FRFQN8H <=
|
||||||
|
Present : True <=
|
||||||
|
PSComputerName : <=
|
||||||
|
ProblemDescription : <=
|
||||||
|
<=
|
||||||
|
|
||||||
|
> Get-PnpDevice -DeviceID 'USB\VID_10C4&PID_EA60\0001'
|
||||||
|
|
||||||
|
Status Class FriendlyName InstanceId
|
||||||
|
------ ----- ------------ ----------
|
||||||
|
Error CP2102 USB to UART Bridge Controller USB\VID_...
|
||||||
|
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly -DeviceID 'USB\VID_10C4&PID_EA60\0001'
|
||||||
|
Get-PnpDevice : No matching Win32_PnPEntity objects found by CIM query for instances of the ROOT\cimv2\Win32_PnPEntity
|
||||||
|
class on the CIM server: SELECT * FROM Win32_PnPEntity WHERE ((DeviceId LIKE 'USB\\VID[_]10C4&PID[_]EA60\\0001'))
|
||||||
|
AND ((Present = TRUE)). Verify query parameters and retry.
|
||||||
|
At line:1 char:1
|
||||||
|
+ Get-PnpDevice -PresentOnly -DeviceID 'USB\VID_10C4&PID_EA60\0001'
|
||||||
|
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
+ CategoryInfo : ObjectNotFound: (Win32_PnPEntity:String) [Get-PnpDevice], CimJobException
|
||||||
|
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound,Get-PnpDevice
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly -DeviceID 'USB\VID_10C4&PID_EA60\0001'
|
||||||
|
|
||||||
|
Status Class FriendlyName InstanceId
|
||||||
|
------ ----- ------------ ----------
|
||||||
|
Error CP2102 USB to UART Bridge Controller USB\VID_...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If need to install driver
|
||||||
|
Get-PnpDevice -DeviceID 'USB\VID_10C4&PID_EA60\0001' | Format-List
|
||||||
|
|
||||||
|
|
||||||
|
Caption : CP2102 USB to UART Bridge Controller
|
||||||
|
Description : CP2102 USB to UART Bridge Controller
|
||||||
|
InstallDate :
|
||||||
|
Name : CP2102 USB to UART Bridge Controller
|
||||||
|
Status : Error
|
||||||
|
Availability :
|
||||||
|
ConfigManagerErrorCode : CM_PROB_FAILED_INSTALL
|
||||||
|
ConfigManagerUserConfig : False
|
||||||
|
CreationClassName : Win32_PnPEntity
|
||||||
|
DeviceID : USB\VID_10C4&PID_EA60\0001
|
||||||
|
ErrorCleared :
|
||||||
|
ErrorDescription :
|
||||||
|
LastErrorCode :
|
||||||
|
PNPDeviceID : USB\VID_10C4&PID_EA60\0001
|
||||||
|
PowerManagementCapabilities :
|
||||||
|
PowerManagementSupported :
|
||||||
|
StatusInfo :
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem
|
||||||
|
SystemName : DESKTOP-FRFQN8H
|
||||||
|
ClassGuid :
|
||||||
|
CompatibleID : {USB\Class_FF&SubClass_00&Prot_00, USB\Class_FF&SubClass_00, USB\Class_FF}
|
||||||
|
HardwareID : {USB\VID_10C4&PID_EA60&REV_0100, USB\VID_10C4&PID_EA60}
|
||||||
|
Manufacturer :
|
||||||
|
PNPClass :
|
||||||
|
Present : True
|
||||||
|
Service :
|
||||||
|
PSComputerName :
|
||||||
|
Class :
|
||||||
|
FriendlyName : CP2102 USB to UART Bridge Controller
|
||||||
|
InstanceId : USB\VID_10C4&PID_EA60\0001
|
||||||
|
Problem : CM_PROB_FAILED_INSTALL
|
||||||
|
ProblemDescription :
|
||||||
78
info/windows/rak4631_19003.txt
Normal file
78
info/windows/rak4631_19003.txt
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
Run from Windows 10
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >a
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >b
|
||||||
|
> Compare-Object (get-content a) (Get-Content b)
|
||||||
|
|
||||||
|
InputObject Side
|
||||||
|
Indi
|
||||||
|
cato
|
||||||
|
r
|
||||||
|
----------- ----
|
||||||
|
Caption : USB Serial Device (COM4) =>
|
||||||
|
Description : USB Serial Device =>
|
||||||
|
Name : USB Serial Device (COM4) =>
|
||||||
|
DeviceID : USB\VID_239A&PID_8029&MI_00\6&E8876D1&0&0000 =>
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_8029&MI_00\6&E8876D1&0&0000 =>
|
||||||
|
ClassGuid : {4d36e978-e325-11ce-bfc1-08002be10318} =>
|
||||||
|
CompatibleID : {USB\Class_02&SubClass_02&Prot_00, USB\Class_02&SubClass_02, USB\Class_02} =>
|
||||||
|
HardwareID : {USB\VID_239A&PID_8029&REV_0100&MI_00, USB\VID_239A&PID_8029&MI_00} =>
|
||||||
|
PNPClass : Ports =>
|
||||||
|
Service : usbser =>
|
||||||
|
Class : Ports =>
|
||||||
|
FriendlyName : USB Serial Device (COM4) =>
|
||||||
|
InstanceId : USB\VID_239A&PID_8029&MI_00\6&E8876D1&0&0000 =>
|
||||||
|
Caption : USB Composite Device =>
|
||||||
|
Description : USB Composite Device =>
|
||||||
|
Name : USB Composite Device =>
|
||||||
|
DeviceID : USB\VID_239A&PID_8029\E6CF9502B1D410D8 =>
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_8029\E6CF9502B1D410D8 =>
|
||||||
|
ClassGuid : {36fc9e60-c465-11cf-8056-444553540000} =>
|
||||||
|
CompatibleID : {USB\DevClass_00&SubClass_00&Prot_00, USB\DevClass_00&SubClass_00, USB\DevClass_00, =>
|
||||||
|
USB\COMPOSITE} =>
|
||||||
|
HardwareID : {USB\VID_239A&PID_8029&REV_0100, USB\VID_239A&PID_8029} =>
|
||||||
|
Manufacturer : (Standard USB Host Controller) =>
|
||||||
|
PNPClass : USB =>
|
||||||
|
Service : usbccgp =>
|
||||||
|
Class : USB =>
|
||||||
|
FriendlyName : USB Composite Device =>
|
||||||
|
InstanceId : USB\VID_239A&PID_8029\E6CF9502B1D410D8 =>
|
||||||
|
InstallDate : =>
|
||||||
|
Status : OK =>
|
||||||
|
Availability : =>
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE =>
|
||||||
|
ConfigManagerUserConfig : False =>
|
||||||
|
CreationClassName : Win32_PnPEntity =>
|
||||||
|
ErrorCleared : =>
|
||||||
|
ErrorDescription : =>
|
||||||
|
LastErrorCode : =>
|
||||||
|
PowerManagementCapabilities : =>
|
||||||
|
PowerManagementSupported : =>
|
||||||
|
StatusInfo : =>
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem =>
|
||||||
|
SystemName : DESKTOP-FRFQN8H =>
|
||||||
|
Present : True =>
|
||||||
|
PSComputerName : =>
|
||||||
|
Problem : CM_PROB_NONE =>
|
||||||
|
ProblemDescription : =>
|
||||||
|
InstallDate : =>
|
||||||
|
Status : OK =>
|
||||||
|
Availability : =>
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE =>
|
||||||
|
ConfigManagerUserConfig : False =>
|
||||||
|
CreationClassName : Win32_PnPEntity =>
|
||||||
|
ErrorCleared : =>
|
||||||
|
ErrorDescription : =>
|
||||||
|
LastErrorCode : =>
|
||||||
|
PowerManagementCapabilities : =>
|
||||||
|
PowerManagementSupported : =>
|
||||||
|
StatusInfo : =>
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem =>
|
||||||
|
SystemName : DESKTOP-FRFQN8H =>
|
||||||
|
Manufacturer : Microsoft =>
|
||||||
|
Present : True =>
|
||||||
|
PSComputerName : =>
|
||||||
|
Problem : CM_PROB_NONE =>
|
||||||
|
ProblemDescription : =>
|
||||||
|
=>
|
||||||
|
=>
|
||||||
254
info/windows/rak4631_5005.txt
Normal file
254
info/windows/rak4631_5005.txt
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
Run from Windows 10
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >a
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >b
|
||||||
|
> Compare-Object (get-content a) (Get-Content b)
|
||||||
|
|
||||||
|
In "boot" mode:
|
||||||
|
|
||||||
|
InputObject
|
||||||
|
-----------
|
||||||
|
Caption : FTHR840BOOT
|
||||||
|
Description : nRF UF2
|
||||||
|
Name : FTHR840BOOT
|
||||||
|
DeviceID : SWD\WPDBUSENUM\_??_USBSTOR#DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0#7&27E1626&0&D121BD1C90B
|
||||||
|
93EA2&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
|
||||||
|
PNPDeviceID : SWD\WPDBUSENUM\_??_USBSTOR#DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0#7&27E1626&0&D121BD1C90B
|
||||||
|
93EA2&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
|
||||||
|
ClassGuid : {eec5ad98-8080-425f-922a-dabf3de3f69a}
|
||||||
|
CompatibleID : {wpdbusenum\fs, SWD\Generic}
|
||||||
|
Manufacturer : Adafruit
|
||||||
|
PNPClass : WPD
|
||||||
|
Service : WUDFWpdFs
|
||||||
|
Class : WPD
|
||||||
|
FriendlyName : FTHR840BOOT
|
||||||
|
InstanceId : SWD\WPDBUSENUM\_??_USBSTOR#DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0#7&27E1626&0&D121BD1C90B
|
||||||
|
93EA2&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
|
||||||
|
DeviceID : STORAGE\VOLUME\_??_USBSTOR#DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0#7&27E1626&0&D121BD1C90B
|
||||||
|
93EA2&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
|
||||||
|
PNPDeviceID : STORAGE\VOLUME\_??_USBSTOR#DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0#7&27E1626&0&D121BD1C90B
|
||||||
|
93EA2&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
|
||||||
|
InstanceId : STORAGE\VOLUME\_??_USBSTOR#DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0#7&27E1626&0&D121BD1C90B
|
||||||
|
93EA2&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
|
||||||
|
Caption : USB Mass Storage Device
|
||||||
|
Description : USB Mass Storage Device
|
||||||
|
Name : USB Mass Storage Device
|
||||||
|
DeviceID : USB\VID_239A&PID_0029&MI_02\6&175793A&0&0002
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_0029&MI_02\6&175793A&0&0002
|
||||||
|
CompatibleID : {USB\Class_08&SubClass_06&Prot_50, USB\Class_08&SubClass_06, USB\Class_08}
|
||||||
|
HardwareID : {USB\VID_239A&PID_0029&REV_0100&MI_02, USB\VID_239A&PID_0029&MI_02}
|
||||||
|
Manufacturer : Compatible USB storage device
|
||||||
|
Service : USBSTOR
|
||||||
|
FriendlyName : USB Mass Storage Device
|
||||||
|
InstanceId : USB\VID_239A&PID_0029&MI_02\6&175793A&0&0002
|
||||||
|
Caption : USB Serial Device (COM5)
|
||||||
|
Description : USB Serial Device
|
||||||
|
Name : USB Serial Device (COM5)
|
||||||
|
DeviceID : USB\VID_239A&PID_0029&MI_00\6&175793A&0&0000
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_0029&MI_00\6&175793A&0&0000
|
||||||
|
ClassGuid : {4d36e978-e325-11ce-bfc1-08002be10318}
|
||||||
|
CompatibleID : {USB\Class_02&SubClass_02&Prot_00, USB\Class_02&SubClass_02, USB\Class_02}
|
||||||
|
HardwareID : {USB\VID_239A&PID_0029&REV_0100&MI_00, USB\VID_239A&PID_0029&MI_00}
|
||||||
|
PNPClass : Ports
|
||||||
|
Service : usbser
|
||||||
|
Class : Ports
|
||||||
|
FriendlyName : USB Serial Device (COM5)
|
||||||
|
InstanceId : USB\VID_239A&PID_0029&MI_00\6&175793A&0&0000
|
||||||
|
DeviceID : USB\VID_239A&PID_0029\D121BD1C90B93EA2
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_0029\D121BD1C90B93EA2
|
||||||
|
ClassGuid : {36fc9e60-c465-11cf-8056-444553540000}
|
||||||
|
HardwareID : {USB\VID_239A&PID_0029&REV_0100, USB\VID_239A&PID_0029}
|
||||||
|
PNPClass : USB
|
||||||
|
Class : USB
|
||||||
|
InstanceId : USB\VID_239A&PID_0029\D121BD1C90B93EA2
|
||||||
|
Caption : USB Composite Device
|
||||||
|
Description : USB Composite Device
|
||||||
|
Name : USB Composite Device
|
||||||
|
ClassGuid : {36fc9e60-c465-11cf-8056-444553540000}
|
||||||
|
CompatibleID : {USB\DevClass_00&SubClass_00&Prot_00, USB\DevClass_00&SubClass_00, USB\DevClass_00,
|
||||||
|
USB\COMPOSITE}
|
||||||
|
Manufacturer : (Standard USB Host Controller)
|
||||||
|
PNPClass : USB
|
||||||
|
Service : usbccgp
|
||||||
|
Class : USB
|
||||||
|
FriendlyName : USB Composite Device
|
||||||
|
Caption : Volume
|
||||||
|
Description : Volume
|
||||||
|
Name : Volume
|
||||||
|
ClassGuid : {71a27cdd-812a-11d0-bec7-08002be2092f}
|
||||||
|
HardwareID : {STORAGE\Volume}
|
||||||
|
PNPClass : Volume
|
||||||
|
Service : volume
|
||||||
|
Class : Volume
|
||||||
|
FriendlyName : Volume
|
||||||
|
HardwareID :
|
||||||
|
Caption : Adafruit nRF UF2 USB Device
|
||||||
|
Name : Adafruit nRF UF2 USB Device
|
||||||
|
DeviceID : USBSTOR\DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0\7&27E1626&0&D121BD1C90B93EA2&0
|
||||||
|
PNPDeviceID : USBSTOR\DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0\7&27E1626&0&D121BD1C90B93EA2&0
|
||||||
|
CompatibleID : {USBSTOR\Disk, USBSTOR\RAW, GenDisk}
|
||||||
|
HardwareID : {USBSTOR\DiskAdafruitnRF_UF2_________1.0_, USBSTOR\DiskAdafruitnRF_UF2_________,
|
||||||
|
USBSTOR\DiskAdafruit, USBSTOR\AdafruitnRF_UF2_________1...}
|
||||||
|
FriendlyName : Adafruit nRF UF2 USB Device
|
||||||
|
InstanceId : USBSTOR\DISK&VEN_ADAFRUIT&PROD_NRF_UF2&REV_1.0\7&27E1626&0&D121BD1C90B93EA2&0
|
||||||
|
Description : Disk drive
|
||||||
|
ClassGuid : {4d36e967-e325-11ce-bfc1-08002be10318}
|
||||||
|
Manufacturer : (Standard disk drives)
|
||||||
|
PNPClass : DiskDrive
|
||||||
|
Service : disk
|
||||||
|
Class : DiskDrive
|
||||||
|
CompatibleID :
|
||||||
|
InstallDate :
|
||||||
|
Status : OK
|
||||||
|
Availability :
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE
|
||||||
|
ConfigManagerUserConfig : False
|
||||||
|
CreationClassName : Win32_PnPEntity
|
||||||
|
ErrorCleared :
|
||||||
|
ErrorDescription :
|
||||||
|
LastErrorCode :
|
||||||
|
PowerManagementCapabilities :
|
||||||
|
PowerManagementSupported :
|
||||||
|
StatusInfo :
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem
|
||||||
|
SystemName : DESKTOP-FRFQN8H
|
||||||
|
Present : True
|
||||||
|
PSComputerName :
|
||||||
|
Problem : CM_PROB_NONE
|
||||||
|
ProblemDescription :
|
||||||
|
InstallDate :
|
||||||
|
Status : OK
|
||||||
|
Availability :
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE
|
||||||
|
ConfigManagerUserConfig : False
|
||||||
|
CreationClassName : Win32_PnPEntity
|
||||||
|
ErrorCleared :
|
||||||
|
ErrorDescription :
|
||||||
|
LastErrorCode :
|
||||||
|
PowerManagementCapabilities :
|
||||||
|
PowerManagementSupported :
|
||||||
|
StatusInfo :
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem
|
||||||
|
SystemName : DESKTOP-FRFQN8H
|
||||||
|
Present : True
|
||||||
|
PSComputerName :
|
||||||
|
Problem : CM_PROB_NONE
|
||||||
|
ProblemDescription :
|
||||||
|
InstallDate :
|
||||||
|
Status : OK
|
||||||
|
Availability :
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE
|
||||||
|
ConfigManagerUserConfig : False
|
||||||
|
CreationClassName : Win32_PnPEntity
|
||||||
|
ErrorCleared :
|
||||||
|
ErrorDescription :
|
||||||
|
LastErrorCode :
|
||||||
|
PowerManagementCapabilities :
|
||||||
|
PowerManagementSupported :
|
||||||
|
StatusInfo :
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem
|
||||||
|
SystemName : DESKTOP-FRFQN8H
|
||||||
|
Present : True
|
||||||
|
PSComputerName :
|
||||||
|
Problem : CM_PROB_NONE
|
||||||
|
ProblemDescription :
|
||||||
|
|
||||||
|
InstallDate :
|
||||||
|
Status : OK
|
||||||
|
Availability :
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE
|
||||||
|
ConfigManagerUserConfig : False
|
||||||
|
CreationClassName : Win32_PnPEntity
|
||||||
|
ErrorCleared :
|
||||||
|
ErrorDescription :
|
||||||
|
LastErrorCode :
|
||||||
|
PowerManagementCapabilities :
|
||||||
|
PowerManagementSupported :
|
||||||
|
StatusInfo :
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem
|
||||||
|
SystemName : DESKTOP-FRFQN8H
|
||||||
|
Manufacturer : Microsoft
|
||||||
|
Present : True
|
||||||
|
PSComputerName :
|
||||||
|
Problem : CM_PROB_NONE
|
||||||
|
ProblemDescription :
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
When you press the RST to load Meshtastic:
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >b
|
||||||
|
> Compare-Object (get-content a) (Get-Content b)
|
||||||
|
|
||||||
|
InputObject Side
|
||||||
|
Indi
|
||||||
|
cato
|
||||||
|
r
|
||||||
|
----------- ----
|
||||||
|
DeviceID : USB\VID_239A&PID_8029\D121BD1C90B93EA2 =>
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_8029\D121BD1C90B93EA2 =>
|
||||||
|
HardwareID : {USB\VID_239A&PID_8029&REV_0100, USB\VID_239A&PID_8029} =>
|
||||||
|
InstanceId : USB\VID_239A&PID_8029\D121BD1C90B93EA2 =>
|
||||||
|
Caption : USB Composite Device =>
|
||||||
|
Description : USB Composite Device =>
|
||||||
|
Name : USB Composite Device =>
|
||||||
|
ClassGuid : {36fc9e60-c465-11cf-8056-444553540000} =>
|
||||||
|
CompatibleID : {USB\DevClass_00&SubClass_00&Prot_00, USB\DevClass_00&SubClass_00, USB\DevClass_00, =>
|
||||||
|
USB\COMPOSITE} =>
|
||||||
|
Manufacturer : (Standard USB Host Controller) =>
|
||||||
|
PNPClass : USB =>
|
||||||
|
Service : usbccgp =>
|
||||||
|
Class : USB =>
|
||||||
|
FriendlyName : USB Composite Device =>
|
||||||
|
Caption : USB Serial Device (COM6) =>
|
||||||
|
Description : USB Serial Device =>
|
||||||
|
Name : USB Serial Device (COM6) =>
|
||||||
|
DeviceID : USB\VID_239A&PID_8029&MI_00\6&39B279E2&0&0000 =>
|
||||||
|
PNPDeviceID : USB\VID_239A&PID_8029&MI_00\6&39B279E2&0&0000 =>
|
||||||
|
ClassGuid : {4d36e978-e325-11ce-bfc1-08002be10318} =>
|
||||||
|
CompatibleID : {USB\Class_02&SubClass_02&Prot_00, USB\Class_02&SubClass_02, USB\Class_02} =>
|
||||||
|
HardwareID : {USB\VID_239A&PID_8029&REV_0100&MI_00, USB\VID_239A&PID_8029&MI_00} =>
|
||||||
|
PNPClass : Ports =>
|
||||||
|
Service : usbser =>
|
||||||
|
Class : Ports =>
|
||||||
|
FriendlyName : USB Serial Device (COM6) =>
|
||||||
|
InstanceId : USB\VID_239A&PID_8029&MI_00\6&39B279E2&0&0000 =>
|
||||||
|
InstallDate : =>
|
||||||
|
Status : OK =>
|
||||||
|
Availability : =>
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE =>
|
||||||
|
ConfigManagerUserConfig : False =>
|
||||||
|
CreationClassName : Win32_PnPEntity =>
|
||||||
|
ErrorCleared : =>
|
||||||
|
ErrorDescription : =>
|
||||||
|
LastErrorCode : =>
|
||||||
|
PowerManagementCapabilities : =>
|
||||||
|
PowerManagementSupported : =>
|
||||||
|
StatusInfo : =>
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem =>
|
||||||
|
SystemName : DESKTOP-FRFQN8H =>
|
||||||
|
Present : True =>
|
||||||
|
PSComputerName : =>
|
||||||
|
Problem : CM_PROB_NONE =>
|
||||||
|
ProblemDescription : =>
|
||||||
|
InstallDate : =>
|
||||||
|
Status : OK =>
|
||||||
|
Availability : =>
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE =>
|
||||||
|
ConfigManagerUserConfig : False =>
|
||||||
|
CreationClassName : Win32_PnPEntity =>
|
||||||
|
ErrorCleared : =>
|
||||||
|
ErrorDescription : =>
|
||||||
|
LastErrorCode : =>
|
||||||
|
PowerManagementCapabilities : =>
|
||||||
|
PowerManagementSupported : =>
|
||||||
|
StatusInfo : =>
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem =>
|
||||||
|
SystemName : DESKTOP-FRFQN8H =>
|
||||||
|
Manufacturer : Microsoft =>
|
||||||
|
Present : True =>
|
||||||
|
PSComputerName : =>
|
||||||
|
Problem : CM_PROB_NONE =>
|
||||||
|
ProblemDescription : =>
|
||||||
|
=>
|
||||||
|
|
||||||
42
info/windows/tbeam.txt
Normal file
42
info/windows/tbeam.txt
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
Run from Windows 10
|
||||||
|
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >a
|
||||||
|
> Get-PnpDevice -PresentOnly | Format-List >b
|
||||||
|
> Compare-Object (get-content a) (Get-Content b)
|
||||||
|
|
||||||
|
InputObject SideIndicator
|
||||||
|
----------- -------------
|
||||||
|
Caption : USB-Enhanced-SERIAL CH9102 (COM7) =>
|
||||||
|
Description : USB-Enhanced-SERIAL CH9102 =>
|
||||||
|
Name : USB-Enhanced-SERIAL CH9102 (COM7) =>
|
||||||
|
DeviceID : USB\VID_1A86&PID_55D4\5323005057 =>
|
||||||
|
PNPDeviceID : USB\VID_1A86&PID_55D4\5323005057 =>
|
||||||
|
ClassGuid : {4d36e978-e325-11ce-bfc1-08002be10318} =>
|
||||||
|
CompatibleID : {USB\Class_02&SubClass_02&Prot_01, USB\Class_02&SubClass_02, USB\Class_02} =>
|
||||||
|
HardwareID : {USB\VID_1A86&PID_55D4&REV_0443, USB\VID_1A86&PID_55D4} =>
|
||||||
|
Manufacturer : wch.cn =>
|
||||||
|
PNPClass : Ports =>
|
||||||
|
Service : CH343SER_A64 =>
|
||||||
|
Class : Ports =>
|
||||||
|
FriendlyName : USB-Enhanced-SERIAL CH9102 (COM7) =>
|
||||||
|
InstanceId : USB\VID_1A86&PID_55D4\5323005057 =>
|
||||||
|
InstallDate : =>
|
||||||
|
Status : OK =>
|
||||||
|
Availability : =>
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE =>
|
||||||
|
ConfigManagerUserConfig : False =>
|
||||||
|
CreationClassName : Win32_PnPEntity =>
|
||||||
|
ErrorCleared : =>
|
||||||
|
ErrorDescription : =>
|
||||||
|
LastErrorCode : =>
|
||||||
|
PowerManagementCapabilities : =>
|
||||||
|
PowerManagementSupported : =>
|
||||||
|
StatusInfo : =>
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem =>
|
||||||
|
SystemName : DESKTOP-FRFQN8H =>
|
||||||
|
Present : True =>
|
||||||
|
PSComputerName : =>
|
||||||
|
Problem : CM_PROB_NONE =>
|
||||||
|
ProblemDescription : =>
|
||||||
|
=>
|
||||||
|
|
||||||
41
info/windows/tlora.txt
Normal file
41
info/windows/tlora.txt
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
Run from Windows 10
|
||||||
|
|
||||||
|
PS C:\Users\mikekinney> Get-PnpDevice -PresentOnly | Format-List > a
|
||||||
|
PS C:\Users\mikekinney> Get-PnpDevice -PresentOnly | Format-List > b
|
||||||
|
PS C:\Users\mikekinney> Compare-Object (get-content a) (Get-Content b)
|
||||||
|
|
||||||
|
InputObject SideIndicator
|
||||||
|
----------- -------------
|
||||||
|
Caption : USB-Enhanced-SERIAL CH9102 (COM3) <=
|
||||||
|
Description : USB-Enhanced-SERIAL CH9102 <=
|
||||||
|
Name : USB-Enhanced-SERIAL CH9102 (COM3) <=
|
||||||
|
DeviceID : USB\VID_1A86&PID_55D4\5&27435A1F&0&1 <=
|
||||||
|
PNPDeviceID : USB\VID_1A86&PID_55D4\5&27435A1F&0&1 <=
|
||||||
|
ClassGuid : {4d36e978-e325-11ce-bfc1-08002be10318} <=
|
||||||
|
CompatibleID : {USB\Class_02&SubClass_02&Prot_01, USB\Class_02&SubClass_02, USB\Class_02} <=
|
||||||
|
HardwareID : {USB\VID_1A86&PID_55D4&REV_0443, USB\VID_1A86&PID_55D4} <=
|
||||||
|
Manufacturer : wch.cn <=
|
||||||
|
PNPClass : Ports <=
|
||||||
|
Service : CH343SER_A64 <=
|
||||||
|
Class : Ports <=
|
||||||
|
FriendlyName : USB-Enhanced-SERIAL CH9102 (COM3) <=
|
||||||
|
InstanceId : USB\VID_1A86&PID_55D4\5&27435A1F&0&1 <=
|
||||||
|
InstallDate : <=
|
||||||
|
Status : OK <=
|
||||||
|
Availability : <=
|
||||||
|
ConfigManagerErrorCode : CM_PROB_NONE <=
|
||||||
|
ConfigManagerUserConfig : False <=
|
||||||
|
CreationClassName : Win32_PnPEntity <=
|
||||||
|
ErrorCleared : <=
|
||||||
|
ErrorDescription : <=
|
||||||
|
LastErrorCode : <=
|
||||||
|
PowerManagementCapabilities : <=
|
||||||
|
PowerManagementSupported : <=
|
||||||
|
StatusInfo : <=
|
||||||
|
SystemCreationClassName : Win32_ComputerSystem <=
|
||||||
|
SystemName : DESKTOP-FRFQN8H <=
|
||||||
|
Present : True <=
|
||||||
|
PSComputerName : <=
|
||||||
|
Problem : CM_PROB_NONE <=
|
||||||
|
ProblemDescription : <=
|
||||||
|
<=
|
||||||
@@ -117,6 +117,7 @@ def setPref(attributes, name, valStr):
|
|||||||
return
|
return
|
||||||
|
|
||||||
val = meshtastic.util.fromStr(valStr)
|
val = meshtastic.util.fromStr(valStr)
|
||||||
|
logging.debug(f'valStr:{valStr} val:{val}')
|
||||||
|
|
||||||
enumType = field.enum_type
|
enumType = field.enum_type
|
||||||
# pylint: disable=C0123
|
# pylint: disable=C0123
|
||||||
@@ -133,15 +134,16 @@ def setPref(attributes, name, valStr):
|
|||||||
print(f"Choices in sorted order are:")
|
print(f"Choices in sorted order are:")
|
||||||
names = []
|
names = []
|
||||||
for f in enumType.values:
|
for f in enumType.values:
|
||||||
tmp_name = f'{f.name}'
|
# Note: We must use the value of the enum (regardless if camel or snake case)
|
||||||
if Globals.getInstance().get_camel_case():
|
names.append(f'{f.name}')
|
||||||
tmp_name = meshtastic.util.snake_to_camel(tmp_name)
|
|
||||||
names.append(name)
|
|
||||||
for temp_name in sorted(names):
|
for temp_name in sorted(names):
|
||||||
print(f" {temp_name}")
|
print(f" {temp_name}")
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
setattr(attributes, snake_name, val)
|
setattr(attributes, snake_name, val)
|
||||||
|
except TypeError:
|
||||||
|
# The setter didn't like our arg type guess try again as a string
|
||||||
|
setattr(attributes, snake_name, valStr)
|
||||||
|
|
||||||
if Globals.getInstance().get_camel_case():
|
if Globals.getInstance().get_camel_case():
|
||||||
print(f"Set {camel_name} to {valStr}")
|
print(f"Set {camel_name} to {valStr}")
|
||||||
@@ -193,6 +195,11 @@ def onConnected(interface):
|
|||||||
print(f"Setting device owner to {args.set_owner}")
|
print(f"Setting device owner to {args.set_owner}")
|
||||||
interface.getNode(args.dest).setOwner(args.set_owner)
|
interface.getNode(args.dest).setOwner(args.set_owner)
|
||||||
|
|
||||||
|
if args.set_owner_short:
|
||||||
|
closeNow = True
|
||||||
|
print(f"Setting device owner short to {args.set_owner_short}")
|
||||||
|
interface.getNode(args.dest).setOwner(long_name=None, short_name=args.set_owner_short)
|
||||||
|
|
||||||
if args.pos_fields:
|
if args.pos_fields:
|
||||||
# If --pos-fields invoked with args, set position fields
|
# If --pos-fields invoked with args, set position fields
|
||||||
closeNow = True
|
closeNow = True
|
||||||
@@ -250,6 +257,10 @@ def onConnected(interface):
|
|||||||
closeNow = True
|
closeNow = True
|
||||||
interface.getNode(args.dest).reboot()
|
interface.getNode(args.dest).reboot()
|
||||||
|
|
||||||
|
if args.shutdown:
|
||||||
|
closeNow = True
|
||||||
|
interface.getNode(args.dest).shutdown()
|
||||||
|
|
||||||
if args.sendtext:
|
if args.sendtext:
|
||||||
closeNow = True
|
closeNow = True
|
||||||
channelIndex = 0
|
channelIndex = 0
|
||||||
@@ -290,12 +301,11 @@ def onConnected(interface):
|
|||||||
print(f"Reading GPIO mask 0x{bitmask:x} from {args.dest}")
|
print(f"Reading GPIO mask 0x{bitmask:x} from {args.dest}")
|
||||||
interface.mask = bitmask
|
interface.mask = bitmask
|
||||||
rhc.readGPIOs(args.dest, bitmask, None)
|
rhc.readGPIOs(args.dest, bitmask, None)
|
||||||
if not interface.noProto:
|
# wait up to X seconds for a response
|
||||||
# wait up to X seconds for a response
|
for _ in range(10):
|
||||||
for _ in range(10):
|
time.sleep(1)
|
||||||
time.sleep(1)
|
if interface.gotResponse:
|
||||||
if interface.gotResponse:
|
break
|
||||||
break
|
|
||||||
logging.debug(f'end of gpio_rd')
|
logging.debug(f'end of gpio_rd')
|
||||||
|
|
||||||
if args.gpio_watch:
|
if args.gpio_watch:
|
||||||
@@ -326,6 +336,14 @@ def onConnected(interface):
|
|||||||
print(f"Setting device owner to {configuration['owner']}")
|
print(f"Setting device owner to {configuration['owner']}")
|
||||||
interface.getNode(args.dest).setOwner(configuration['owner'])
|
interface.getNode(args.dest).setOwner(configuration['owner'])
|
||||||
|
|
||||||
|
if 'owner_short' in configuration:
|
||||||
|
print(f"Setting device owner short to {configuration['owner_short']}")
|
||||||
|
interface.getNode(args.dest).setOwner(long_name=None, short_name=configuration['owner_short'])
|
||||||
|
|
||||||
|
if 'ownerShort' in configuration:
|
||||||
|
print(f"Setting device owner short to {configuration['ownerShort']}")
|
||||||
|
interface.getNode(args.dest).setOwner(long_name=None, short_name=configuration['ownerShort'])
|
||||||
|
|
||||||
if 'channel_url' in configuration:
|
if 'channel_url' in configuration:
|
||||||
print("Setting channel url to", configuration['channel_url'])
|
print("Setting channel url to", configuration['channel_url'])
|
||||||
interface.getNode(args.dest).setURL(configuration['channel_url'])
|
interface.getNode(args.dest).setURL(configuration['channel_url'])
|
||||||
@@ -563,6 +581,7 @@ def subscribe():
|
|||||||
def export_config(interface):
|
def export_config(interface):
|
||||||
"""used in--export-config"""
|
"""used in--export-config"""
|
||||||
owner = interface.getLongName()
|
owner = interface.getLongName()
|
||||||
|
owner_short = interface.getShortName()
|
||||||
channel_url = interface.localNode.getURL()
|
channel_url = interface.localNode.getURL()
|
||||||
myinfo = interface.getMyNodeInfo()
|
myinfo = interface.getMyNodeInfo()
|
||||||
pos = myinfo.get('position')
|
pos = myinfo.get('position')
|
||||||
@@ -577,6 +596,8 @@ def export_config(interface):
|
|||||||
config = "# start of Meshtastic configure yaml\n"
|
config = "# start of Meshtastic configure yaml\n"
|
||||||
if owner:
|
if owner:
|
||||||
config += f"owner: {owner}\n\n"
|
config += f"owner: {owner}\n\n"
|
||||||
|
if owner_short:
|
||||||
|
config += f"owner_short: {owner_short}\n\n"
|
||||||
if channel_url:
|
if channel_url:
|
||||||
if Globals.getInstance().get_camel_case():
|
if Globals.getInstance().get_camel_case():
|
||||||
config += f"channelUrl: {channel_url}\n\n"
|
config += f"channelUrl: {channel_url}\n\n"
|
||||||
@@ -759,7 +780,12 @@ def initParser():
|
|||||||
"--ch-disable", help="Disable the specified channel", action="store_true", dest="ch_disable", default=False)
|
"--ch-disable", help="Disable the specified channel", action="store_true", dest="ch_disable", default=False)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ch-set", help="Set a channel parameter", nargs=2, action='append')
|
"--ch-set", help=("Set a channel parameter. To see channel settings available:'--ch-set all all --ch-index 0'. "
|
||||||
|
"Can set the 'psk' using this command. To disable encryption on primary channel:'--ch-set psk none --ch-index 0'. "
|
||||||
|
"To set encryption with a new random key on second channel:'--ch-set psk random --ch-index 1'. "
|
||||||
|
"To set encryption back to the default:'--ch-set default --ch-index 0'. To set encryption with your "
|
||||||
|
"own key: '--ch-set psk 0x1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b --ch-index 0'."),
|
||||||
|
nargs=2, action='append')
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ch-longslow", help="Change to the long-range and slow channel", action='store_true')
|
"--ch-longslow", help="Change to the long-range and slow channel", action='store_true')
|
||||||
@@ -779,10 +805,12 @@ def initParser():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ch-shortfast", help="Change to the short-range and fast channel", action='store_true')
|
"--ch-shortfast", help="Change to the short-range and fast channel", action='store_true')
|
||||||
|
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--set-owner", help="Set device owner name", action="store")
|
"--set-owner", help="Set device owner name", action="store")
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--set-owner-short", help="Set device owner short name", action="store")
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--set-team", help="Set team affiliation (an invalid team will list valid values)", action="store")
|
"--set-team", help="Set team affiliation (an invalid team will list valid values)", action="store")
|
||||||
|
|
||||||
@@ -801,6 +829,9 @@ def initParser():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--reboot", help="Tell the destination node to reboot", action="store_true")
|
"--reboot", help="Tell the destination node to reboot", action="store_true")
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--shutdown", help="Tell the destination node to shutdown", action="store_true")
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--reply", help="Reply to received messages",
|
"--reply", help="Reply to received messages",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: admin.proto
|
# source: admin.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -11,188 +12,17 @@ from google.protobuf import symbol_database as _symbol_database
|
|||||||
_sym_db = _symbol_database.Default()
|
_sym_db = _symbol_database.Default()
|
||||||
|
|
||||||
|
|
||||||
|
from . import cannedmessages_pb2 as cannedmessages__pb2
|
||||||
from . import channel_pb2 as channel__pb2
|
from . import channel_pb2 as channel__pb2
|
||||||
from . import radioconfig_pb2 as radioconfig__pb2
|
|
||||||
from . import mesh_pb2 as mesh__pb2
|
from . import mesh_pb2 as mesh__pb2
|
||||||
|
from . import radioconfig_pb2 as radioconfig__pb2
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x61\x64min.proto\x1a\x14\x63\x61nnedmessages.proto\x1a\rchannel.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\"\x87\x0c\n\x0c\x41\x64minMessage\x12!\n\tset_radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x02 \x01(\x0b\x32\x05.UserH\x00\x12\x1f\n\x0bset_channel\x18\x03 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_radio_request\x18\x04 \x01(\x08H\x00\x12*\n\x12get_radio_response\x18\x05 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1d\n\x13get_channel_request\x18\x06 \x01(\rH\x00\x12(\n\x14get_channel_response\x18\x07 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_owner_request\x18\x08 \x01(\x08H\x00\x12#\n\x12get_owner_response\x18\t \x01(\x0b\x32\x05.UserH\x00\x12\x1d\n\x13\x63onfirm_set_channel\x18 \x01(\x08H\x00\x12\x1b\n\x11\x63onfirm_set_radio\x18! \x01(\x08H\x00\x12\x18\n\x0e\x65xit_simulator\x18\" \x01(\x08H\x00\x12\x18\n\x0ereboot_seconds\x18# \x01(\x05H\x00\x12\x31\n\'get_canned_message_plugin_part1_request\x18$ \x01(\x08H\x00\x12T\n(get_canned_message_plugin_part1_response\x18% \x01(\x0b\x32 .CannedMessagePluginMessagePart1H\x00\x12\x31\n\'get_canned_message_plugin_part2_request\x18& \x01(\x08H\x00\x12T\n(get_canned_message_plugin_part2_response\x18\' \x01(\x0b\x32 .CannedMessagePluginMessagePart2H\x00\x12\x31\n\'get_canned_message_plugin_part3_request\x18( \x01(\x08H\x00\x12T\n(get_canned_message_plugin_part3_response\x18) \x01(\x0b\x32 .CannedMessagePluginMessagePart3H\x00\x12\x31\n\'get_canned_message_plugin_part4_request\x18* \x01(\x08H\x00\x12T\n(get_canned_message_plugin_part4_response\x18+ \x01(\x0b\x32 .CannedMessagePluginMessagePart4H\x00\x12\x31\n\'get_canned_message_plugin_part5_request\x18, \x01(\x08H\x00\x12T\n(get_canned_message_plugin_part5_response\x18- \x01(\x0b\x32 .CannedMessagePluginMessagePart5H\x00\x12K\n\x1fset_canned_message_plugin_part1\x18. \x01(\x0b\x32 .CannedMessagePluginMessagePart1H\x00\x12K\n\x1fset_canned_message_plugin_part2\x18/ \x01(\x0b\x32 .CannedMessagePluginMessagePart2H\x00\x12K\n\x1fset_canned_message_plugin_part3\x18\x30 \x01(\x0b\x32 .CannedMessagePluginMessagePart3H\x00\x12K\n\x1fset_canned_message_plugin_part4\x18\x31 \x01(\x0b\x32 .CannedMessagePluginMessagePart4H\x00\x12K\n\x1fset_canned_message_plugin_part5\x18\x32 \x01(\x0b\x32 .CannedMessagePluginMessagePart5H\x00\x12\x1a\n\x10shutdown_seconds\x18\x33 \x01(\x05H\x00\x42\t\n\x07variantBG\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='admin.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\013AdminProtosH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\x0b\x61\x64min.proto\x1a\rchannel.proto\x1a\x11radioconfig.proto\x1a\nmesh.proto\"\xbd\x03\n\x0c\x41\x64minMessage\x12!\n\tset_radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x02 \x01(\x0b\x32\x05.UserH\x00\x12\x1f\n\x0bset_channel\x18\x03 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_radio_request\x18\x04 \x01(\x08H\x00\x12*\n\x12get_radio_response\x18\x05 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1d\n\x13get_channel_request\x18\x06 \x01(\rH\x00\x12(\n\x14get_channel_response\x18\x07 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_owner_request\x18\x08 \x01(\x08H\x00\x12#\n\x12get_owner_response\x18\t \x01(\x0b\x32\x05.UserH\x00\x12\x1d\n\x13\x63onfirm_set_channel\x18 \x01(\x08H\x00\x12\x1b\n\x11\x63onfirm_set_radio\x18! \x01(\x08H\x00\x12\x18\n\x0e\x65xit_simulator\x18\" \x01(\x08H\x00\x12\x18\n\x0ereboot_seconds\x18# \x01(\x05H\x00\x42\t\n\x07variantBG\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
,
|
|
||||||
dependencies=[channel__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,mesh__pb2.DESCRIPTOR,])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_ADMINMESSAGE = DESCRIPTOR.message_types_by_name['AdminMessage']
|
||||||
_ADMINMESSAGE = _descriptor.Descriptor(
|
|
||||||
name='AdminMessage',
|
|
||||||
full_name='AdminMessage',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='set_radio', full_name='AdminMessage.set_radio', index=0,
|
|
||||||
number=1, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='set_owner', full_name='AdminMessage.set_owner', index=1,
|
|
||||||
number=2, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='set_channel', full_name='AdminMessage.set_channel', index=2,
|
|
||||||
number=3, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='get_radio_request', full_name='AdminMessage.get_radio_request', index=3,
|
|
||||||
number=4, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='get_radio_response', full_name='AdminMessage.get_radio_response', index=4,
|
|
||||||
number=5, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='get_channel_request', full_name='AdminMessage.get_channel_request', index=5,
|
|
||||||
number=6, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='get_channel_response', full_name='AdminMessage.get_channel_response', index=6,
|
|
||||||
number=7, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='get_owner_request', full_name='AdminMessage.get_owner_request', index=7,
|
|
||||||
number=8, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='get_owner_response', full_name='AdminMessage.get_owner_response', index=8,
|
|
||||||
number=9, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='confirm_set_channel', full_name='AdminMessage.confirm_set_channel', index=9,
|
|
||||||
number=32, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='confirm_set_radio', full_name='AdminMessage.confirm_set_radio', index=10,
|
|
||||||
number=33, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='exit_simulator', full_name='AdminMessage.exit_simulator', index=11,
|
|
||||||
number=34, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='reboot_seconds', full_name='AdminMessage.reboot_seconds', index=12,
|
|
||||||
number=35, type=5, cpp_type=1, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
_descriptor.OneofDescriptor(
|
|
||||||
name='variant', full_name='AdminMessage.variant',
|
|
||||||
index=0, containing_type=None, fields=[]),
|
|
||||||
],
|
|
||||||
serialized_start=62,
|
|
||||||
serialized_end=507,
|
|
||||||
)
|
|
||||||
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_radio'].message_type = radioconfig__pb2._RADIOCONFIG
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_owner'].message_type = mesh__pb2._USER
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_channel'].message_type = channel__pb2._CHANNEL
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_radio_response'].message_type = radioconfig__pb2._RADIOCONFIG
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_channel_response'].message_type = channel__pb2._CHANNEL
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_owner_response'].message_type = mesh__pb2._USER
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_radio'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_radio'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_owner'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_owner'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_channel'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['set_channel'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_radio_request'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_radio_request'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_radio_response'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_radio_response'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_channel_request'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_channel_request'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_channel_response'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_channel_response'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_owner_request'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_owner_request'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_owner_response'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['get_owner_response'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['confirm_set_channel'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['confirm_set_channel'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['confirm_set_radio'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['confirm_set_radio'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['exit_simulator'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['exit_simulator'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
|
|
||||||
_ADMINMESSAGE.fields_by_name['reboot_seconds'])
|
|
||||||
_ADMINMESSAGE.fields_by_name['reboot_seconds'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
|
|
||||||
DESCRIPTOR.message_types_by_name['AdminMessage'] = _ADMINMESSAGE
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
AdminMessage = _reflection.GeneratedProtocolMessageType('AdminMessage', (_message.Message,), {
|
AdminMessage = _reflection.GeneratedProtocolMessageType('AdminMessage', (_message.Message,), {
|
||||||
'DESCRIPTOR' : _ADMINMESSAGE,
|
'DESCRIPTOR' : _ADMINMESSAGE,
|
||||||
'__module__' : 'admin_pb2'
|
'__module__' : 'admin_pb2'
|
||||||
@@ -200,6 +30,10 @@ AdminMessage = _reflection.GeneratedProtocolMessageType('AdminMessage', (_messag
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(AdminMessage)
|
_sym_db.RegisterMessage(AdminMessage)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\013AdminProtosH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_ADMINMESSAGE._serialized_start=84
|
||||||
|
_ADMINMESSAGE._serialized_end=1627
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: apponly.proto
|
# source: apponly.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -14,52 +15,11 @@ _sym_db = _symbol_database.Default()
|
|||||||
from . import channel_pb2 as channel__pb2
|
from . import channel_pb2 as channel__pb2
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rapponly.proto\x1a\rchannel.proto\"0\n\nChannelSet\x12\"\n\x08settings\x18\x01 \x03(\x0b\x32\x10.ChannelSettingsBI\n\x13\x63om.geeksville.meshB\rAppOnlyProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='apponly.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\rAppOnlyProtosH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\rapponly.proto\x1a\rchannel.proto\"0\n\nChannelSet\x12\"\n\x08settings\x18\x01 \x03(\x0b\x32\x10.ChannelSettingsBI\n\x13\x63om.geeksville.meshB\rAppOnlyProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
,
|
|
||||||
dependencies=[channel__pb2.DESCRIPTOR,])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_CHANNELSET = DESCRIPTOR.message_types_by_name['ChannelSet']
|
||||||
_CHANNELSET = _descriptor.Descriptor(
|
|
||||||
name='ChannelSet',
|
|
||||||
full_name='ChannelSet',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='settings', full_name='ChannelSet.settings', index=0,
|
|
||||||
number=1, type=11, cpp_type=10, label=3,
|
|
||||||
has_default_value=False, default_value=[],
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=32,
|
|
||||||
serialized_end=80,
|
|
||||||
)
|
|
||||||
|
|
||||||
_CHANNELSET.fields_by_name['settings'].message_type = channel__pb2._CHANNELSETTINGS
|
|
||||||
DESCRIPTOR.message_types_by_name['ChannelSet'] = _CHANNELSET
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
ChannelSet = _reflection.GeneratedProtocolMessageType('ChannelSet', (_message.Message,), {
|
ChannelSet = _reflection.GeneratedProtocolMessageType('ChannelSet', (_message.Message,), {
|
||||||
'DESCRIPTOR' : _CHANNELSET,
|
'DESCRIPTOR' : _CHANNELSET,
|
||||||
'__module__' : 'apponly_pb2'
|
'__module__' : 'apponly_pb2'
|
||||||
@@ -67,6 +27,10 @@ ChannelSet = _reflection.GeneratedProtocolMessageType('ChannelSet', (_message.Me
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(ChannelSet)
|
_sym_db.RegisterMessage(ChannelSet)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\rAppOnlyProtosH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_CHANNELSET._serialized_start=32
|
||||||
|
_CHANNELSET._serialized_end=80
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
75
meshtastic/cannedmessages_pb2.py
Normal file
75
meshtastic/cannedmessages_pb2.py
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
# source: cannedmessages.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
|
from google.protobuf import message as _message
|
||||||
|
from google.protobuf import reflection as _reflection
|
||||||
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
|
# @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
|
_sym_db = _symbol_database.Default()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x63\x61nnedmessages.proto\"/\n\x1f\x43\x61nnedMessagePluginMessagePart1\x12\x0c\n\x04text\x18\x01 \x01(\t\"/\n\x1f\x43\x61nnedMessagePluginMessagePart2\x12\x0c\n\x04text\x18\x01 \x01(\t\"/\n\x1f\x43\x61nnedMessagePluginMessagePart3\x12\x0c\n\x04text\x18\x01 \x01(\t\"/\n\x1f\x43\x61nnedMessagePluginMessagePart4\x12\x0c\n\x04text\x18\x01 \x01(\t\"/\n\x1f\x43\x61nnedMessagePluginMessagePart5\x12\x0c\n\x04text\x18\x01 \x01(\tBU\n\x13\x63om.geeksville.meshB\x19\x43\x61nnedMessageConfigProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART1 = DESCRIPTOR.message_types_by_name['CannedMessagePluginMessagePart1']
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART2 = DESCRIPTOR.message_types_by_name['CannedMessagePluginMessagePart2']
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART3 = DESCRIPTOR.message_types_by_name['CannedMessagePluginMessagePart3']
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART4 = DESCRIPTOR.message_types_by_name['CannedMessagePluginMessagePart4']
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART5 = DESCRIPTOR.message_types_by_name['CannedMessagePluginMessagePart5']
|
||||||
|
CannedMessagePluginMessagePart1 = _reflection.GeneratedProtocolMessageType('CannedMessagePluginMessagePart1', (_message.Message,), {
|
||||||
|
'DESCRIPTOR' : _CANNEDMESSAGEPLUGINMESSAGEPART1,
|
||||||
|
'__module__' : 'cannedmessages_pb2'
|
||||||
|
# @@protoc_insertion_point(class_scope:CannedMessagePluginMessagePart1)
|
||||||
|
})
|
||||||
|
_sym_db.RegisterMessage(CannedMessagePluginMessagePart1)
|
||||||
|
|
||||||
|
CannedMessagePluginMessagePart2 = _reflection.GeneratedProtocolMessageType('CannedMessagePluginMessagePart2', (_message.Message,), {
|
||||||
|
'DESCRIPTOR' : _CANNEDMESSAGEPLUGINMESSAGEPART2,
|
||||||
|
'__module__' : 'cannedmessages_pb2'
|
||||||
|
# @@protoc_insertion_point(class_scope:CannedMessagePluginMessagePart2)
|
||||||
|
})
|
||||||
|
_sym_db.RegisterMessage(CannedMessagePluginMessagePart2)
|
||||||
|
|
||||||
|
CannedMessagePluginMessagePart3 = _reflection.GeneratedProtocolMessageType('CannedMessagePluginMessagePart3', (_message.Message,), {
|
||||||
|
'DESCRIPTOR' : _CANNEDMESSAGEPLUGINMESSAGEPART3,
|
||||||
|
'__module__' : 'cannedmessages_pb2'
|
||||||
|
# @@protoc_insertion_point(class_scope:CannedMessagePluginMessagePart3)
|
||||||
|
})
|
||||||
|
_sym_db.RegisterMessage(CannedMessagePluginMessagePart3)
|
||||||
|
|
||||||
|
CannedMessagePluginMessagePart4 = _reflection.GeneratedProtocolMessageType('CannedMessagePluginMessagePart4', (_message.Message,), {
|
||||||
|
'DESCRIPTOR' : _CANNEDMESSAGEPLUGINMESSAGEPART4,
|
||||||
|
'__module__' : 'cannedmessages_pb2'
|
||||||
|
# @@protoc_insertion_point(class_scope:CannedMessagePluginMessagePart4)
|
||||||
|
})
|
||||||
|
_sym_db.RegisterMessage(CannedMessagePluginMessagePart4)
|
||||||
|
|
||||||
|
CannedMessagePluginMessagePart5 = _reflection.GeneratedProtocolMessageType('CannedMessagePluginMessagePart5', (_message.Message,), {
|
||||||
|
'DESCRIPTOR' : _CANNEDMESSAGEPLUGINMESSAGEPART5,
|
||||||
|
'__module__' : 'cannedmessages_pb2'
|
||||||
|
# @@protoc_insertion_point(class_scope:CannedMessagePluginMessagePart5)
|
||||||
|
})
|
||||||
|
_sym_db.RegisterMessage(CannedMessagePluginMessagePart5)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\031CannedMessageConfigProtosH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART1._serialized_start=24
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART1._serialized_end=71
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART2._serialized_start=73
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART2._serialized_end=120
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART3._serialized_start=122
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART3._serialized_end=169
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART4._serialized_start=171
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART4._serialized_end=218
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART5._serialized_start=220
|
||||||
|
_CANNEDMESSAGEPLUGINMESSAGEPART5._serialized_end=267
|
||||||
|
# @@protoc_insertion_point(module_scope)
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: channel.proto
|
# source: channel.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -13,237 +14,14 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rchannel.proto\"\x91\x03\n\x0f\x43hannelSettings\x12\x10\n\x08tx_power\x18\x01 \x01(\x05\x12\x32\n\x0cmodem_config\x18\x03 \x01(\x0e\x32\x1c.ChannelSettings.ModemConfig\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x15\n\rspread_factor\x18\x07 \x01(\r\x12\x13\n\x0b\x63oding_rate\x18\x08 \x01(\r\x12\x13\n\x0b\x63hannel_num\x18\t \x01(\r\x12\x0b\n\x03psk\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\n\n\x02id\x18\n \x01(\x07\x12\x16\n\x0euplink_enabled\x18\x10 \x01(\x08\x12\x18\n\x10\x64ownlink_enabled\x18\x11 \x01(\x08\"\x8a\x01\n\x0bModemConfig\x12\x12\n\x0e\x42w125Cr45Sf128\x10\x00\x12\x12\n\x0e\x42w500Cr45Sf128\x10\x01\x12\x14\n\x10\x42w31_25Cr48Sf512\x10\x02\x12\x13\n\x0f\x42w125Cr48Sf4096\x10\x03\x12\x13\n\x0f\x42w250Cr46Sf2048\x10\x04\x12\x13\n\x0f\x42w250Cr47Sf1024\x10\x05\"\x8b\x01\n\x07\x43hannel\x12\r\n\x05index\x18\x01 \x01(\x05\x12\"\n\x08settings\x18\x02 \x01(\x0b\x32\x10.ChannelSettings\x12\x1b\n\x04role\x18\x03 \x01(\x0e\x32\r.Channel.Role\"0\n\x04Role\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02\x42I\n\x13\x63om.geeksville.meshB\rChannelProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='channel.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\rChannelProtosH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\rchannel.proto\"\x91\x03\n\x0f\x43hannelSettings\x12\x10\n\x08tx_power\x18\x01 \x01(\x05\x12\x32\n\x0cmodem_config\x18\x03 \x01(\x0e\x32\x1c.ChannelSettings.ModemConfig\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x15\n\rspread_factor\x18\x07 \x01(\r\x12\x13\n\x0b\x63oding_rate\x18\x08 \x01(\r\x12\x13\n\x0b\x63hannel_num\x18\t \x01(\r\x12\x0b\n\x03psk\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\n\n\x02id\x18\n \x01(\x07\x12\x16\n\x0euplink_enabled\x18\x10 \x01(\x08\x12\x18\n\x10\x64ownlink_enabled\x18\x11 \x01(\x08\"\x8a\x01\n\x0bModemConfig\x12\x12\n\x0e\x42w125Cr45Sf128\x10\x00\x12\x12\n\x0e\x42w500Cr45Sf128\x10\x01\x12\x14\n\x10\x42w31_25Cr48Sf512\x10\x02\x12\x13\n\x0f\x42w125Cr48Sf4096\x10\x03\x12\x13\n\x0f\x42w250Cr46Sf2048\x10\x04\x12\x13\n\x0f\x42w250Cr47Sf1024\x10\x05\"\x8b\x01\n\x07\x43hannel\x12\r\n\x05index\x18\x01 \x01(\x05\x12\"\n\x08settings\x18\x02 \x01(\x0b\x32\x10.ChannelSettings\x12\x1b\n\x04role\x18\x03 \x01(\x0e\x32\r.Channel.Role\"0\n\x04Role\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02\x42I\n\x13\x63om.geeksville.meshB\rChannelProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_CHANNELSETTINGS_MODEMCONFIG = _descriptor.EnumDescriptor(
|
_CHANNELSETTINGS = DESCRIPTOR.message_types_by_name['ChannelSettings']
|
||||||
name='ModemConfig',
|
_CHANNEL = DESCRIPTOR.message_types_by_name['Channel']
|
||||||
full_name='ChannelSettings.ModemConfig',
|
_CHANNELSETTINGS_MODEMCONFIG = _CHANNELSETTINGS.enum_types_by_name['ModemConfig']
|
||||||
filename=None,
|
_CHANNEL_ROLE = _CHANNEL.enum_types_by_name['Role']
|
||||||
file=DESCRIPTOR,
|
|
||||||
values=[
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='Bw125Cr45Sf128', index=0, number=0,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='Bw500Cr45Sf128', index=1, number=1,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='Bw31_25Cr48Sf512', index=2, number=2,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='Bw125Cr48Sf4096', index=3, number=3,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='Bw250Cr46Sf2048', index=4, number=4,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='Bw250Cr47Sf1024', index=5, number=5,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
],
|
|
||||||
containing_type=None,
|
|
||||||
serialized_options=None,
|
|
||||||
serialized_start=281,
|
|
||||||
serialized_end=419,
|
|
||||||
)
|
|
||||||
_sym_db.RegisterEnumDescriptor(_CHANNELSETTINGS_MODEMCONFIG)
|
|
||||||
|
|
||||||
_CHANNEL_ROLE = _descriptor.EnumDescriptor(
|
|
||||||
name='Role',
|
|
||||||
full_name='Channel.Role',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
values=[
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='DISABLED', index=0, number=0,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='PRIMARY', index=1, number=1,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='SECONDARY', index=2, number=2,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
],
|
|
||||||
containing_type=None,
|
|
||||||
serialized_options=None,
|
|
||||||
serialized_start=513,
|
|
||||||
serialized_end=561,
|
|
||||||
)
|
|
||||||
_sym_db.RegisterEnumDescriptor(_CHANNEL_ROLE)
|
|
||||||
|
|
||||||
|
|
||||||
_CHANNELSETTINGS = _descriptor.Descriptor(
|
|
||||||
name='ChannelSettings',
|
|
||||||
full_name='ChannelSettings',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='tx_power', full_name='ChannelSettings.tx_power', index=0,
|
|
||||||
number=1, type=5, cpp_type=1, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='modem_config', full_name='ChannelSettings.modem_config', index=1,
|
|
||||||
number=3, type=14, cpp_type=8, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='bandwidth', full_name='ChannelSettings.bandwidth', index=2,
|
|
||||||
number=6, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='spread_factor', full_name='ChannelSettings.spread_factor', index=3,
|
|
||||||
number=7, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='coding_rate', full_name='ChannelSettings.coding_rate', index=4,
|
|
||||||
number=8, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='channel_num', full_name='ChannelSettings.channel_num', index=5,
|
|
||||||
number=9, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='psk', full_name='ChannelSettings.psk', index=6,
|
|
||||||
number=4, type=12, cpp_type=9, label=1,
|
|
||||||
has_default_value=False, default_value=b"",
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='name', full_name='ChannelSettings.name', index=7,
|
|
||||||
number=5, type=9, cpp_type=9, label=1,
|
|
||||||
has_default_value=False, default_value=b"".decode('utf-8'),
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='id', full_name='ChannelSettings.id', index=8,
|
|
||||||
number=10, type=7, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='uplink_enabled', full_name='ChannelSettings.uplink_enabled', index=9,
|
|
||||||
number=16, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='downlink_enabled', full_name='ChannelSettings.downlink_enabled', index=10,
|
|
||||||
number=17, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
_CHANNELSETTINGS_MODEMCONFIG,
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=18,
|
|
||||||
serialized_end=419,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_CHANNEL = _descriptor.Descriptor(
|
|
||||||
name='Channel',
|
|
||||||
full_name='Channel',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='index', full_name='Channel.index', index=0,
|
|
||||||
number=1, type=5, cpp_type=1, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='settings', full_name='Channel.settings', index=1,
|
|
||||||
number=2, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='role', full_name='Channel.role', index=2,
|
|
||||||
number=3, type=14, cpp_type=8, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
_CHANNEL_ROLE,
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=422,
|
|
||||||
serialized_end=561,
|
|
||||||
)
|
|
||||||
|
|
||||||
_CHANNELSETTINGS.fields_by_name['modem_config'].enum_type = _CHANNELSETTINGS_MODEMCONFIG
|
|
||||||
_CHANNELSETTINGS_MODEMCONFIG.containing_type = _CHANNELSETTINGS
|
|
||||||
_CHANNEL.fields_by_name['settings'].message_type = _CHANNELSETTINGS
|
|
||||||
_CHANNEL.fields_by_name['role'].enum_type = _CHANNEL_ROLE
|
|
||||||
_CHANNEL_ROLE.containing_type = _CHANNEL
|
|
||||||
DESCRIPTOR.message_types_by_name['ChannelSettings'] = _CHANNELSETTINGS
|
|
||||||
DESCRIPTOR.message_types_by_name['Channel'] = _CHANNEL
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
ChannelSettings = _reflection.GeneratedProtocolMessageType('ChannelSettings', (_message.Message,), {
|
ChannelSettings = _reflection.GeneratedProtocolMessageType('ChannelSettings', (_message.Message,), {
|
||||||
'DESCRIPTOR' : _CHANNELSETTINGS,
|
'DESCRIPTOR' : _CHANNELSETTINGS,
|
||||||
'__module__' : 'channel_pb2'
|
'__module__' : 'channel_pb2'
|
||||||
@@ -258,6 +36,16 @@ Channel = _reflection.GeneratedProtocolMessageType('Channel', (_message.Message,
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(Channel)
|
_sym_db.RegisterMessage(Channel)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\rChannelProtosH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_CHANNELSETTINGS._serialized_start=18
|
||||||
|
_CHANNELSETTINGS._serialized_end=419
|
||||||
|
_CHANNELSETTINGS_MODEMCONFIG._serialized_start=281
|
||||||
|
_CHANNELSETTINGS_MODEMCONFIG._serialized_end=419
|
||||||
|
_CHANNEL._serialized_start=422
|
||||||
|
_CHANNEL._serialized_end=561
|
||||||
|
_CHANNEL_ROLE._serialized_start=513
|
||||||
|
_CHANNEL_ROLE._serialized_end=561
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: deviceonly.proto
|
# source: deviceonly.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -16,211 +17,14 @@ from . import mesh_pb2 as mesh__pb2
|
|||||||
from . import radioconfig_pb2 as radioconfig__pb2
|
from . import radioconfig_pb2 as radioconfig__pb2
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64\x65viceonly.proto\x1a\rchannel.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\"\x80\x01\n\x11LegacyRadioConfig\x12\x39\n\x0bpreferences\x18\x01 \x01(\x0b\x32$.LegacyRadioConfig.LegacyPreferences\x1a\x30\n\x11LegacyPreferences\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\"\xf0\x03\n\x0b\x44\x65viceState\x12\'\n\x0blegacyRadio\x18\x01 \x01(\x0b\x32\x12.LegacyRadioConfig\x12\x1c\n\x07my_node\x18\x02 \x01(\x0b\x32\x0b.MyNodeInfo\x12\x14\n\x05owner\x18\x03 \x01(\x0b\x32\x05.User\x12\x1a\n\x07node_db\x18\x04 \x03(\x0b\x32\t.NodeInfo\x12\"\n\rreceive_queue\x18\x05 \x03(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07version\x18\x08 \x01(\r\x12$\n\x0frx_text_message\x18\x07 \x01(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07no_save\x18\t \x01(\x08\x12\x15\n\rdid_gps_reset\x18\x0b \x01(\x08\x12+\n#canned_message_plugin_message_part1\x18\r \x01(\t\x12+\n#canned_message_plugin_message_part2\x18\x0e \x01(\t\x12+\n#canned_message_plugin_message_part3\x18\x0f \x01(\t\x12+\n#canned_message_plugin_message_part4\x18\x10 \x01(\t\x12+\n#canned_message_plugin_message_part5\x18\x11 \x01(\tJ\x04\x08\x0c\x10\r\")\n\x0b\x43hannelFile\x12\x1a\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x08.ChannelBF\n\x13\x63om.geeksville.meshB\nDeviceOnlyH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='deviceonly.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\nDeviceOnlyH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\x10\x64\x65viceonly.proto\x1a\rchannel.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\"\x80\x01\n\x11LegacyRadioConfig\x12\x39\n\x0bpreferences\x18\x01 \x01(\x0b\x32$.LegacyRadioConfig.LegacyPreferences\x1a\x30\n\x11LegacyPreferences\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\"\x8f\x02\n\x0b\x44\x65viceState\x12\'\n\x0blegacyRadio\x18\x01 \x01(\x0b\x32\x12.LegacyRadioConfig\x12\x1c\n\x07my_node\x18\x02 \x01(\x0b\x32\x0b.MyNodeInfo\x12\x14\n\x05owner\x18\x03 \x01(\x0b\x32\x05.User\x12\x1a\n\x07node_db\x18\x04 \x03(\x0b\x32\t.NodeInfo\x12\"\n\rreceive_queue\x18\x05 \x03(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07version\x18\x08 \x01(\r\x12$\n\x0frx_text_message\x18\x07 \x01(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07no_save\x18\t \x01(\x08\x12\x15\n\rdid_gps_reset\x18\x0b \x01(\x08J\x04\x08\x0c\x10\r\")\n\x0b\x43hannelFile\x12\x1a\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x08.ChannelBF\n\x13\x63om.geeksville.meshB\nDeviceOnlyH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
,
|
|
||||||
dependencies=[channel__pb2.DESCRIPTOR,mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_LEGACYRADIOCONFIG = DESCRIPTOR.message_types_by_name['LegacyRadioConfig']
|
||||||
_LEGACYRADIOCONFIG_LEGACYPREFERENCES = _descriptor.Descriptor(
|
_LEGACYRADIOCONFIG_LEGACYPREFERENCES = _LEGACYRADIOCONFIG.nested_types_by_name['LegacyPreferences']
|
||||||
name='LegacyPreferences',
|
_DEVICESTATE = DESCRIPTOR.message_types_by_name['DeviceState']
|
||||||
full_name='LegacyRadioConfig.LegacyPreferences',
|
_CHANNELFILE = DESCRIPTOR.message_types_by_name['ChannelFile']
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='region', full_name='LegacyRadioConfig.LegacyPreferences.region', index=0,
|
|
||||||
number=15, type=14, cpp_type=8, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=147,
|
|
||||||
serialized_end=195,
|
|
||||||
)
|
|
||||||
|
|
||||||
_LEGACYRADIOCONFIG = _descriptor.Descriptor(
|
|
||||||
name='LegacyRadioConfig',
|
|
||||||
full_name='LegacyRadioConfig',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='preferences', full_name='LegacyRadioConfig.preferences', index=0,
|
|
||||||
number=1, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[_LEGACYRADIOCONFIG_LEGACYPREFERENCES, ],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=67,
|
|
||||||
serialized_end=195,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_DEVICESTATE = _descriptor.Descriptor(
|
|
||||||
name='DeviceState',
|
|
||||||
full_name='DeviceState',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='legacyRadio', full_name='DeviceState.legacyRadio', index=0,
|
|
||||||
number=1, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='my_node', full_name='DeviceState.my_node', index=1,
|
|
||||||
number=2, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='owner', full_name='DeviceState.owner', index=2,
|
|
||||||
number=3, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='node_db', full_name='DeviceState.node_db', index=3,
|
|
||||||
number=4, type=11, cpp_type=10, label=3,
|
|
||||||
has_default_value=False, default_value=[],
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='receive_queue', full_name='DeviceState.receive_queue', index=4,
|
|
||||||
number=5, type=11, cpp_type=10, label=3,
|
|
||||||
has_default_value=False, default_value=[],
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='version', full_name='DeviceState.version', index=5,
|
|
||||||
number=8, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='rx_text_message', full_name='DeviceState.rx_text_message', index=6,
|
|
||||||
number=7, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='no_save', full_name='DeviceState.no_save', index=7,
|
|
||||||
number=9, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='did_gps_reset', full_name='DeviceState.did_gps_reset', index=8,
|
|
||||||
number=11, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=198,
|
|
||||||
serialized_end=469,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
_CHANNELFILE = _descriptor.Descriptor(
|
|
||||||
name='ChannelFile',
|
|
||||||
full_name='ChannelFile',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='channels', full_name='ChannelFile.channels', index=0,
|
|
||||||
number=1, type=11, cpp_type=10, label=3,
|
|
||||||
has_default_value=False, default_value=[],
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=471,
|
|
||||||
serialized_end=512,
|
|
||||||
)
|
|
||||||
|
|
||||||
_LEGACYRADIOCONFIG_LEGACYPREFERENCES.fields_by_name['region'].enum_type = radioconfig__pb2._REGIONCODE
|
|
||||||
_LEGACYRADIOCONFIG_LEGACYPREFERENCES.containing_type = _LEGACYRADIOCONFIG
|
|
||||||
_LEGACYRADIOCONFIG.fields_by_name['preferences'].message_type = _LEGACYRADIOCONFIG_LEGACYPREFERENCES
|
|
||||||
_DEVICESTATE.fields_by_name['legacyRadio'].message_type = _LEGACYRADIOCONFIG
|
|
||||||
_DEVICESTATE.fields_by_name['my_node'].message_type = mesh__pb2._MYNODEINFO
|
|
||||||
_DEVICESTATE.fields_by_name['owner'].message_type = mesh__pb2._USER
|
|
||||||
_DEVICESTATE.fields_by_name['node_db'].message_type = mesh__pb2._NODEINFO
|
|
||||||
_DEVICESTATE.fields_by_name['receive_queue'].message_type = mesh__pb2._MESHPACKET
|
|
||||||
_DEVICESTATE.fields_by_name['rx_text_message'].message_type = mesh__pb2._MESHPACKET
|
|
||||||
_CHANNELFILE.fields_by_name['channels'].message_type = channel__pb2._CHANNEL
|
|
||||||
DESCRIPTOR.message_types_by_name['LegacyRadioConfig'] = _LEGACYRADIOCONFIG
|
|
||||||
DESCRIPTOR.message_types_by_name['DeviceState'] = _DEVICESTATE
|
|
||||||
DESCRIPTOR.message_types_by_name['ChannelFile'] = _CHANNELFILE
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
LegacyRadioConfig = _reflection.GeneratedProtocolMessageType('LegacyRadioConfig', (_message.Message,), {
|
LegacyRadioConfig = _reflection.GeneratedProtocolMessageType('LegacyRadioConfig', (_message.Message,), {
|
||||||
|
|
||||||
'LegacyPreferences' : _reflection.GeneratedProtocolMessageType('LegacyPreferences', (_message.Message,), {
|
'LegacyPreferences' : _reflection.GeneratedProtocolMessageType('LegacyPreferences', (_message.Message,), {
|
||||||
@@ -250,6 +54,16 @@ ChannelFile = _reflection.GeneratedProtocolMessageType('ChannelFile', (_message.
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(ChannelFile)
|
_sym_db.RegisterMessage(ChannelFile)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\nDeviceOnlyH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_LEGACYRADIOCONFIG._serialized_start=67
|
||||||
|
_LEGACYRADIOCONFIG._serialized_end=195
|
||||||
|
_LEGACYRADIOCONFIG_LEGACYPREFERENCES._serialized_start=147
|
||||||
|
_LEGACYRADIOCONFIG_LEGACYPREFERENCES._serialized_end=195
|
||||||
|
_DEVICESTATE._serialized_start=198
|
||||||
|
_DEVICESTATE._serialized_end=694
|
||||||
|
_CHANNELFILE._serialized_start=696
|
||||||
|
_CHANNELFILE._serialized_end=737
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: environmental_measurement.proto
|
# source: environmental_measurement.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -13,64 +14,11 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x65nvironmental_measurement.proto\"g\n\x18\x45nvironmentalMeasurement\x12\x13\n\x0btemperature\x18\x01 \x01(\x02\x12\x19\n\x11relative_humidity\x18\x02 \x01(\x02\x12\x1b\n\x13\x62\x61rometric_pressure\x18\x03 \x01(\x02\x42#Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='environmental_measurement.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\x1f\x65nvironmental_measurement.proto\"g\n\x18\x45nvironmentalMeasurement\x12\x13\n\x0btemperature\x18\x01 \x01(\x02\x12\x19\n\x11relative_humidity\x18\x02 \x01(\x02\x12\x1b\n\x13\x62\x61rometric_pressure\x18\x03 \x01(\x02\x42#Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_ENVIRONMENTALMEASUREMENT = DESCRIPTOR.message_types_by_name['EnvironmentalMeasurement']
|
||||||
_ENVIRONMENTALMEASUREMENT = _descriptor.Descriptor(
|
|
||||||
name='EnvironmentalMeasurement',
|
|
||||||
full_name='EnvironmentalMeasurement',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='temperature', full_name='EnvironmentalMeasurement.temperature', index=0,
|
|
||||||
number=1, type=2, cpp_type=6, label=1,
|
|
||||||
has_default_value=False, default_value=float(0),
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='relative_humidity', full_name='EnvironmentalMeasurement.relative_humidity', index=1,
|
|
||||||
number=2, type=2, cpp_type=6, label=1,
|
|
||||||
has_default_value=False, default_value=float(0),
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='barometric_pressure', full_name='EnvironmentalMeasurement.barometric_pressure', index=2,
|
|
||||||
number=3, type=2, cpp_type=6, label=1,
|
|
||||||
has_default_value=False, default_value=float(0),
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=35,
|
|
||||||
serialized_end=138,
|
|
||||||
)
|
|
||||||
|
|
||||||
DESCRIPTOR.message_types_by_name['EnvironmentalMeasurement'] = _ENVIRONMENTALMEASUREMENT
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
EnvironmentalMeasurement = _reflection.GeneratedProtocolMessageType('EnvironmentalMeasurement', (_message.Message,), {
|
EnvironmentalMeasurement = _reflection.GeneratedProtocolMessageType('EnvironmentalMeasurement', (_message.Message,), {
|
||||||
'DESCRIPTOR' : _ENVIRONMENTALMEASUREMENT,
|
'DESCRIPTOR' : _ENVIRONMENTALMEASUREMENT,
|
||||||
'__module__' : 'environmental_measurement_pb2'
|
'__module__' : 'environmental_measurement_pb2'
|
||||||
@@ -78,6 +26,10 @@ EnvironmentalMeasurement = _reflection.GeneratedProtocolMessageType('Environment
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(EnvironmentalMeasurement)
|
_sym_db.RegisterMessage(EnvironmentalMeasurement)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_ENVIRONMENTALMEASUREMENT._serialized_start=35
|
||||||
|
_ENVIRONMENTALMEASUREMENT._serialized_end=138
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: mqtt.proto
|
# source: mqtt.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -14,66 +15,11 @@ _sym_db = _symbol_database.Default()
|
|||||||
from . import mesh_pb2 as mesh__pb2
|
from . import mesh_pb2 as mesh__pb2
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nmqtt.proto\x1a\nmesh.proto\"V\n\x0fServiceEnvelope\x12\x1b\n\x06packet\x18\x01 \x01(\x0b\x32\x0b.MeshPacket\x12\x12\n\nchannel_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\tBF\n\x13\x63om.geeksville.meshB\nMQTTProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='mqtt.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\nMQTTProtosH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\nmqtt.proto\x1a\nmesh.proto\"V\n\x0fServiceEnvelope\x12\x1b\n\x06packet\x18\x01 \x01(\x0b\x32\x0b.MeshPacket\x12\x12\n\nchannel_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\tBF\n\x13\x63om.geeksville.meshB\nMQTTProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
,
|
|
||||||
dependencies=[mesh__pb2.DESCRIPTOR,])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_SERVICEENVELOPE = DESCRIPTOR.message_types_by_name['ServiceEnvelope']
|
||||||
_SERVICEENVELOPE = _descriptor.Descriptor(
|
|
||||||
name='ServiceEnvelope',
|
|
||||||
full_name='ServiceEnvelope',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='packet', full_name='ServiceEnvelope.packet', index=0,
|
|
||||||
number=1, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='channel_id', full_name='ServiceEnvelope.channel_id', index=1,
|
|
||||||
number=2, type=9, cpp_type=9, label=1,
|
|
||||||
has_default_value=False, default_value=b"".decode('utf-8'),
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='gateway_id', full_name='ServiceEnvelope.gateway_id', index=2,
|
|
||||||
number=3, type=9, cpp_type=9, label=1,
|
|
||||||
has_default_value=False, default_value=b"".decode('utf-8'),
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=26,
|
|
||||||
serialized_end=112,
|
|
||||||
)
|
|
||||||
|
|
||||||
_SERVICEENVELOPE.fields_by_name['packet'].message_type = mesh__pb2._MESHPACKET
|
|
||||||
DESCRIPTOR.message_types_by_name['ServiceEnvelope'] = _SERVICEENVELOPE
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
ServiceEnvelope = _reflection.GeneratedProtocolMessageType('ServiceEnvelope', (_message.Message,), {
|
ServiceEnvelope = _reflection.GeneratedProtocolMessageType('ServiceEnvelope', (_message.Message,), {
|
||||||
'DESCRIPTOR' : _SERVICEENVELOPE,
|
'DESCRIPTOR' : _SERVICEENVELOPE,
|
||||||
'__module__' : 'mqtt_pb2'
|
'__module__' : 'mqtt_pb2'
|
||||||
@@ -81,6 +27,10 @@ ServiceEnvelope = _reflection.GeneratedProtocolMessageType('ServiceEnvelope', (_
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(ServiceEnvelope)
|
_sym_db.RegisterMessage(ServiceEnvelope)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\nMQTTProtosH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_SERVICEENVELOPE._serialized_start=26
|
||||||
|
_SERVICEENVELOPE._serialized_end=112
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
@@ -285,6 +285,14 @@ class Node:
|
|||||||
|
|
||||||
return self._sendAdmin(p)
|
return self._sendAdmin(p)
|
||||||
|
|
||||||
|
def shutdown(self, secs: int = 10):
|
||||||
|
"""Tell the node to shutdown."""
|
||||||
|
p = admin_pb2.AdminMessage()
|
||||||
|
p.shutdown_seconds = secs
|
||||||
|
logging.info(f"Telling node to shutdown in {secs} seconds")
|
||||||
|
|
||||||
|
return self._sendAdmin(p)
|
||||||
|
|
||||||
def _fixupChannels(self):
|
def _fixupChannels(self):
|
||||||
"""Fixup indexes and add disabled channels as needed"""
|
"""Fixup indexes and add disabled channels as needed"""
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: portnums.proto
|
# source: portnums.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf.internal import enum_type_wrapper
|
from google.protobuf.internal import enum_type_wrapper
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -14,96 +15,9 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eportnums.proto*\xcb\x02\n\x07PortNum\x12\x0f\n\x0bUNKNOWN_APP\x10\x00\x12\x14\n\x10TEXT_MESSAGE_APP\x10\x01\x12\x17\n\x13REMOTE_HARDWARE_APP\x10\x02\x12\x10\n\x0cPOSITION_APP\x10\x03\x12\x10\n\x0cNODEINFO_APP\x10\x04\x12\x0f\n\x0bROUTING_APP\x10\x05\x12\r\n\tADMIN_APP\x10\x06\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12\x0e\n\nSERIAL_APP\x10@\x12\x15\n\x11STORE_FORWARD_APP\x10\x41\x12\x12\n\x0eRANGE_TEST_APP\x10\x42\x12!\n\x1d\x45NVIRONMENTAL_MEASUREMENT_APP\x10\x43\x12\x0b\n\x07ZPS_APP\x10\x44\x12\x10\n\x0bPRIVATE_APP\x10\x80\x02\x12\x13\n\x0e\x41TAK_FORWARDER\x10\x81\x02\x12\x08\n\x03MAX\x10\xff\x03\x42\x44\n\x13\x63om.geeksville.meshB\x08PortnumsH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='portnums.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\010PortnumsH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\x0eportnums.proto*\xcb\x02\n\x07PortNum\x12\x0f\n\x0bUNKNOWN_APP\x10\x00\x12\x14\n\x10TEXT_MESSAGE_APP\x10\x01\x12\x17\n\x13REMOTE_HARDWARE_APP\x10\x02\x12\x10\n\x0cPOSITION_APP\x10\x03\x12\x10\n\x0cNODEINFO_APP\x10\x04\x12\x0f\n\x0bROUTING_APP\x10\x05\x12\r\n\tADMIN_APP\x10\x06\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12\x0e\n\nSERIAL_APP\x10@\x12\x15\n\x11STORE_FORWARD_APP\x10\x41\x12\x12\n\x0eRANGE_TEST_APP\x10\x42\x12!\n\x1d\x45NVIRONMENTAL_MEASUREMENT_APP\x10\x43\x12\x0b\n\x07ZPS_APP\x10\x44\x12\x10\n\x0bPRIVATE_APP\x10\x80\x02\x12\x13\n\x0e\x41TAK_FORWARDER\x10\x81\x02\x12\x08\n\x03MAX\x10\xff\x03\x42\x44\n\x13\x63om.geeksville.meshB\x08PortnumsH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
)
|
|
||||||
|
|
||||||
_PORTNUM = _descriptor.EnumDescriptor(
|
|
||||||
name='PortNum',
|
|
||||||
full_name='PortNum',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
values=[
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='UNKNOWN_APP', index=0, number=0,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='TEXT_MESSAGE_APP', index=1, number=1,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='REMOTE_HARDWARE_APP', index=2, number=2,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='POSITION_APP', index=3, number=3,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='NODEINFO_APP', index=4, number=4,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTING_APP', index=5, number=5,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ADMIN_APP', index=6, number=6,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='REPLY_APP', index=7, number=32,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='IP_TUNNEL_APP', index=8, number=33,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='SERIAL_APP', index=9, number=64,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='STORE_FORWARD_APP', index=10, number=65,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='RANGE_TEST_APP', index=11, number=66,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ENVIRONMENTAL_MEASUREMENT_APP', index=12, number=67,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ZPS_APP', index=13, number=68,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='PRIVATE_APP', index=14, number=256,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ATAK_FORWARDER', index=15, number=257,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='MAX', index=16, number=511,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
],
|
|
||||||
containing_type=None,
|
|
||||||
serialized_options=None,
|
|
||||||
serialized_start=19,
|
|
||||||
serialized_end=350,
|
|
||||||
)
|
|
||||||
_sym_db.RegisterEnumDescriptor(_PORTNUM)
|
|
||||||
|
|
||||||
|
_PORTNUM = DESCRIPTOR.enum_types_by_name['PortNum']
|
||||||
PortNum = enum_type_wrapper.EnumTypeWrapper(_PORTNUM)
|
PortNum = enum_type_wrapper.EnumTypeWrapper(_PORTNUM)
|
||||||
UNKNOWN_APP = 0
|
UNKNOWN_APP = 0
|
||||||
TEXT_MESSAGE_APP = 1
|
TEXT_MESSAGE_APP = 1
|
||||||
@@ -124,9 +38,10 @@ ATAK_FORWARDER = 257
|
|||||||
MAX = 511
|
MAX = 511
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR.enum_types_by_name['PortNum'] = _PORTNUM
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
|
DESCRIPTOR._options = None
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\010PortnumsH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_PORTNUM._serialized_start=19
|
||||||
|
_PORTNUM._serialized_end=350
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -10,8 +10,17 @@ def onGPIOreceive(packet, interface):
|
|||||||
"""Callback for received GPIO responses
|
"""Callback for received GPIO responses
|
||||||
"""
|
"""
|
||||||
logging.debug(f"packet:{packet} interface:{interface}")
|
logging.debug(f"packet:{packet} interface:{interface}")
|
||||||
|
gpioValue = 0
|
||||||
hw = packet["decoded"]["remotehw"]
|
hw = packet["decoded"]["remotehw"]
|
||||||
gpioValue = hw["gpioValue"]
|
if "gpioValue" in hw:
|
||||||
|
gpioValue = hw["gpioValue"]
|
||||||
|
else:
|
||||||
|
if not "gpioMask" in hw:
|
||||||
|
# we did get a reply, but due to protobufs, 0 for numeric value is not sent
|
||||||
|
# see https://developers.google.com/protocol-buffers/docs/proto3#default
|
||||||
|
# so, we set it here
|
||||||
|
gpioValue = 0
|
||||||
|
|
||||||
#print(f'mask:{interface.mask}')
|
#print(f'mask:{interface.mask}')
|
||||||
value = int(gpioValue) & int(interface.mask)
|
value = int(gpioValue) & int(interface.mask)
|
||||||
print(f'Received RemoteHardware typ={hw["typ"]}, gpio_value={gpioValue} value={value}')
|
print(f'Received RemoteHardware typ={hw["typ"]}, gpio_value={gpioValue} value={value}')
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: remote_hardware.proto
|
# source: remote_hardware.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -13,105 +14,12 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15remote_hardware.proto\"\xca\x01\n\x0fHardwareMessage\x12\"\n\x03typ\x18\x01 \x01(\x0e\x32\x15.HardwareMessage.Type\x12\x11\n\tgpio_mask\x18\x02 \x01(\x04\x12\x12\n\ngpio_value\x18\x03 \x01(\x04\"l\n\x04Type\x12\t\n\x05UNSET\x10\x00\x12\x0f\n\x0bWRITE_GPIOS\x10\x01\x12\x0f\n\x0bWATCH_GPIOS\x10\x02\x12\x11\n\rGPIOS_CHANGED\x10\x03\x12\x0e\n\nREAD_GPIOS\x10\x04\x12\x14\n\x10READ_GPIOS_REPLY\x10\x05\x42J\n\x13\x63om.geeksville.meshB\x0eRemoteHardwareH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='remote_hardware.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\016RemoteHardwareH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\x15remote_hardware.proto\"\xca\x01\n\x0fHardwareMessage\x12\"\n\x03typ\x18\x01 \x01(\x0e\x32\x15.HardwareMessage.Type\x12\x11\n\tgpio_mask\x18\x02 \x01(\x04\x12\x12\n\ngpio_value\x18\x03 \x01(\x04\"l\n\x04Type\x12\t\n\x05UNSET\x10\x00\x12\x0f\n\x0bWRITE_GPIOS\x10\x01\x12\x0f\n\x0bWATCH_GPIOS\x10\x02\x12\x11\n\rGPIOS_CHANGED\x10\x03\x12\x0e\n\nREAD_GPIOS\x10\x04\x12\x14\n\x10READ_GPIOS_REPLY\x10\x05\x42J\n\x13\x63om.geeksville.meshB\x0eRemoteHardwareH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_HARDWAREMESSAGE_TYPE = _descriptor.EnumDescriptor(
|
_HARDWAREMESSAGE = DESCRIPTOR.message_types_by_name['HardwareMessage']
|
||||||
name='Type',
|
_HARDWAREMESSAGE_TYPE = _HARDWAREMESSAGE.enum_types_by_name['Type']
|
||||||
full_name='HardwareMessage.Type',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
values=[
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='UNSET', index=0, number=0,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='WRITE_GPIOS', index=1, number=1,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='WATCH_GPIOS', index=2, number=2,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='GPIOS_CHANGED', index=3, number=3,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='READ_GPIOS', index=4, number=4,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='READ_GPIOS_REPLY', index=5, number=5,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
],
|
|
||||||
containing_type=None,
|
|
||||||
serialized_options=None,
|
|
||||||
serialized_start=120,
|
|
||||||
serialized_end=228,
|
|
||||||
)
|
|
||||||
_sym_db.RegisterEnumDescriptor(_HARDWAREMESSAGE_TYPE)
|
|
||||||
|
|
||||||
|
|
||||||
_HARDWAREMESSAGE = _descriptor.Descriptor(
|
|
||||||
name='HardwareMessage',
|
|
||||||
full_name='HardwareMessage',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='typ', full_name='HardwareMessage.typ', index=0,
|
|
||||||
number=1, type=14, cpp_type=8, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='gpio_mask', full_name='HardwareMessage.gpio_mask', index=1,
|
|
||||||
number=2, type=4, cpp_type=4, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='gpio_value', full_name='HardwareMessage.gpio_value', index=2,
|
|
||||||
number=3, type=4, cpp_type=4, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
_HARDWAREMESSAGE_TYPE,
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=26,
|
|
||||||
serialized_end=228,
|
|
||||||
)
|
|
||||||
|
|
||||||
_HARDWAREMESSAGE.fields_by_name['typ'].enum_type = _HARDWAREMESSAGE_TYPE
|
|
||||||
_HARDWAREMESSAGE_TYPE.containing_type = _HARDWAREMESSAGE
|
|
||||||
DESCRIPTOR.message_types_by_name['HardwareMessage'] = _HARDWAREMESSAGE
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
HardwareMessage = _reflection.GeneratedProtocolMessageType('HardwareMessage', (_message.Message,), {
|
HardwareMessage = _reflection.GeneratedProtocolMessageType('HardwareMessage', (_message.Message,), {
|
||||||
'DESCRIPTOR' : _HARDWAREMESSAGE,
|
'DESCRIPTOR' : _HARDWAREMESSAGE,
|
||||||
'__module__' : 'remote_hardware_pb2'
|
'__module__' : 'remote_hardware_pb2'
|
||||||
@@ -119,6 +27,12 @@ HardwareMessage = _reflection.GeneratedProtocolMessageType('HardwareMessage', (_
|
|||||||
})
|
})
|
||||||
_sym_db.RegisterMessage(HardwareMessage)
|
_sym_db.RegisterMessage(HardwareMessage)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\016RemoteHardwareH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_HARDWAREMESSAGE._serialized_start=26
|
||||||
|
_HARDWAREMESSAGE._serialized_end=228
|
||||||
|
_HARDWAREMESSAGE_TYPE._serialized_start=120
|
||||||
|
_HARDWAREMESSAGE_TYPE._serialized_end=228
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# source: storeforward.proto
|
# source: storeforward.proto
|
||||||
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import message as _message
|
from google.protobuf import message as _message
|
||||||
from google.protobuf import reflection as _reflection
|
from google.protobuf import reflection as _reflection
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
@@ -13,313 +14,15 @@ _sym_db = _symbol_database.Default()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12storeforward.proto\"\x8a\x06\n\x0fStoreAndForward\x12,\n\x02rr\x18\x01 \x01(\x0e\x32 .StoreAndForward.RequestResponse\x12*\n\x05stats\x18\x02 \x01(\x0b\x32\x1b.StoreAndForward.Statistics\x12)\n\x07history\x18\x03 \x01(\x0b\x32\x18.StoreAndForward.History\x12-\n\theartbeat\x18\x04 \x01(\x0b\x32\x1a.StoreAndForward.Heartbeat\x1a\xcd\x01\n\nStatistics\x12\x16\n\x0emessages_total\x18\x01 \x01(\r\x12\x16\n\x0emessages_saved\x18\x02 \x01(\r\x12\x14\n\x0cmessages_max\x18\x03 \x01(\r\x12\x0f\n\x07up_time\x18\x04 \x01(\r\x12\x10\n\x08requests\x18\x05 \x01(\r\x12\x18\n\x10requests_history\x18\x06 \x01(\r\x12\x11\n\theartbeat\x18\x07 \x01(\x08\x12\x12\n\nreturn_max\x18\x08 \x01(\r\x12\x15\n\rreturn_window\x18\t \x01(\r\x1aI\n\x07History\x12\x18\n\x10history_messages\x18\x01 \x01(\r\x12\x0e\n\x06window\x18\x02 \x01(\r\x12\x14\n\x0clast_request\x18\x03 \x01(\r\x1a.\n\tHeartbeat\x12\x0e\n\x06period\x18\x01 \x01(\r\x12\x11\n\tsecondary\x18\x02 \x01(\r\"\xf7\x01\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x12\n\x0eROUTER_HISTORY\x10\x06\x12\x10\n\x0c\x43LIENT_ERROR\x10\x65\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x66\x12\x10\n\x0c\x43LIENT_STATS\x10g\x12\x0f\n\x0b\x43LIENT_PING\x10h\x12\x0f\n\x0b\x43LIENT_PONG\x10i\x12\x10\n\x0c\x43LIENT_ABORT\x10jBQ\n\x13\x63om.geeksville.meshB\x15StoreAndForwardProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3')
|
||||||
name='storeforward.proto',
|
|
||||||
package='',
|
|
||||||
syntax='proto3',
|
|
||||||
serialized_options=b'\n\023com.geeksville.meshB\025StoreAndForwardProtosH\003Z!github.com/meshtastic/gomeshproto',
|
|
||||||
serialized_pb=b'\n\x12storeforward.proto\"\x8a\x06\n\x0fStoreAndForward\x12,\n\x02rr\x18\x01 \x01(\x0e\x32 .StoreAndForward.RequestResponse\x12*\n\x05stats\x18\x02 \x01(\x0b\x32\x1b.StoreAndForward.Statistics\x12)\n\x07history\x18\x03 \x01(\x0b\x32\x18.StoreAndForward.History\x12-\n\theartbeat\x18\x04 \x01(\x0b\x32\x1a.StoreAndForward.Heartbeat\x1a\xcd\x01\n\nStatistics\x12\x16\n\x0emessages_total\x18\x01 \x01(\r\x12\x16\n\x0emessages_saved\x18\x02 \x01(\r\x12\x14\n\x0cmessages_max\x18\x03 \x01(\r\x12\x0f\n\x07up_time\x18\x04 \x01(\r\x12\x10\n\x08requests\x18\x05 \x01(\r\x12\x18\n\x10requests_history\x18\x06 \x01(\r\x12\x11\n\theartbeat\x18\x07 \x01(\x08\x12\x12\n\nreturn_max\x18\x08 \x01(\r\x12\x15\n\rreturn_window\x18\t \x01(\r\x1aI\n\x07History\x12\x18\n\x10history_messages\x18\x01 \x01(\r\x12\x0e\n\x06window\x18\x02 \x01(\r\x12\x14\n\x0clast_request\x18\x03 \x01(\r\x1a.\n\tHeartbeat\x12\x0e\n\x06period\x18\x01 \x01(\r\x12\x11\n\tsecondary\x18\x02 \x01(\r\"\xf7\x01\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x12\n\x0eROUTER_HISTORY\x10\x06\x12\x10\n\x0c\x43LIENT_ERROR\x10\x65\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x66\x12\x10\n\x0c\x43LIENT_STATS\x10g\x12\x0f\n\x0b\x43LIENT_PING\x10h\x12\x0f\n\x0b\x43LIENT_PONG\x10i\x12\x10\n\x0c\x43LIENT_ABORT\x10jBQ\n\x13\x63om.geeksville.meshB\x15StoreAndForwardProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_STOREANDFORWARD_REQUESTRESPONSE = _descriptor.EnumDescriptor(
|
_STOREANDFORWARD = DESCRIPTOR.message_types_by_name['StoreAndForward']
|
||||||
name='RequestResponse',
|
_STOREANDFORWARD_STATISTICS = _STOREANDFORWARD.nested_types_by_name['Statistics']
|
||||||
full_name='StoreAndForward.RequestResponse',
|
_STOREANDFORWARD_HISTORY = _STOREANDFORWARD.nested_types_by_name['History']
|
||||||
filename=None,
|
_STOREANDFORWARD_HEARTBEAT = _STOREANDFORWARD.nested_types_by_name['Heartbeat']
|
||||||
file=DESCRIPTOR,
|
_STOREANDFORWARD_REQUESTRESPONSE = _STOREANDFORWARD.enum_types_by_name['RequestResponse']
|
||||||
values=[
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='UNSET', index=0, number=0,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTER_ERROR', index=1, number=1,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTER_HEARTBEAT', index=2, number=2,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTER_PING', index=3, number=3,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTER_PONG', index=4, number=4,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTER_BUSY', index=5, number=5,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='ROUTER_HISTORY', index=6, number=6,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='CLIENT_ERROR', index=7, number=101,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='CLIENT_HISTORY', index=8, number=102,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='CLIENT_STATS', index=9, number=103,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='CLIENT_PING', index=10, number=104,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='CLIENT_PONG', index=11, number=105,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
_descriptor.EnumValueDescriptor(
|
|
||||||
name='CLIENT_ABORT', index=12, number=106,
|
|
||||||
serialized_options=None,
|
|
||||||
type=None),
|
|
||||||
],
|
|
||||||
containing_type=None,
|
|
||||||
serialized_options=None,
|
|
||||||
serialized_start=554,
|
|
||||||
serialized_end=801,
|
|
||||||
)
|
|
||||||
_sym_db.RegisterEnumDescriptor(_STOREANDFORWARD_REQUESTRESPONSE)
|
|
||||||
|
|
||||||
|
|
||||||
_STOREANDFORWARD_STATISTICS = _descriptor.Descriptor(
|
|
||||||
name='Statistics',
|
|
||||||
full_name='StoreAndForward.Statistics',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='messages_total', full_name='StoreAndForward.Statistics.messages_total', index=0,
|
|
||||||
number=1, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='messages_saved', full_name='StoreAndForward.Statistics.messages_saved', index=1,
|
|
||||||
number=2, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='messages_max', full_name='StoreAndForward.Statistics.messages_max', index=2,
|
|
||||||
number=3, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='up_time', full_name='StoreAndForward.Statistics.up_time', index=3,
|
|
||||||
number=4, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='requests', full_name='StoreAndForward.Statistics.requests', index=4,
|
|
||||||
number=5, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='requests_history', full_name='StoreAndForward.Statistics.requests_history', index=5,
|
|
||||||
number=6, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='heartbeat', full_name='StoreAndForward.Statistics.heartbeat', index=6,
|
|
||||||
number=7, type=8, cpp_type=7, label=1,
|
|
||||||
has_default_value=False, default_value=False,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='return_max', full_name='StoreAndForward.Statistics.return_max', index=7,
|
|
||||||
number=8, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='return_window', full_name='StoreAndForward.Statistics.return_window', index=8,
|
|
||||||
number=9, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=223,
|
|
||||||
serialized_end=428,
|
|
||||||
)
|
|
||||||
|
|
||||||
_STOREANDFORWARD_HISTORY = _descriptor.Descriptor(
|
|
||||||
name='History',
|
|
||||||
full_name='StoreAndForward.History',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='history_messages', full_name='StoreAndForward.History.history_messages', index=0,
|
|
||||||
number=1, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='window', full_name='StoreAndForward.History.window', index=1,
|
|
||||||
number=2, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='last_request', full_name='StoreAndForward.History.last_request', index=2,
|
|
||||||
number=3, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=430,
|
|
||||||
serialized_end=503,
|
|
||||||
)
|
|
||||||
|
|
||||||
_STOREANDFORWARD_HEARTBEAT = _descriptor.Descriptor(
|
|
||||||
name='Heartbeat',
|
|
||||||
full_name='StoreAndForward.Heartbeat',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='period', full_name='StoreAndForward.Heartbeat.period', index=0,
|
|
||||||
number=1, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='secondary', full_name='StoreAndForward.Heartbeat.secondary', index=1,
|
|
||||||
number=2, type=13, cpp_type=3, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[],
|
|
||||||
enum_types=[
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=505,
|
|
||||||
serialized_end=551,
|
|
||||||
)
|
|
||||||
|
|
||||||
_STOREANDFORWARD = _descriptor.Descriptor(
|
|
||||||
name='StoreAndForward',
|
|
||||||
full_name='StoreAndForward',
|
|
||||||
filename=None,
|
|
||||||
file=DESCRIPTOR,
|
|
||||||
containing_type=None,
|
|
||||||
fields=[
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='rr', full_name='StoreAndForward.rr', index=0,
|
|
||||||
number=1, type=14, cpp_type=8, label=1,
|
|
||||||
has_default_value=False, default_value=0,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='stats', full_name='StoreAndForward.stats', index=1,
|
|
||||||
number=2, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='history', full_name='StoreAndForward.history', index=2,
|
|
||||||
number=3, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
_descriptor.FieldDescriptor(
|
|
||||||
name='heartbeat', full_name='StoreAndForward.heartbeat', index=3,
|
|
||||||
number=4, type=11, cpp_type=10, label=1,
|
|
||||||
has_default_value=False, default_value=None,
|
|
||||||
message_type=None, enum_type=None, containing_type=None,
|
|
||||||
is_extension=False, extension_scope=None,
|
|
||||||
serialized_options=None, file=DESCRIPTOR),
|
|
||||||
],
|
|
||||||
extensions=[
|
|
||||||
],
|
|
||||||
nested_types=[_STOREANDFORWARD_STATISTICS, _STOREANDFORWARD_HISTORY, _STOREANDFORWARD_HEARTBEAT, ],
|
|
||||||
enum_types=[
|
|
||||||
_STOREANDFORWARD_REQUESTRESPONSE,
|
|
||||||
],
|
|
||||||
serialized_options=None,
|
|
||||||
is_extendable=False,
|
|
||||||
syntax='proto3',
|
|
||||||
extension_ranges=[],
|
|
||||||
oneofs=[
|
|
||||||
],
|
|
||||||
serialized_start=23,
|
|
||||||
serialized_end=801,
|
|
||||||
)
|
|
||||||
|
|
||||||
_STOREANDFORWARD_STATISTICS.containing_type = _STOREANDFORWARD
|
|
||||||
_STOREANDFORWARD_HISTORY.containing_type = _STOREANDFORWARD
|
|
||||||
_STOREANDFORWARD_HEARTBEAT.containing_type = _STOREANDFORWARD
|
|
||||||
_STOREANDFORWARD.fields_by_name['rr'].enum_type = _STOREANDFORWARD_REQUESTRESPONSE
|
|
||||||
_STOREANDFORWARD.fields_by_name['stats'].message_type = _STOREANDFORWARD_STATISTICS
|
|
||||||
_STOREANDFORWARD.fields_by_name['history'].message_type = _STOREANDFORWARD_HISTORY
|
|
||||||
_STOREANDFORWARD.fields_by_name['heartbeat'].message_type = _STOREANDFORWARD_HEARTBEAT
|
|
||||||
_STOREANDFORWARD_REQUESTRESPONSE.containing_type = _STOREANDFORWARD
|
|
||||||
DESCRIPTOR.message_types_by_name['StoreAndForward'] = _STOREANDFORWARD
|
|
||||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
|
||||||
|
|
||||||
StoreAndForward = _reflection.GeneratedProtocolMessageType('StoreAndForward', (_message.Message,), {
|
StoreAndForward = _reflection.GeneratedProtocolMessageType('StoreAndForward', (_message.Message,), {
|
||||||
|
|
||||||
'Statistics' : _reflection.GeneratedProtocolMessageType('Statistics', (_message.Message,), {
|
'Statistics' : _reflection.GeneratedProtocolMessageType('Statistics', (_message.Message,), {
|
||||||
@@ -351,6 +54,18 @@ _sym_db.RegisterMessage(StoreAndForward.Statistics)
|
|||||||
_sym_db.RegisterMessage(StoreAndForward.History)
|
_sym_db.RegisterMessage(StoreAndForward.History)
|
||||||
_sym_db.RegisterMessage(StoreAndForward.Heartbeat)
|
_sym_db.RegisterMessage(StoreAndForward.Heartbeat)
|
||||||
|
|
||||||
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
|
|
||||||
DESCRIPTOR._options = None
|
DESCRIPTOR._options = None
|
||||||
|
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\025StoreAndForwardProtosH\003Z!github.com/meshtastic/gomeshproto'
|
||||||
|
_STOREANDFORWARD._serialized_start=23
|
||||||
|
_STOREANDFORWARD._serialized_end=801
|
||||||
|
_STOREANDFORWARD_STATISTICS._serialized_start=223
|
||||||
|
_STOREANDFORWARD_STATISTICS._serialized_end=428
|
||||||
|
_STOREANDFORWARD_HISTORY._serialized_start=430
|
||||||
|
_STOREANDFORWARD_HISTORY._serialized_end=503
|
||||||
|
_STOREANDFORWARD_HEARTBEAT._serialized_start=505
|
||||||
|
_STOREANDFORWARD_HEARTBEAT._serialized_end=551
|
||||||
|
_STOREANDFORWARD_REQUESTRESPONSE._serialized_start=554
|
||||||
|
_STOREANDFORWARD_REQUESTRESPONSE._serialized_end=801
|
||||||
# @@protoc_insertion_point(module_scope)
|
# @@protoc_insertion_point(module_scope)
|
||||||
|
|||||||
187
meshtastic/supported_device.py
Executable file
187
meshtastic/supported_device.py
Executable file
@@ -0,0 +1,187 @@
|
|||||||
|
""" Supported Meshtastic Devices - This is a class and collection of Meshtastic devices.
|
||||||
|
It is used for auto detection as to which device might be connected.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
|
||||||
|
# Goal is to detect which device and port to use from the supported devices
|
||||||
|
# without installing any libraries that are not currently in the python meshtastic library
|
||||||
|
|
||||||
|
class SupportedDevice():
|
||||||
|
"""Devices supported on Meshtastic"""
|
||||||
|
|
||||||
|
def __init__(self, name, version=None, for_firmware=None, device_class="esp32",
|
||||||
|
baseport_on_linux=None, baseport_on_mac=None, baseport_on_windows="COM",
|
||||||
|
usb_vendor_id_in_hex=None, usb_product_id_in_hex=None):
|
||||||
|
""" constructor """
|
||||||
|
self.name = name
|
||||||
|
self.version = version
|
||||||
|
self.for_firmware = for_firmware
|
||||||
|
self.device_class = device_class # could be "nrf52"
|
||||||
|
|
||||||
|
# when you run "lsusb -d xxxx:" in linux
|
||||||
|
self.usb_vendor_id_in_hex = usb_vendor_id_in_hex # store in lower case
|
||||||
|
self.usb_product_id_in_hex = usb_product_id_in_hex # store in lower case
|
||||||
|
|
||||||
|
self.baseport_on_linux = baseport_on_linux # ex: ttyUSB or ttyACM
|
||||||
|
self.baseport_on_mac = baseport_on_mac
|
||||||
|
self.baseport_on_windows = baseport_on_windows
|
||||||
|
|
||||||
|
# supported devices
|
||||||
|
tbeam_v0_7 = SupportedDevice(name="T-Beam", version="0.7", for_firmware="tbeam0.7",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tbeam_v1_1 = SupportedDevice(name="T-Beam", version="1.1", for_firmware="tbeam",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tbeam_M8N = SupportedDevice(name="T-Beam", version="M8N", for_firmware="tbeam",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tbeam_M8N_SX1262 = SupportedDevice(name="T-Beam", version="M8N_SX1262", for_firmware="tbeam",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tlora_v1_1 = SupportedDevice(name="T-Lora", version="1.1", for_firmware="tlora-v1",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tlora_v1_3 = SupportedDevice(name="T-Lora", version="1.3", for_firmware="tlora-v1-3",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tlora_v2_0 = SupportedDevice(name="T-Lora", version="2.0", for_firmware="tlora-v2-1",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tlora_v2_1 = SupportedDevice(name="T-Lora", version="2.1", for_firmware="tlora-v2-1",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
tlora_v2_1_1_6 = SupportedDevice(name="T-Lora", version="2.1-1.6", for_firmware="tlora-v2-1-1.6",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="1a86", usb_product_id_in_hex="55d4")
|
||||||
|
heltec_v1 = SupportedDevice(name="Heltec", version="1", for_firmware="heltec-v1",
|
||||||
|
baseport_on_linux="ttyUSB", baseport_on_mac="cu.usbserial-",
|
||||||
|
usb_vendor_id_in_hex="10c4", usb_product_id_in_hex="ea60")
|
||||||
|
heltec_v2_0 = SupportedDevice(name="Heltec", version="2.0", for_firmware="heltec-v2.0",
|
||||||
|
baseport_on_linux="ttyUSB", baseport_on_mac="cu.usbserial-",
|
||||||
|
usb_vendor_id_in_hex="10c4", usb_product_id_in_hex="ea60")
|
||||||
|
heltec_v2_1 = SupportedDevice(name="Heltec", version="2.1", for_firmware="heltec-v2.1",
|
||||||
|
baseport_on_linux="ttyUSB", baseport_on_mac="cu.usbserial-",
|
||||||
|
usb_vendor_id_in_hex="10c4", usb_product_id_in_hex="ea60")
|
||||||
|
# TODO: get info on diy
|
||||||
|
meshtastic_diy_v1 = SupportedDevice(name="Meshtastic DIY", version="1", for_firmware="meshtastic-diy-v1")
|
||||||
|
# TODO: get info on TEcho
|
||||||
|
techo_1 = SupportedDevice(name="T-Echo", version="1", for_firmware="t-echo-1", device_class="nrf52")
|
||||||
|
rak4631_5005 = SupportedDevice(name="RAK 4631 5005", version="", for_firmware="rak4631_5005",
|
||||||
|
device_class="nrf52",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="239a", usb_product_id_in_hex="0029")
|
||||||
|
rak4631_19003 = SupportedDevice(name="RAK 4631 19003", version="", for_firmware="rak4631_19003",
|
||||||
|
device_class="nrf52",
|
||||||
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
|
usb_vendor_id_in_hex="239a", usb_product_id_in_hex="8029")
|
||||||
|
|
||||||
|
supported_devices = [tbeam_v0_7, tbeam_v1_1, tbeam_M8N, tbeam_M8N_SX1262,
|
||||||
|
tlora_v1_1, tlora_v1_3, tlora_v2_0, tlora_v2_1, tlora_v2_1_1_6,
|
||||||
|
heltec_v1, heltec_v2_0, heltec_v2_1,
|
||||||
|
meshtastic_diy_v1, techo_1, rak4631_5005, rak4631_19003]
|
||||||
|
|
||||||
|
|
||||||
|
def get_unique_vendor_ids():
|
||||||
|
"""Return a set of unique vendor ids"""
|
||||||
|
vids = set()
|
||||||
|
for d in supported_devices:
|
||||||
|
if d.usb_vendor_id_in_hex:
|
||||||
|
vids.add(d.usb_vendor_id_in_hex)
|
||||||
|
return vids
|
||||||
|
|
||||||
|
def get_devices_with_vendor_id(vid):
|
||||||
|
"""Return a set of unique devices with the vendor id"""
|
||||||
|
sd = set()
|
||||||
|
for d in supported_devices:
|
||||||
|
if d.usb_vendor_id_in_hex == vid:
|
||||||
|
sd.add(d)
|
||||||
|
return sd
|
||||||
|
|
||||||
|
def active_ports_on_supported_devices(sds):
|
||||||
|
"""Return a set of active ports based on the supplied supported devices"""
|
||||||
|
ports = set()
|
||||||
|
baseports = set()
|
||||||
|
system = platform.system()
|
||||||
|
|
||||||
|
# figure out what possible base ports there are
|
||||||
|
for d in sds:
|
||||||
|
if system == "Linux":
|
||||||
|
baseports.add(d.baseport_on_linux)
|
||||||
|
elif system == "Darwin":
|
||||||
|
baseports.add(d.baseport_on_mac)
|
||||||
|
elif system == "Windows":
|
||||||
|
baseports.add(d.baseport_on_windows)
|
||||||
|
|
||||||
|
for bp in baseports:
|
||||||
|
if system == "Linux":
|
||||||
|
# see if we have any devices (ignoring any stderr output)
|
||||||
|
command = f'ls -al /dev/{bp}* 2> /dev/null'
|
||||||
|
#print(f'command:{command}')
|
||||||
|
_, ls_output = subprocess.getstatusoutput(command)
|
||||||
|
#print(f'ls_output:{ls_output}')
|
||||||
|
# if we got output, there are ports
|
||||||
|
if len(ls_output) > 0:
|
||||||
|
#print('got output')
|
||||||
|
# for each line of output
|
||||||
|
lines = ls_output.split('\n')
|
||||||
|
#print(f'lines:{lines}')
|
||||||
|
for line in lines:
|
||||||
|
parts = line.split(' ')
|
||||||
|
#print(f'parts:{parts}')
|
||||||
|
port = parts[-1]
|
||||||
|
#print(f'port:{port}')
|
||||||
|
ports.add(port)
|
||||||
|
elif system == "Darwin":
|
||||||
|
# see if we have any devices (ignoring any stderr output)
|
||||||
|
command = f'ls -al /dev/{bp}* 2> /dev/null'
|
||||||
|
#print(f'command:{command}')
|
||||||
|
_, ls_output = subprocess.getstatusoutput(command)
|
||||||
|
#print(f'ls_output:{ls_output}')
|
||||||
|
# if we got output, there are ports
|
||||||
|
if len(ls_output) > 0:
|
||||||
|
#print('got output')
|
||||||
|
# for each line of output
|
||||||
|
lines = ls_output.split('\n')
|
||||||
|
#print(f'lines:{lines}')
|
||||||
|
for line in lines:
|
||||||
|
parts = line.split(' ')
|
||||||
|
#print(f'parts:{parts}')
|
||||||
|
port = parts[-1]
|
||||||
|
#print(f'port:{port}')
|
||||||
|
ports.add(port)
|
||||||
|
elif system == "Windows":
|
||||||
|
# for each device in supported devices found
|
||||||
|
for d in sds:
|
||||||
|
# find the port(s)
|
||||||
|
com_ports = detect_windows_port(d)
|
||||||
|
#print(f'com_ports:{com_ports}')
|
||||||
|
# add all ports
|
||||||
|
for com_port in com_ports:
|
||||||
|
ports.add(com_port)
|
||||||
|
return ports
|
||||||
|
|
||||||
|
|
||||||
|
def detect_windows_port(sd):
|
||||||
|
"""detect if Windows port"""
|
||||||
|
ports = set()
|
||||||
|
|
||||||
|
if sd:
|
||||||
|
system = platform.system()
|
||||||
|
|
||||||
|
if system == "Windows":
|
||||||
|
command = 'powershell.exe "Get-PnpDevice -PresentOnly | Where-Object{ ($_.DeviceId -like '
|
||||||
|
command += f"'*{sd.usb_vendor_id_in_hex.upper()}*'"
|
||||||
|
command += ')} | Format-List"'
|
||||||
|
|
||||||
|
#print(f'command:{command}')
|
||||||
|
_, sp_output = subprocess.getstatusoutput(command)
|
||||||
|
#print(f'sp_output:{sp_output}')
|
||||||
|
p = re.compile(r'\(COM(.*)\)')
|
||||||
|
for x in p.findall(sp_output):
|
||||||
|
#print(f'x:{x}')
|
||||||
|
ports.add(f'COM{x}')
|
||||||
|
return ports
|
||||||
@@ -425,6 +425,23 @@ def test_main_set_owner_to_bob(capsys):
|
|||||||
mo.assert_called()
|
mo.assert_called()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
def test_main_set_owner_short_to_bob(capsys):
|
||||||
|
"""Test --set-owner-short bob"""
|
||||||
|
sys.argv = ['', '--set-owner-short', 'bob']
|
||||||
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
|
main()
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Setting device owner short to bob', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
mo.assert_called()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
@pytest.mark.usefixtures("reset_globals")
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
def test_main_set_ham_to_KI123(capsys):
|
def test_main_set_ham_to_KI123(capsys):
|
||||||
@@ -478,6 +495,30 @@ def test_main_reboot(capsys):
|
|||||||
mo.assert_called()
|
mo.assert_called()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
def test_main_shutdown(capsys):
|
||||||
|
"""Test --shutdown"""
|
||||||
|
sys.argv = ['', '--shutdown']
|
||||||
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
|
mocked_node = MagicMock(autospec=Node)
|
||||||
|
def mock_shutdown():
|
||||||
|
print('inside mocked shutdown')
|
||||||
|
mocked_node.shutdown.side_effect = mock_shutdown
|
||||||
|
|
||||||
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
|
iface.getNode.return_value = mocked_node
|
||||||
|
|
||||||
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
|
main()
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
assert re.search(r'inside mocked shutdown', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
mo.assert_called()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
@pytest.mark.usefixtures("reset_globals")
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
def test_main_sendtext(capsys):
|
def test_main_sendtext(capsys):
|
||||||
@@ -803,6 +844,27 @@ def test_main_set_valid(capsys):
|
|||||||
mo.assert_called()
|
mo.assert_called()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
def test_main_set_valid_wifi_passwd(capsys):
|
||||||
|
"""Test --set with valid field"""
|
||||||
|
sys.argv = ['', '--set', 'wifi_password', '123456789']
|
||||||
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
|
mocked_node = MagicMock(autospec=Node)
|
||||||
|
|
||||||
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
|
iface.getNode.return_value = mocked_node
|
||||||
|
|
||||||
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
|
main()
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Set wifi_password to 123456789', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
mo.assert_called()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
@pytest.mark.usefixtures("reset_globals")
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
def test_main_set_valid_camel_case(capsys):
|
def test_main_set_valid_camel_case(capsys):
|
||||||
@@ -868,10 +930,12 @@ def test_main_configure_with_snake_case(capsys):
|
|||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
assert re.search(r'Setting device owner', out, re.MULTILINE)
|
assert re.search(r'Setting device owner', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Setting device owner short', out, re.MULTILINE)
|
||||||
assert re.search(r'Setting channel url', out, re.MULTILINE)
|
assert re.search(r'Setting channel url', out, re.MULTILINE)
|
||||||
assert re.search(r'Fixing altitude', out, re.MULTILINE)
|
assert re.search(r'Fixing altitude', out, re.MULTILINE)
|
||||||
assert re.search(r'Fixing latitude', out, re.MULTILINE)
|
assert re.search(r'Fixing latitude', out, re.MULTILINE)
|
||||||
assert re.search(r'Fixing longitude', out, re.MULTILINE)
|
assert re.search(r'Fixing longitude', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Set location_share to LocEnabled', out, re.MULTILINE)
|
||||||
assert re.search(r'Writing modified preferences', out, re.MULTILINE)
|
assert re.search(r'Writing modified preferences', out, re.MULTILINE)
|
||||||
assert err == ''
|
assert err == ''
|
||||||
mo.assert_called()
|
mo.assert_called()
|
||||||
@@ -894,6 +958,7 @@ def test_main_configure_with_camel_case_keys(capsys):
|
|||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
assert re.search(r'Setting device owner', out, re.MULTILINE)
|
assert re.search(r'Setting device owner', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Setting device owner short', out, re.MULTILINE)
|
||||||
assert re.search(r'Setting channel url', out, re.MULTILINE)
|
assert re.search(r'Setting channel url', out, re.MULTILINE)
|
||||||
assert re.search(r'Fixing altitude', out, re.MULTILINE)
|
assert re.search(r'Fixing altitude', out, re.MULTILINE)
|
||||||
assert re.search(r'Fixing latitude', out, re.MULTILINE)
|
assert re.search(r'Fixing latitude', out, re.MULTILINE)
|
||||||
@@ -1558,6 +1623,7 @@ def test_main_export_config(capsys):
|
|||||||
iface = MagicMock(autospec=SerialInterface)
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
mo.getLongName.return_value = 'foo'
|
mo.getLongName.return_value = 'foo'
|
||||||
|
mo.getShortName.return_value = 'oof'
|
||||||
mo.localNode.getURL.return_value = 'bar'
|
mo.localNode.getURL.return_value = 'bar'
|
||||||
mo.getMyNodeInfo().get.return_value = { 'latitudeI': 1100000000, 'longitudeI': 1200000000,
|
mo.getMyNodeInfo().get.return_value = { 'latitudeI': 1100000000, 'longitudeI': 1200000000,
|
||||||
'altitude': 100, 'batteryLevel': 34, 'latitude': 110.0,
|
'altitude': 100, 'batteryLevel': 34, 'latitude': 110.0,
|
||||||
@@ -1574,6 +1640,7 @@ position_flags: 35"""
|
|||||||
assert not re.search(r'Connected to radio', out, re.MULTILINE)
|
assert not re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
|
||||||
assert re.search(r'owner: foo', out, re.MULTILINE)
|
assert re.search(r'owner: foo', out, re.MULTILINE)
|
||||||
|
assert re.search(r'owner_short: oof', out, re.MULTILINE)
|
||||||
assert re.search(r'channel_url: bar', out, re.MULTILINE)
|
assert re.search(r'channel_url: bar', out, re.MULTILINE)
|
||||||
assert re.search(r'location:', out, re.MULTILINE)
|
assert re.search(r'location:', out, re.MULTILINE)
|
||||||
assert re.search(r'lat: 110.0', out, re.MULTILINE)
|
assert re.search(r'lat: 110.0', out, re.MULTILINE)
|
||||||
@@ -1688,18 +1755,18 @@ def test_main_gpio_rd_no_dest(capsys):
|
|||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
@pytest.mark.usefixtures("reset_globals")
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
@patch('time.sleep')
|
||||||
def test_main_gpio_rd(caplog, capsys):
|
def test_main_gpio_rd(caplog, capsys):
|
||||||
"""Test --gpio_rd with a named gpio channel"""
|
"""Test --gpio_rd with a named gpio channel"""
|
||||||
# Note: On the Heltec v2.1, there is a GPIO pin GPIO 13 that does not have a
|
# Note: On the Heltec v2.1, there is a GPIO pin GPIO 13 that does not have a
|
||||||
# red arrow (meaning ok to use for our purposes)
|
# red arrow (meaning ok to use for our purposes)
|
||||||
# See https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.pdf
|
# See https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.pdf
|
||||||
# To find out the mask for GPIO 13, let us assign n as 13.
|
# To find out the mask for GPIO 13, let us assign n as 13.
|
||||||
# 1. Subtract 1 from n (n is now 12)
|
# 1. Find the 2^n or 2^13 (8192)
|
||||||
# 2. Find the 2^n or 2^12 (4096)
|
# 2. Convert 8192 decimal to hex (0x2000)
|
||||||
# 3. Convert 4096 decimal to hex (0x1000)
|
|
||||||
# You can use python:
|
# You can use python:
|
||||||
# >>> print(hex(2**12))
|
# >>> print(hex(2**13))
|
||||||
# 0x1000
|
# 0x2000
|
||||||
sys.argv = ['', '--gpio-rd', '0x1000', '--dest', '!1234']
|
sys.argv = ['', '--gpio-rd', '0x1000', '--dest', '!1234']
|
||||||
Globals.getInstance().set_args(sys.argv)
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
@@ -1729,6 +1796,52 @@ def test_main_gpio_rd(caplog, capsys):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
|
iface.localNode.getChannelByName.return_value = channel
|
||||||
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
|
with caplog.at_level(logging.DEBUG):
|
||||||
|
main()
|
||||||
|
onGPIOreceive(packet, mo)
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Reading GPIO mask 0x1000 ', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Received RemoteHardware typ=READ_GPIOS_REPLY, gpio_value=4096', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
@patch('time.sleep')
|
||||||
|
def test_main_gpio_rd_with_no_gpioMask(caplog, capsys):
|
||||||
|
"""Test --gpio_rd with a named gpio channel"""
|
||||||
|
sys.argv = ['', '--gpio-rd', '0x1000', '--dest', '!1234']
|
||||||
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
|
channel = Channel(index=1, role=1)
|
||||||
|
channel.settings.modem_config = 3
|
||||||
|
channel.settings.psk = b'\x01'
|
||||||
|
|
||||||
|
# Note: Intentionally do not have gpioValue in response as that is the
|
||||||
|
# default value
|
||||||
|
packet = {
|
||||||
|
'from': 682968668,
|
||||||
|
'to': 682968612,
|
||||||
|
'channel': 1,
|
||||||
|
'decoded': {
|
||||||
|
'portnum': 'REMOTE_HARDWARE_APP',
|
||||||
|
'payload': b'\x08\x05\x18\x80 ',
|
||||||
|
'requestId': 1629980484,
|
||||||
|
'remotehw': {
|
||||||
|
'typ': 'READ_GPIOS_REPLY',
|
||||||
|
'raw': 'faked',
|
||||||
|
'id': 1693085229,
|
||||||
|
'rxTime': 1640294262,
|
||||||
|
'rxSnr': 4.75,
|
||||||
|
'hopLimit': 3,
|
||||||
|
'wantAck': True,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
iface = MagicMock(autospec=SerialInterface)
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
iface.localNode.getChannelByName.return_value = channel
|
iface.localNode.getChannelByName.return_value = channel
|
||||||
@@ -1736,14 +1849,112 @@ def test_main_gpio_rd(caplog, capsys):
|
|||||||
with caplog.at_level(logging.DEBUG):
|
with caplog.at_level(logging.DEBUG):
|
||||||
main()
|
main()
|
||||||
onGPIOreceive(packet, mo)
|
onGPIOreceive(packet, mo)
|
||||||
assert re.search(r'readGPIOs nodeid:!1234 mask:4096', caplog.text, re.MULTILINE)
|
|
||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
assert re.search(r'Reading GPIO mask 0x1000 ', out, re.MULTILINE)
|
assert re.search(r'Reading GPIO mask 0x1000 ', out, re.MULTILINE)
|
||||||
assert re.search(r'Received RemoteHardware typ=READ_GPIOS_REPLY, gpio_value=4096', out, re.MULTILINE)
|
assert re.search(r'Received RemoteHardware typ=READ_GPIOS_REPLY, gpio_value=0', out, re.MULTILINE)
|
||||||
assert err == ''
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
def test_main_gpio_watch(caplog, capsys):
|
||||||
|
"""Test --gpio_watch with a named gpio channel"""
|
||||||
|
sys.argv = ['', '--gpio-watch', '0x1000', '--dest', '!1234']
|
||||||
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
|
def my_sleep(amount):
|
||||||
|
print(f'{amount}')
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
|
channel = Channel(index=1, role=1)
|
||||||
|
channel.settings.modem_config = 3
|
||||||
|
channel.settings.psk = b'\x01'
|
||||||
|
|
||||||
|
packet = {
|
||||||
|
|
||||||
|
'from': 682968668,
|
||||||
|
'to': 682968612,
|
||||||
|
'channel': 1,
|
||||||
|
'decoded': {
|
||||||
|
'portnum': 'REMOTE_HARDWARE_APP',
|
||||||
|
'payload': b'\x08\x05\x18\x80 ',
|
||||||
|
'requestId': 1629980484,
|
||||||
|
'remotehw': {
|
||||||
|
'typ': 'READ_GPIOS_REPLY',
|
||||||
|
'gpioValue': '4096',
|
||||||
|
'raw': 'faked',
|
||||||
|
'id': 1693085229,
|
||||||
|
'rxTime': 1640294262,
|
||||||
|
'rxSnr': 4.75,
|
||||||
|
'hopLimit': 3,
|
||||||
|
'wantAck': True,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
with patch('time.sleep', side_effect=my_sleep):
|
||||||
|
with pytest.raises(SystemExit) as pytest_wrapped_e:
|
||||||
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
|
iface.localNode.getChannelByName.return_value = channel
|
||||||
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
|
with caplog.at_level(logging.DEBUG):
|
||||||
|
main()
|
||||||
|
onGPIOreceive(packet, mo)
|
||||||
|
assert pytest_wrapped_e.type == SystemExit
|
||||||
|
assert pytest_wrapped_e.value.code == 3
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Watching GPIO mask 0x1000 ', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
def test_main_gpio_wrb(caplog, capsys):
|
||||||
|
"""Test --gpio_wrb with a named gpio channel"""
|
||||||
|
sys.argv = ['', '--gpio-wrb', '4', '1', '--dest', '!1234']
|
||||||
|
Globals.getInstance().set_args(sys.argv)
|
||||||
|
|
||||||
|
channel = Channel(index=1, role=1)
|
||||||
|
channel.settings.modem_config = 3
|
||||||
|
channel.settings.psk = b'\x01'
|
||||||
|
|
||||||
|
packet = {
|
||||||
|
|
||||||
|
'from': 682968668,
|
||||||
|
'to': 682968612,
|
||||||
|
'channel': 1,
|
||||||
|
'decoded': {
|
||||||
|
'portnum': 'REMOTE_HARDWARE_APP',
|
||||||
|
'payload': b'\x08\x05\x18\x80 ',
|
||||||
|
'requestId': 1629980484,
|
||||||
|
'remotehw': {
|
||||||
|
'typ': 'READ_GPIOS_REPLY',
|
||||||
|
'gpioValue': '16',
|
||||||
|
'raw': 'faked',
|
||||||
|
'id': 1693085229,
|
||||||
|
'rxTime': 1640294262,
|
||||||
|
'rxSnr': 4.75,
|
||||||
|
'hopLimit': 3,
|
||||||
|
'wantAck': True,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
iface = MagicMock(autospec=SerialInterface)
|
||||||
|
iface.localNode.getChannelByName.return_value = channel
|
||||||
|
with patch('meshtastic.serial_interface.SerialInterface', return_value=iface) as mo:
|
||||||
|
with caplog.at_level(logging.DEBUG):
|
||||||
|
main()
|
||||||
|
onGPIOreceive(packet, mo)
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'Connected to radio', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Writing GPIO mask 0x10 with value 0x10 to !1234', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Received RemoteHardware typ=READ_GPIOS_REPLY, gpio_value=16 value=0', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
@pytest.mark.usefixtures("reset_globals")
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
def test_main_getPref_valid_field(capsys):
|
def test_main_getPref_valid_field(capsys):
|
||||||
@@ -1942,6 +2153,27 @@ def test_main_setPref_valid_field_invalid_enum(capsys, caplog):
|
|||||||
setPref(prefs, 'charge_current', 'foo')
|
setPref(prefs, 'charge_current', 'foo')
|
||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert re.search(r'charge_current does not have an enum called foo', out, re.MULTILINE)
|
assert re.search(r'charge_current does not have an enum called foo', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Choices in sorted order are', out, re.MULTILINE)
|
||||||
|
assert re.search(r'MA100', out, re.MULTILINE)
|
||||||
|
assert re.search(r'MA280', out, re.MULTILINE)
|
||||||
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
@pytest.mark.usefixtures("reset_globals")
|
||||||
|
def test_main_setPref_valid_field_invalid_enum_where_enums_are_camel_cased_values(capsys, caplog):
|
||||||
|
"""Test setPref() with a valid field but invalid enum value"""
|
||||||
|
|
||||||
|
radioConfig = RadioConfig()
|
||||||
|
prefs = radioConfig.preferences
|
||||||
|
|
||||||
|
with caplog.at_level(logging.DEBUG):
|
||||||
|
setPref(prefs, 'location_share', 'foo')
|
||||||
|
out, err = capsys.readouterr()
|
||||||
|
assert re.search(r'location_share does not have an enum called foo', out, re.MULTILINE)
|
||||||
|
assert re.search(r'Choices in sorted order are', out, re.MULTILINE)
|
||||||
|
assert re.search(r'LocDisabled', out, re.MULTILINE)
|
||||||
|
assert re.search(r'LocEnabled', out, re.MULTILINE)
|
||||||
assert err == ''
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,15 @@ def test_setOwner_and_team(caplog):
|
|||||||
assert re.search(r'p.set_owner.team:1', caplog.text, re.MULTILINE)
|
assert re.search(r'p.set_owner.team:1', caplog.text, re.MULTILINE)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
def test_setOwnerShort(caplog):
|
||||||
|
"""Test setOwner"""
|
||||||
|
anode = Node('foo', 'bar', noProto=True)
|
||||||
|
with caplog.at_level(logging.DEBUG):
|
||||||
|
anode.setOwner(long_name=None, short_name='123')
|
||||||
|
assert re.search(r'p.set_owner.short_name:123:', caplog.text, re.MULTILINE)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
def test_setOwner_no_short_name(caplog):
|
def test_setOwner_no_short_name(caplog):
|
||||||
"""Test setOwner"""
|
"""Test setOwner"""
|
||||||
@@ -119,6 +128,15 @@ def test_reboot(caplog):
|
|||||||
assert re.search(r'Telling node to reboot', caplog.text, re.MULTILINE)
|
assert re.search(r'Telling node to reboot', caplog.text, re.MULTILINE)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
def test_shutdown(caplog):
|
||||||
|
"""Test shutdown"""
|
||||||
|
anode = Node('foo', 'bar', noProto=True)
|
||||||
|
with caplog.at_level(logging.DEBUG):
|
||||||
|
anode.shutdown()
|
||||||
|
assert re.search(r'Telling node to shutdown', caplog.text, re.MULTILINE)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
def test_setURL_empty_url(capsys):
|
def test_setURL_empty_url(capsys):
|
||||||
"""Test reboot"""
|
"""Test reboot"""
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ def test_fromStr():
|
|||||||
assert fromStr('100.01') == 100.01
|
assert fromStr('100.01') == 100.01
|
||||||
assert fromStr('123') == 123
|
assert fromStr('123') == 123
|
||||||
assert fromStr('abc') == 'abc'
|
assert fromStr('abc') == 'abc'
|
||||||
|
assert fromStr('123456789') == 123456789
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unitslow
|
@pytest.mark.unitslow
|
||||||
|
|||||||
@@ -10,9 +10,11 @@ import time
|
|||||||
import platform
|
import platform
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
import subprocess
|
||||||
import serial
|
import serial
|
||||||
import serial.tools.list_ports
|
import serial.tools.list_ports
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
from meshtastic.supported_device import get_unique_vendor_ids, get_devices_with_vendor_id
|
||||||
|
|
||||||
"""Some devices such as a seger jlink we never want to accidentally open"""
|
"""Some devices such as a seger jlink we never want to accidentally open"""
|
||||||
blacklistVids = dict.fromkeys([0x1366])
|
blacklistVids = dict.fromkeys([0x1366])
|
||||||
@@ -257,3 +259,124 @@ def snake_to_camel(a_string):
|
|||||||
def camel_to_snake(a_string):
|
def camel_to_snake(a_string):
|
||||||
"""convert camelCase to snake_case"""
|
"""convert camelCase to snake_case"""
|
||||||
return ''.join(['_'+i.lower() if i.isupper() else i for i in a_string]).lstrip('_')
|
return ''.join(['_'+i.lower() if i.isupper() else i for i in a_string]).lstrip('_')
|
||||||
|
|
||||||
|
|
||||||
|
def detect_supported_devices():
|
||||||
|
"""detect supported devices"""
|
||||||
|
system = platform.system()
|
||||||
|
#print(f'system:{system}')
|
||||||
|
|
||||||
|
possible_devices = set()
|
||||||
|
if system == "Linux":
|
||||||
|
# if linux, run lsusb and list ports
|
||||||
|
|
||||||
|
# linux: use lsusb
|
||||||
|
# Bus 001 Device 091: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
|
||||||
|
_, lsusb_output = subprocess.getstatusoutput('lsusb')
|
||||||
|
vids = get_unique_vendor_ids()
|
||||||
|
for vid in vids:
|
||||||
|
#print(f'looking for {vid}...')
|
||||||
|
search = f' {vid}:'
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, lsusb_output, re.MULTILINE):
|
||||||
|
#print(f'Found vendor id that matches')
|
||||||
|
devices = get_devices_with_vendor_id(vid)
|
||||||
|
# check device id
|
||||||
|
for device in devices:
|
||||||
|
#print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
|
||||||
|
if device.usb_product_id_in_hex:
|
||||||
|
search = f' {vid}:{device.usb_product_id_in_hex} '
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, lsusb_output, re.MULTILINE):
|
||||||
|
# concatenate the devices with vendor id to possibles
|
||||||
|
possible_devices.add(device)
|
||||||
|
else:
|
||||||
|
# if there is a supported device witout a product id, then it
|
||||||
|
# might be a match... so, concatenate
|
||||||
|
possible_devices.add(device)
|
||||||
|
|
||||||
|
elif system == "Windows":
|
||||||
|
# if windows, run Get-PnpDevice
|
||||||
|
_, sp_output = subprocess.getstatusoutput('powershell.exe "Get-PnpDevice -PresentOnly | Format-List"')
|
||||||
|
#print(f'sp_output:{sp_output}')
|
||||||
|
vids = get_unique_vendor_ids()
|
||||||
|
for vid in vids:
|
||||||
|
#print(f'looking for {vid.upper()}...')
|
||||||
|
search = f'DeviceID.*{vid.upper()}&'
|
||||||
|
#search = f'{vid.upper()}'
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
|
#print(f'Found vendor id that matches')
|
||||||
|
devices = get_devices_with_vendor_id(vid)
|
||||||
|
# check device id
|
||||||
|
for device in devices:
|
||||||
|
#print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
|
||||||
|
if device.usb_product_id_in_hex:
|
||||||
|
search = f'DeviceID.*{vid.upper()}&PID_{device.usb_product_id_in_hex.upper()}'
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
|
# concatenate the devices with vendor id to possibles
|
||||||
|
possible_devices.add(device)
|
||||||
|
# do a check to see if there is a Windows driver issue
|
||||||
|
if detect_windows_needs_driver(device, False):
|
||||||
|
print("WARNING: Need to install driver.")
|
||||||
|
else:
|
||||||
|
# if there is a supported device witout a product id, then it
|
||||||
|
# might be a match... so, concatenate
|
||||||
|
possible_devices.add(device)
|
||||||
|
|
||||||
|
elif system == "Darwin":
|
||||||
|
# run: system_profiler SPUSBDataType
|
||||||
|
# if mac air (eg: arm m1) do not know how to get info TODO: research
|
||||||
|
|
||||||
|
_, sp_output = subprocess.getstatusoutput('system_profiler SPUSBDataType')
|
||||||
|
vids = get_unique_vendor_ids()
|
||||||
|
for vid in vids:
|
||||||
|
#print(f'looking for {vid}...')
|
||||||
|
search = f'Vendor ID: 0x{vid}'
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
|
#print(f'Found vendor id that matches')
|
||||||
|
devices = get_devices_with_vendor_id(vid)
|
||||||
|
# check device id
|
||||||
|
for device in devices:
|
||||||
|
#print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
|
||||||
|
if device.usb_product_id_in_hex:
|
||||||
|
search = f'Product ID: 0x{device.usb_product_id_in_hex}'
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
|
# concatenate the devices with vendor id to possibles
|
||||||
|
possible_devices.add(device)
|
||||||
|
else:
|
||||||
|
# if there is a supported device witout a product id, then it
|
||||||
|
# might be a match... so, concatenate
|
||||||
|
possible_devices.add(device)
|
||||||
|
return possible_devices
|
||||||
|
|
||||||
|
|
||||||
|
def detect_windows_needs_driver(sd, print_reason=False):
|
||||||
|
"""detect if Windows user needs to install driver for a supported device"""
|
||||||
|
need_to_install_driver = False
|
||||||
|
|
||||||
|
if sd:
|
||||||
|
system = platform.system()
|
||||||
|
#print(f'in detect_windows_needs_driver system:{system}')
|
||||||
|
|
||||||
|
if system == "Windows":
|
||||||
|
# if windows, see if we can find a DeviceId with the vendor id
|
||||||
|
# Get-PnpDevice | Where-Object{ ($_.DeviceId -like '*10C4*')} | Format-List
|
||||||
|
command = 'powershell.exe "Get-PnpDevice | Where-Object{ ($_.DeviceId -like '
|
||||||
|
command += f"'*{sd.usb_vendor_id_in_hex.upper()}*'"
|
||||||
|
command += ')} | Format-List"'
|
||||||
|
|
||||||
|
#print(f'command:{command}')
|
||||||
|
_, sp_output = subprocess.getstatusoutput(command)
|
||||||
|
#print(f'sp_output:{sp_output}')
|
||||||
|
search = f'CM_PROB_FAILED_INSTALL'
|
||||||
|
#print(f'search:"{search}"')
|
||||||
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
|
need_to_install_driver = True
|
||||||
|
# if the want to see the reason
|
||||||
|
if print_reason:
|
||||||
|
print(sp_output)
|
||||||
|
return need_to_install_driver
|
||||||
|
|||||||
2
proto
2
proto
Submodule proto updated: d7b2791b7c...07ed86d8b4
2
setup.py
2
setup.py
@@ -12,7 +12,7 @@ with open("README.md", "r") as fh:
|
|||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="meshtastic",
|
name="meshtastic",
|
||||||
version="1.2.55",
|
version="1.2.78",
|
||||||
description="Python API & client shell for talking to Meshtastic devices",
|
description="Python API & client shell for talking to Meshtastic devices",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
7
standalone_readme.txt
Normal file
7
standalone_readme.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
readme.txt for single standalone executable zip files that can be
|
||||||
|
downloaded from https://github.com/meshtastic/Meshtastic-python/releases
|
||||||
|
|
||||||
|
If you do not want to install python and/or the python libraries, you can download one of these
|
||||||
|
zip files to run the Meshtastic command line interface (CLI) as a standalone executable.
|
||||||
|
|
||||||
|
See https://meshtastic.org/docs/software/python/python-standalone for more info.
|
||||||
Reference in New Issue
Block a user