forked from iarv/meshview
Initial commit.
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
env/*
|
||||
__pycache__/*
|
||||
packets.db
|
||||
661
COPYING
Normal file
661
COPYING
Normal file
@@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
14
README
Normal file
14
README
Normal file
@@ -0,0 +1,14 @@
|
||||
Meshview
|
||||
========
|
||||
|
||||
This project watches a MQTT topic for meshtastic messages, imports them to a
|
||||
database and has a web UI to view them.
|
||||
|
||||
|
||||
Running
|
||||
-------
|
||||
$ python3 -m venv env
|
||||
$ ./env/bin/pip install -r requirements.txt
|
||||
$ ./env/bin/python main.py
|
||||
|
||||
Now you can hit http://localhost:8080/
|
||||
23
gen_proto.sh
Executable file
23
gen_proto.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
protoc \
|
||||
-Iproto_def \
|
||||
--python_out=. \
|
||||
proto_def/meshtastic/admin.proto \
|
||||
proto_def/meshtastic/apponly.proto \
|
||||
proto_def/meshtastic/atak.proto \
|
||||
proto_def/meshtastic/cannedmessages.proto \
|
||||
proto_def/meshtastic/channel.proto \
|
||||
proto_def/meshtastic/clientonly.proto \
|
||||
proto_def/meshtastic/config.proto \
|
||||
proto_def/meshtastic/connection_status.proto \
|
||||
proto_def/meshtastic/localonly.proto \
|
||||
proto_def/meshtastic/mesh.proto \
|
||||
proto_def/meshtastic/module_config.proto \
|
||||
proto_def/meshtastic/mqtt.proto \
|
||||
proto_def/meshtastic/paxcount.proto \
|
||||
proto_def/meshtastic/portnums.proto \
|
||||
proto_def/meshtastic/remote_hardware.proto \
|
||||
proto_def/meshtastic/rtttl.proto \
|
||||
proto_def/meshtastic/storeforward.proto \
|
||||
proto_def/meshtastic/telemetry.proto \
|
||||
proto_def/meshtastic/xmodem.proto
|
||||
40
main.py
Normal file
40
main.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import asyncio
|
||||
import argparse
|
||||
|
||||
from meshview import mqtt_reader
|
||||
from meshview import database
|
||||
from meshview import store
|
||||
from meshview import web
|
||||
from meshview import http
|
||||
|
||||
|
||||
async def load_database_from_mqtt(topic):
|
||||
async for topic, env in mqtt_reader.get_topic_envelopes(topic):
|
||||
await store.process_envelope(topic, env)
|
||||
|
||||
|
||||
async def main(args):
|
||||
database.init_database(args.database)
|
||||
|
||||
await database.create_tables()
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
tg.create_task(load_database_from_mqtt(args.topic))
|
||||
tg.create_task(web.run_server(args.bind, args.port, args.tls_cert))
|
||||
if args.acme_challenge:
|
||||
tg.create_task(http.run_server(args.bind, args.acme_challenge))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser('meshview')
|
||||
parser.add_argument('--bind', default='::1')
|
||||
parser.add_argument('--acme-challenge')
|
||||
parser.add_argument('--port', default=8080, type=int)
|
||||
parser.add_argument('--tls-cert')
|
||||
|
||||
parser.add_argument('--topic', default='msh/US/bayarea/#')
|
||||
|
||||
parser.add_argument('--database', default='sqlite+aiosqlite:///packets.db')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
asyncio.run(main(args))
|
||||
39
meshtastic/admin_pb2.py
Normal file
39
meshtastic/admin_pb2.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/admin.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from meshtastic import channel_pb2 as meshtastic_dot_channel__pb2
|
||||
from meshtastic import config_pb2 as meshtastic_dot_config__pb2
|
||||
from meshtastic import connection_status_pb2 as meshtastic_dot_connection__status__pb2
|
||||
from meshtastic import mesh_pb2 as meshtastic_dot_mesh__pb2
|
||||
from meshtastic import module_config_pb2 as meshtastic_dot_module__config__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16meshtastic/admin.proto\x12\nmeshtastic\x1a\x18meshtastic/channel.proto\x1a\x17meshtastic/config.proto\x1a\"meshtastic/connection_status.proto\x1a\x15meshtastic/mesh.proto\x1a\x1emeshtastic/module_config.proto\"\xce\x11\n\x0c\x41\x64minMessage\x12\x1d\n\x13get_channel_request\x18\x01 \x01(\rH\x00\x12\x33\n\x14get_channel_response\x18\x02 \x01(\x0b\x32\x13.meshtastic.ChannelH\x00\x12\x1b\n\x11get_owner_request\x18\x03 \x01(\x08H\x00\x12.\n\x12get_owner_response\x18\x04 \x01(\x0b\x32\x10.meshtastic.UserH\x00\x12\x41\n\x12get_config_request\x18\x05 \x01(\x0e\x32#.meshtastic.AdminMessage.ConfigTypeH\x00\x12\x31\n\x13get_config_response\x18\x06 \x01(\x0b\x32\x12.meshtastic.ConfigH\x00\x12N\n\x19get_module_config_request\x18\x07 \x01(\x0e\x32).meshtastic.AdminMessage.ModuleConfigTypeH\x00\x12>\n\x1aget_module_config_response\x18\x08 \x01(\x0b\x32\x18.meshtastic.ModuleConfigH\x00\x12\x34\n*get_canned_message_module_messages_request\x18\n \x01(\x08H\x00\x12\x35\n+get_canned_message_module_messages_response\x18\x0b \x01(\tH\x00\x12%\n\x1bget_device_metadata_request\x18\x0c \x01(\x08H\x00\x12\x42\n\x1cget_device_metadata_response\x18\r \x01(\x0b\x32\x1a.meshtastic.DeviceMetadataH\x00\x12\x1e\n\x14get_ringtone_request\x18\x0e \x01(\x08H\x00\x12\x1f\n\x15get_ringtone_response\x18\x0f \x01(\tH\x00\x12.\n$get_device_connection_status_request\x18\x10 \x01(\x08H\x00\x12S\n%get_device_connection_status_response\x18\x11 \x01(\x0b\x32\".meshtastic.DeviceConnectionStatusH\x00\x12\x31\n\x0cset_ham_mode\x18\x12 \x01(\x0b\x32\x19.meshtastic.HamParametersH\x00\x12/\n%get_node_remote_hardware_pins_request\x18\x13 \x01(\x08H\x00\x12\\\n&get_node_remote_hardware_pins_response\x18\x14 \x01(\x0b\x32*.meshtastic.NodeRemoteHardwarePinsResponseH\x00\x12 \n\x16\x65nter_dfu_mode_request\x18\x15 \x01(\x08H\x00\x12\x1d\n\x13\x64\x65lete_file_request\x18\x16 \x01(\tH\x00\x12%\n\tset_owner\x18 \x01(\x0b\x32\x10.meshtastic.UserH\x00\x12*\n\x0bset_channel\x18! \x01(\x0b\x32\x13.meshtastic.ChannelH\x00\x12(\n\nset_config\x18\" \x01(\x0b\x32\x12.meshtastic.ConfigH\x00\x12\x35\n\x11set_module_config\x18# \x01(\x0b\x32\x18.meshtastic.ModuleConfigH\x00\x12,\n\"set_canned_message_module_messages\x18$ \x01(\tH\x00\x12\x1e\n\x14set_ringtone_message\x18% \x01(\tH\x00\x12\x1b\n\x11remove_by_nodenum\x18& \x01(\rH\x00\x12\x1b\n\x11set_favorite_node\x18\' \x01(\rH\x00\x12\x1e\n\x14remove_favorite_node\x18( \x01(\rH\x00\x12\x32\n\x12set_fixed_position\x18) \x01(\x0b\x32\x14.meshtastic.PositionH\x00\x12\x1f\n\x15remove_fixed_position\x18* \x01(\x08H\x00\x12\x1d\n\x13\x62\x65gin_edit_settings\x18@ \x01(\x08H\x00\x12\x1e\n\x14\x63ommit_edit_settings\x18\x41 \x01(\x08H\x00\x12\x1c\n\x12reboot_ota_seconds\x18_ \x01(\x05H\x00\x12\x18\n\x0e\x65xit_simulator\x18` \x01(\x08H\x00\x12\x18\n\x0ereboot_seconds\x18\x61 \x01(\x05H\x00\x12\x1a\n\x10shutdown_seconds\x18\x62 \x01(\x05H\x00\x12\x17\n\rfactory_reset\x18\x63 \x01(\x05H\x00\x12\x16\n\x0cnodedb_reset\x18\x64 \x01(\x05H\x00\"\x95\x01\n\nConfigType\x12\x11\n\rDEVICE_CONFIG\x10\x00\x12\x13\n\x0fPOSITION_CONFIG\x10\x01\x12\x10\n\x0cPOWER_CONFIG\x10\x02\x12\x12\n\x0eNETWORK_CONFIG\x10\x03\x12\x12\n\x0e\x44ISPLAY_CONFIG\x10\x04\x12\x0f\n\x0bLORA_CONFIG\x10\x05\x12\x14\n\x10\x42LUETOOTH_CONFIG\x10\x06\"\xbb\x02\n\x10ModuleConfigType\x12\x0f\n\x0bMQTT_CONFIG\x10\x00\x12\x11\n\rSERIAL_CONFIG\x10\x01\x12\x13\n\x0f\x45XTNOTIF_CONFIG\x10\x02\x12\x17\n\x13STOREFORWARD_CONFIG\x10\x03\x12\x14\n\x10RANGETEST_CONFIG\x10\x04\x12\x14\n\x10TELEMETRY_CONFIG\x10\x05\x12\x14\n\x10\x43\x41NNEDMSG_CONFIG\x10\x06\x12\x10\n\x0c\x41UDIO_CONFIG\x10\x07\x12\x19\n\x15REMOTEHARDWARE_CONFIG\x10\x08\x12\x17\n\x13NEIGHBORINFO_CONFIG\x10\t\x12\x1a\n\x16\x41MBIENTLIGHTING_CONFIG\x10\n\x12\x1a\n\x16\x44\x45TECTIONSENSOR_CONFIG\x10\x0b\x12\x15\n\x11PAXCOUNTER_CONFIG\x10\x0c\x42\x11\n\x0fpayload_variant\"[\n\rHamParameters\x12\x11\n\tcall_sign\x18\x01 \x01(\t\x12\x10\n\x08tx_power\x18\x02 \x01(\x05\x12\x11\n\tfrequency\x18\x03 \x01(\x02\x12\x12\n\nshort_name\x18\x04 \x01(\t\"f\n\x1eNodeRemoteHardwarePinsResponse\x12\x44\n\x19node_remote_hardware_pins\x18\x01 \x03(\x0b\x32!.meshtastic.NodeRemoteHardwarePinB`\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.admin_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\013AdminProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_ADMINMESSAGE._serialized_start=181
|
||||
_ADMINMESSAGE._serialized_end=2435
|
||||
_ADMINMESSAGE_CONFIGTYPE._serialized_start=1949
|
||||
_ADMINMESSAGE_CONFIGTYPE._serialized_end=2098
|
||||
_ADMINMESSAGE_MODULECONFIGTYPE._serialized_start=2101
|
||||
_ADMINMESSAGE_MODULECONFIGTYPE._serialized_end=2416
|
||||
_HAMPARAMETERS._serialized_start=2437
|
||||
_HAMPARAMETERS._serialized_end=2528
|
||||
_NODEREMOTEHARDWAREPINSRESPONSE._serialized_start=2530
|
||||
_NODEREMOTEHARDWAREPINSRESPONSE._serialized_end=2632
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
28
meshtastic/apponly_pb2.py
Normal file
28
meshtastic/apponly_pb2.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/apponly.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from meshtastic import channel_pb2 as meshtastic_dot_channel__pb2
|
||||
from meshtastic import config_pb2 as meshtastic_dot_config__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18meshtastic/apponly.proto\x12\nmeshtastic\x1a\x18meshtastic/channel.proto\x1a\x17meshtastic/config.proto\"o\n\nChannelSet\x12-\n\x08settings\x18\x01 \x03(\x0b\x32\x1b.meshtastic.ChannelSettings\x12\x32\n\x0blora_config\x18\x02 \x01(\x0b\x32\x1d.meshtastic.Config.LoRaConfigBb\n\x13\x63om.geeksville.meshB\rAppOnlyProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.apponly_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\rAppOnlyProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_CHANNELSET._serialized_start=91
|
||||
_CHANNELSET._serialized_end=202
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
40
meshtastic/atak_pb2.py
Normal file
40
meshtastic/atak_pb2.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/atak.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x15meshtastic/atak.proto\x12\nmeshtastic\"\xe6\x01\n\tTAKPacket\x12\x15\n\ris_compressed\x18\x01 \x01(\x08\x12$\n\x07\x63ontact\x18\x02 \x01(\x0b\x32\x13.meshtastic.Contact\x12 \n\x05group\x18\x03 \x01(\x0b\x32\x11.meshtastic.Group\x12\"\n\x06status\x18\x04 \x01(\x0b\x32\x12.meshtastic.Status\x12\x1e\n\x03pli\x18\x05 \x01(\x0b\x32\x0f.meshtastic.PLIH\x00\x12#\n\x04\x63hat\x18\x06 \x01(\x0b\x32\x13.meshtastic.GeoChatH\x00\x42\x11\n\x0fpayload_variant\"2\n\x07GeoChat\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0f\n\x02to\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x05\n\x03_to\"M\n\x05Group\x12$\n\x04role\x18\x01 \x01(\x0e\x32\x16.meshtastic.MemberRole\x12\x1e\n\x04team\x18\x02 \x01(\x0e\x32\x10.meshtastic.Team\"\x19\n\x06Status\x12\x0f\n\x07\x62\x61ttery\x18\x01 \x01(\r\"4\n\x07\x43ontact\x12\x10\n\x08\x63\x61llsign\x18\x01 \x01(\t\x12\x17\n\x0f\x64\x65vice_callsign\x18\x02 \x01(\t\"_\n\x03PLI\x12\x12\n\nlatitude_i\x18\x01 \x01(\x0f\x12\x13\n\x0blongitude_i\x18\x02 \x01(\x0f\x12\x10\n\x08\x61ltitude\x18\x03 \x01(\x05\x12\r\n\x05speed\x18\x04 \x01(\r\x12\x0e\n\x06\x63ourse\x18\x05 \x01(\r*\xc0\x01\n\x04Team\x12\x14\n\x10Unspecifed_Color\x10\x00\x12\t\n\x05White\x10\x01\x12\n\n\x06Yellow\x10\x02\x12\n\n\x06Orange\x10\x03\x12\x0b\n\x07Magenta\x10\x04\x12\x07\n\x03Red\x10\x05\x12\n\n\x06Maroon\x10\x06\x12\n\n\x06Purple\x10\x07\x12\r\n\tDark_Blue\x10\x08\x12\x08\n\x04\x42lue\x10\t\x12\x08\n\x04\x43yan\x10\n\x12\x08\n\x04Teal\x10\x0b\x12\t\n\x05Green\x10\x0c\x12\x0e\n\nDark_Green\x10\r\x12\t\n\x05\x42rown\x10\x0e*\x7f\n\nMemberRole\x12\x0e\n\nUnspecifed\x10\x00\x12\x0e\n\nTeamMember\x10\x01\x12\x0c\n\x08TeamLead\x10\x02\x12\x06\n\x02HQ\x10\x03\x12\n\n\x06Sniper\x10\x04\x12\t\n\x05Medic\x10\x05\x12\x13\n\x0f\x46orwardObserver\x10\x06\x12\x07\n\x03RTO\x10\x07\x12\x06\n\x02K9\x10\x08\x42_\n\x13\x63om.geeksville.meshB\nATAKProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.atak_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\nATAKProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_TEAM._serialized_start=580
|
||||
_TEAM._serialized_end=772
|
||||
_MEMBERROLE._serialized_start=774
|
||||
_MEMBERROLE._serialized_end=901
|
||||
_TAKPACKET._serialized_start=38
|
||||
_TAKPACKET._serialized_end=268
|
||||
_GEOCHAT._serialized_start=270
|
||||
_GEOCHAT._serialized_end=320
|
||||
_GROUP._serialized_start=322
|
||||
_GROUP._serialized_end=399
|
||||
_STATUS._serialized_start=401
|
||||
_STATUS._serialized_end=426
|
||||
_CONTACT._serialized_start=428
|
||||
_CONTACT._serialized_end=480
|
||||
_PLI._serialized_start=482
|
||||
_PLI._serialized_end=577
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
26
meshtastic/cannedmessages_pb2.py
Normal file
26
meshtastic/cannedmessages_pb2.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/cannedmessages.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x1fmeshtastic/cannedmessages.proto\x12\nmeshtastic\"-\n\x19\x43\x61nnedMessageModuleConfig\x12\x10\n\x08messages\x18\x01 \x01(\tBn\n\x13\x63om.geeksville.meshB\x19\x43\x61nnedMessageConfigProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.cannedmessages_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\031CannedMessageConfigProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_CANNEDMESSAGEMODULECONFIG._serialized_start=47
|
||||
_CANNEDMESSAGEMODULECONFIG._serialized_end=92
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
34
meshtastic/channel_pb2.py
Normal file
34
meshtastic/channel_pb2.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/channel.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x18meshtastic/channel.proto\x12\nmeshtastic\"\xb8\x01\n\x0f\x43hannelSettings\x12\x17\n\x0b\x63hannel_num\x18\x01 \x01(\rB\x02\x18\x01\x12\x0b\n\x03psk\x18\x02 \x01(\x0c\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\n\n\x02id\x18\x04 \x01(\x07\x12\x16\n\x0euplink_enabled\x18\x05 \x01(\x08\x12\x18\n\x10\x64ownlink_enabled\x18\x06 \x01(\x08\x12\x33\n\x0fmodule_settings\x18\x07 \x01(\x0b\x32\x1a.meshtastic.ModuleSettings\",\n\x0eModuleSettings\x12\x1a\n\x12position_precision\x18\x01 \x01(\r\"\xa1\x01\n\x07\x43hannel\x12\r\n\x05index\x18\x01 \x01(\x05\x12-\n\x08settings\x18\x02 \x01(\x0b\x32\x1b.meshtastic.ChannelSettings\x12&\n\x04role\x18\x03 \x01(\x0e\x32\x18.meshtastic.Channel.Role\"0\n\x04Role\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02\x42\x62\n\x13\x63om.geeksville.meshB\rChannelProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.channel_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\rChannelProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_CHANNELSETTINGS.fields_by_name['channel_num']._options = None
|
||||
_CHANNELSETTINGS.fields_by_name['channel_num']._serialized_options = b'\030\001'
|
||||
_CHANNELSETTINGS._serialized_start=41
|
||||
_CHANNELSETTINGS._serialized_end=225
|
||||
_MODULESETTINGS._serialized_start=227
|
||||
_MODULESETTINGS._serialized_end=271
|
||||
_CHANNEL._serialized_start=274
|
||||
_CHANNEL._serialized_end=435
|
||||
_CHANNEL_ROLE._serialized_start=387
|
||||
_CHANNEL_ROLE._serialized_end=435
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
27
meshtastic/clientonly_pb2.py
Normal file
27
meshtastic/clientonly_pb2.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/clientonly.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from meshtastic import localonly_pb2 as meshtastic_dot_localonly__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bmeshtastic/clientonly.proto\x12\nmeshtastic\x1a\x1ameshtastic/localonly.proto\"\x8d\x02\n\rDeviceProfile\x12\x16\n\tlong_name\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x17\n\nshort_name\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hannel_url\x18\x03 \x01(\tH\x02\x88\x01\x01\x12,\n\x06\x63onfig\x18\x04 \x01(\x0b\x32\x17.meshtastic.LocalConfigH\x03\x88\x01\x01\x12\x39\n\rmodule_config\x18\x05 \x01(\x0b\x32\x1d.meshtastic.LocalModuleConfigH\x04\x88\x01\x01\x42\x0c\n\n_long_nameB\r\n\x0b_short_nameB\x0e\n\x0c_channel_urlB\t\n\x07_configB\x10\n\x0e_module_configBe\n\x13\x63om.geeksville.meshB\x10\x43lientOnlyProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.clientonly_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\020ClientOnlyProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_DEVICEPROFILE._serialized_start=72
|
||||
_DEVICEPROFILE._serialized_end=341
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
70
meshtastic/config_pb2.py
Normal file
70
meshtastic/config_pb2.py
Normal file
File diff suppressed because one or more lines are too long
36
meshtastic/connection_status_pb2.py
Normal file
36
meshtastic/connection_status_pb2.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/connection_status.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\"meshtastic/connection_status.proto\x12\nmeshtastic\"\xb1\x02\n\x16\x44\x65viceConnectionStatus\x12\x33\n\x04wifi\x18\x01 \x01(\x0b\x32 .meshtastic.WifiConnectionStatusH\x00\x88\x01\x01\x12;\n\x08\x65thernet\x18\x02 \x01(\x0b\x32$.meshtastic.EthernetConnectionStatusH\x01\x88\x01\x01\x12=\n\tbluetooth\x18\x03 \x01(\x0b\x32%.meshtastic.BluetoothConnectionStatusH\x02\x88\x01\x01\x12\x37\n\x06serial\x18\x04 \x01(\x0b\x32\".meshtastic.SerialConnectionStatusH\x03\x88\x01\x01\x42\x07\n\x05_wifiB\x0b\n\t_ethernetB\x0c\n\n_bluetoothB\t\n\x07_serial\"g\n\x14WifiConnectionStatus\x12\x33\n\x06status\x18\x01 \x01(\x0b\x32#.meshtastic.NetworkConnectionStatus\x12\x0c\n\x04ssid\x18\x02 \x01(\t\x12\x0c\n\x04rssi\x18\x03 \x01(\x05\"O\n\x18\x45thernetConnectionStatus\x12\x33\n\x06status\x18\x01 \x01(\x0b\x32#.meshtastic.NetworkConnectionStatus\"{\n\x17NetworkConnectionStatus\x12\x12\n\nip_address\x18\x01 \x01(\x07\x12\x14\n\x0cis_connected\x18\x02 \x01(\x08\x12\x19\n\x11is_mqtt_connected\x18\x03 \x01(\x08\x12\x1b\n\x13is_syslog_connected\x18\x04 \x01(\x08\"L\n\x19\x42luetoothConnectionStatus\x12\x0b\n\x03pin\x18\x01 \x01(\r\x12\x0c\n\x04rssi\x18\x02 \x01(\x05\x12\x14\n\x0cis_connected\x18\x03 \x01(\x08\"<\n\x16SerialConnectionStatus\x12\x0c\n\x04\x62\x61ud\x18\x01 \x01(\r\x12\x14\n\x0cis_connected\x18\x02 \x01(\x08\x42\x65\n\x13\x63om.geeksville.meshB\x10\x43onnStatusProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.connection_status_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\020ConnStatusProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_DEVICECONNECTIONSTATUS._serialized_start=51
|
||||
_DEVICECONNECTIONSTATUS._serialized_end=356
|
||||
_WIFICONNECTIONSTATUS._serialized_start=358
|
||||
_WIFICONNECTIONSTATUS._serialized_end=461
|
||||
_ETHERNETCONNECTIONSTATUS._serialized_start=463
|
||||
_ETHERNETCONNECTIONSTATUS._serialized_end=542
|
||||
_NETWORKCONNECTIONSTATUS._serialized_start=544
|
||||
_NETWORKCONNECTIONSTATUS._serialized_end=667
|
||||
_BLUETOOTHCONNECTIONSTATUS._serialized_start=669
|
||||
_BLUETOOTHCONNECTIONSTATUS._serialized_end=745
|
||||
_SERIALCONNECTIONSTATUS._serialized_start=747
|
||||
_SERIALCONNECTIONSTATUS._serialized_end=807
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
30
meshtastic/localonly_pb2.py
Normal file
30
meshtastic/localonly_pb2.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/localonly.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from meshtastic import config_pb2 as meshtastic_dot_config__pb2
|
||||
from meshtastic import module_config_pb2 as meshtastic_dot_module__config__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ameshtastic/localonly.proto\x12\nmeshtastic\x1a\x17meshtastic/config.proto\x1a\x1emeshtastic/module_config.proto\"\xfd\x02\n\x0bLocalConfig\x12/\n\x06\x64\x65vice\x18\x01 \x01(\x0b\x32\x1f.meshtastic.Config.DeviceConfig\x12\x33\n\x08position\x18\x02 \x01(\x0b\x32!.meshtastic.Config.PositionConfig\x12-\n\x05power\x18\x03 \x01(\x0b\x32\x1e.meshtastic.Config.PowerConfig\x12\x31\n\x07network\x18\x04 \x01(\x0b\x32 .meshtastic.Config.NetworkConfig\x12\x31\n\x07\x64isplay\x18\x05 \x01(\x0b\x32 .meshtastic.Config.DisplayConfig\x12+\n\x04lora\x18\x06 \x01(\x0b\x32\x1d.meshtastic.Config.LoRaConfig\x12\x35\n\tbluetooth\x18\x07 \x01(\x0b\x32\".meshtastic.Config.BluetoothConfig\x12\x0f\n\x07version\x18\x08 \x01(\r\"\xfb\x06\n\x11LocalModuleConfig\x12\x31\n\x04mqtt\x18\x01 \x01(\x0b\x32#.meshtastic.ModuleConfig.MQTTConfig\x12\x35\n\x06serial\x18\x02 \x01(\x0b\x32%.meshtastic.ModuleConfig.SerialConfig\x12R\n\x15\x65xternal_notification\x18\x03 \x01(\x0b\x32\x33.meshtastic.ModuleConfig.ExternalNotificationConfig\x12\x42\n\rstore_forward\x18\x04 \x01(\x0b\x32+.meshtastic.ModuleConfig.StoreForwardConfig\x12<\n\nrange_test\x18\x05 \x01(\x0b\x32(.meshtastic.ModuleConfig.RangeTestConfig\x12;\n\ttelemetry\x18\x06 \x01(\x0b\x32(.meshtastic.ModuleConfig.TelemetryConfig\x12\x44\n\x0e\x63\x61nned_message\x18\x07 \x01(\x0b\x32,.meshtastic.ModuleConfig.CannedMessageConfig\x12\x33\n\x05\x61udio\x18\t \x01(\x0b\x32$.meshtastic.ModuleConfig.AudioConfig\x12\x46\n\x0fremote_hardware\x18\n \x01(\x0b\x32-.meshtastic.ModuleConfig.RemoteHardwareConfig\x12\x42\n\rneighbor_info\x18\x0b \x01(\x0b\x32+.meshtastic.ModuleConfig.NeighborInfoConfig\x12H\n\x10\x61mbient_lighting\x18\x0c \x01(\x0b\x32..meshtastic.ModuleConfig.AmbientLightingConfig\x12H\n\x10\x64\x65tection_sensor\x18\r \x01(\x0b\x32..meshtastic.ModuleConfig.DetectionSensorConfig\x12=\n\npaxcounter\x18\x0e \x01(\x0b\x32).meshtastic.ModuleConfig.PaxcounterConfig\x12\x0f\n\x07version\x18\x08 \x01(\rBd\n\x13\x63om.geeksville.meshB\x0fLocalOnlyProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.localonly_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\017LocalOnlyProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_LOCALCONFIG._serialized_start=100
|
||||
_LOCALCONFIG._serialized_end=481
|
||||
_LOCALMODULECONFIG._serialized_start=484
|
||||
_LOCALMODULECONFIG._serialized_end=1375
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
92
meshtastic/mesh_pb2.py
Normal file
92
meshtastic/mesh_pb2.py
Normal file
File diff suppressed because one or more lines are too long
66
meshtastic/module_config_pb2.py
Normal file
66
meshtastic/module_config_pb2.py
Normal file
File diff suppressed because one or more lines are too long
30
meshtastic/mqtt_pb2.py
Normal file
30
meshtastic/mqtt_pb2.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/mqtt.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from meshtastic import config_pb2 as meshtastic_dot_config__pb2
|
||||
from meshtastic import mesh_pb2 as meshtastic_dot_mesh__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15meshtastic/mqtt.proto\x12\nmeshtastic\x1a\x17meshtastic/config.proto\x1a\x15meshtastic/mesh.proto\"a\n\x0fServiceEnvelope\x12&\n\x06packet\x18\x01 \x01(\x0b\x32\x16.meshtastic.MeshPacket\x12\x12\n\nchannel_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\"\xbc\x03\n\tMapReport\x12\x11\n\tlong_name\x18\x01 \x01(\t\x12\x12\n\nshort_name\x18\x02 \x01(\t\x12\x32\n\x04role\x18\x03 \x01(\x0e\x32$.meshtastic.Config.DeviceConfig.Role\x12+\n\x08hw_model\x18\x04 \x01(\x0e\x32\x19.meshtastic.HardwareModel\x12\x18\n\x10\x66irmware_version\x18\x05 \x01(\t\x12\x38\n\x06region\x18\x06 \x01(\x0e\x32(.meshtastic.Config.LoRaConfig.RegionCode\x12?\n\x0cmodem_preset\x18\x07 \x01(\x0e\x32).meshtastic.Config.LoRaConfig.ModemPreset\x12\x1b\n\x13has_default_channel\x18\x08 \x01(\x08\x12\x12\n\nlatitude_i\x18\t \x01(\x0f\x12\x13\n\x0blongitude_i\x18\n \x01(\x0f\x12\x10\n\x08\x61ltitude\x18\x0b \x01(\x05\x12\x1a\n\x12position_precision\x18\x0c \x01(\r\x12\x1e\n\x16num_online_local_nodes\x18\r \x01(\rB_\n\x13\x63om.geeksville.meshB\nMQTTProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.mqtt_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\nMQTTProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_SERVICEENVELOPE._serialized_start=85
|
||||
_SERVICEENVELOPE._serialized_end=182
|
||||
_MAPREPORT._serialized_start=185
|
||||
_MAPREPORT._serialized_end=629
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
26
meshtastic/paxcount_pb2.py
Normal file
26
meshtastic/paxcount_pb2.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/paxcount.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x19meshtastic/paxcount.proto\x12\nmeshtastic\"5\n\x08Paxcount\x12\x0c\n\x04wifi\x18\x01 \x01(\r\x12\x0b\n\x03\x62le\x18\x02 \x01(\r\x12\x0e\n\x06uptime\x18\x03 \x01(\rBc\n\x13\x63om.geeksville.meshB\x0ePaxcountProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.paxcount_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\016PaxcountProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_PAXCOUNT._serialized_start=41
|
||||
_PAXCOUNT._serialized_end=94
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
26
meshtastic/portnums_pb2.py
Normal file
26
meshtastic/portnums_pb2.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/portnums.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x19meshtastic/portnums.proto\x12\nmeshtastic*\x8d\x04\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\x1f\n\x1bTEXT_MESSAGE_COMPRESSED_APP\x10\x07\x12\x10\n\x0cWAYPOINT_APP\x10\x08\x12\r\n\tAUDIO_APP\x10\t\x12\x18\n\x14\x44\x45TECTION_SENSOR_APP\x10\n\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12\x12\n\x0ePAXCOUNTER_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\x11\n\rTELEMETRY_APP\x10\x43\x12\x0b\n\x07ZPS_APP\x10\x44\x12\x11\n\rSIMULATOR_APP\x10\x45\x12\x12\n\x0eTRACEROUTE_APP\x10\x46\x12\x14\n\x10NEIGHBORINFO_APP\x10G\x12\x0f\n\x0b\x41TAK_PLUGIN\x10H\x12\x12\n\x0eMAP_REPORT_APP\x10I\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]\n\x13\x63om.geeksville.meshB\x08PortnumsZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.portnums_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\010PortnumsZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_PORTNUM._serialized_start=42
|
||||
_PORTNUM._serialized_end=567
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
28
meshtastic/remote_hardware_pb2.py
Normal file
28
meshtastic/remote_hardware_pb2.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/remote_hardware.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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 meshtastic/remote_hardware.proto\x12\nmeshtastic\"\xd6\x01\n\x0fHardwareMessage\x12.\n\x04type\x18\x01 \x01(\x0e\x32 .meshtastic.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\x42\x63\n\x13\x63om.geeksville.meshB\x0eRemoteHardwareZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.remote_hardware_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\016RemoteHardwareZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_HARDWAREMESSAGE._serialized_start=49
|
||||
_HARDWAREMESSAGE._serialized_end=263
|
||||
_HARDWAREMESSAGE_TYPE._serialized_start=155
|
||||
_HARDWAREMESSAGE_TYPE._serialized_end=263
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
26
meshtastic/rtttl_pb2.py
Normal file
26
meshtastic/rtttl_pb2.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/rtttl.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x16meshtastic/rtttl.proto\x12\nmeshtastic\"\x1f\n\x0bRTTTLConfig\x12\x10\n\x08ringtone\x18\x01 \x01(\tBf\n\x13\x63om.geeksville.meshB\x11RTTTLConfigProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.rtttl_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\021RTTTLConfigProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_RTTTLCONFIG._serialized_start=38
|
||||
_RTTTLCONFIG._serialized_end=69
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
34
meshtastic/storeforward_pb2.py
Normal file
34
meshtastic/storeforward_pb2.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/storeforward.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x1dmeshtastic/storeforward.proto\x12\nmeshtastic\"\x9c\x07\n\x0fStoreAndForward\x12\x37\n\x02rr\x18\x01 \x01(\x0e\x32+.meshtastic.StoreAndForward.RequestResponse\x12\x37\n\x05stats\x18\x02 \x01(\x0b\x32&.meshtastic.StoreAndForward.StatisticsH\x00\x12\x36\n\x07history\x18\x03 \x01(\x0b\x32#.meshtastic.StoreAndForward.HistoryH\x00\x12:\n\theartbeat\x18\x04 \x01(\x0b\x32%.meshtastic.StoreAndForward.HeartbeatH\x00\x12\x0e\n\x04text\x18\x05 \x01(\x0cH\x00\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\"\xbc\x02\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\x0cROUTER_STATS\x10\x07\x12\x16\n\x12ROUTER_TEXT_DIRECT\x10\x08\x12\x19\n\x15ROUTER_TEXT_BROADCAST\x10\t\x12\x10\n\x0c\x43LIENT_ERROR\x10@\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x41\x12\x10\n\x0c\x43LIENT_STATS\x10\x42\x12\x0f\n\x0b\x43LIENT_PING\x10\x43\x12\x0f\n\x0b\x43LIENT_PONG\x10\x44\x12\x10\n\x0c\x43LIENT_ABORT\x10jB\t\n\x07variantBj\n\x13\x63om.geeksville.meshB\x15StoreAndForwardProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.storeforward_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\025StoreAndForwardProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_STOREANDFORWARD._serialized_start=46
|
||||
_STOREANDFORWARD._serialized_end=970
|
||||
_STOREANDFORWARD_STATISTICS._serialized_start=312
|
||||
_STOREANDFORWARD_STATISTICS._serialized_end=517
|
||||
_STOREANDFORWARD_HISTORY._serialized_start=519
|
||||
_STOREANDFORWARD_HISTORY._serialized_end=592
|
||||
_STOREANDFORWARD_HEARTBEAT._serialized_start=594
|
||||
_STOREANDFORWARD_HEARTBEAT._serialized_end=640
|
||||
_STOREANDFORWARD_REQUESTRESPONSE._serialized_start=643
|
||||
_STOREANDFORWARD_REQUESTRESPONSE._serialized_end=959
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
36
meshtastic/telemetry_pb2.py
Normal file
36
meshtastic/telemetry_pb2.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/telemetry.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x1ameshtastic/telemetry.proto\x12\nmeshtastic\"i\n\rDeviceMetrics\x12\x15\n\rbattery_level\x18\x01 \x01(\r\x12\x0f\n\x07voltage\x18\x02 \x01(\x02\x12\x1b\n\x13\x63hannel_utilization\x18\x03 \x01(\x02\x12\x13\n\x0b\x61ir_util_tx\x18\x04 \x01(\x02\"\x9b\x01\n\x12\x45nvironmentMetrics\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\x12\x16\n\x0egas_resistance\x18\x04 \x01(\x02\x12\x0f\n\x07voltage\x18\x05 \x01(\x02\x12\x0f\n\x07\x63urrent\x18\x06 \x01(\x02\"\x8c\x01\n\x0cPowerMetrics\x12\x13\n\x0b\x63h1_voltage\x18\x01 \x01(\x02\x12\x13\n\x0b\x63h1_current\x18\x02 \x01(\x02\x12\x13\n\x0b\x63h2_voltage\x18\x03 \x01(\x02\x12\x13\n\x0b\x63h2_current\x18\x04 \x01(\x02\x12\x13\n\x0b\x63h3_voltage\x18\x05 \x01(\x02\x12\x13\n\x0b\x63h3_current\x18\x06 \x01(\x02\"\xbf\x02\n\x11\x41irQualityMetrics\x12\x15\n\rpm10_standard\x18\x01 \x01(\r\x12\x15\n\rpm25_standard\x18\x02 \x01(\r\x12\x16\n\x0epm100_standard\x18\x03 \x01(\r\x12\x1a\n\x12pm10_environmental\x18\x04 \x01(\r\x12\x1a\n\x12pm25_environmental\x18\x05 \x01(\r\x12\x1b\n\x13pm100_environmental\x18\x06 \x01(\r\x12\x16\n\x0eparticles_03um\x18\x07 \x01(\r\x12\x16\n\x0eparticles_05um\x18\x08 \x01(\r\x12\x16\n\x0eparticles_10um\x18\t \x01(\r\x12\x16\n\x0eparticles_25um\x18\n \x01(\r\x12\x16\n\x0eparticles_50um\x18\x0b \x01(\r\x12\x17\n\x0fparticles_100um\x18\x0c \x01(\r\"\x89\x02\n\tTelemetry\x12\x0c\n\x04time\x18\x01 \x01(\x07\x12\x33\n\x0e\x64\x65vice_metrics\x18\x02 \x01(\x0b\x32\x19.meshtastic.DeviceMetricsH\x00\x12=\n\x13\x65nvironment_metrics\x18\x03 \x01(\x0b\x32\x1e.meshtastic.EnvironmentMetricsH\x00\x12<\n\x13\x61ir_quality_metrics\x18\x04 \x01(\x0b\x32\x1d.meshtastic.AirQualityMetricsH\x00\x12\x31\n\rpower_metrics\x18\x05 \x01(\x0b\x32\x18.meshtastic.PowerMetricsH\x00\x42\t\n\x07variant*\xe0\x01\n\x13TelemetrySensorType\x12\x10\n\x0cSENSOR_UNSET\x10\x00\x12\n\n\x06\x42ME280\x10\x01\x12\n\n\x06\x42ME680\x10\x02\x12\x0b\n\x07MCP9808\x10\x03\x12\n\n\x06INA260\x10\x04\x12\n\n\x06INA219\x10\x05\x12\n\n\x06\x42MP280\x10\x06\x12\t\n\x05SHTC3\x10\x07\x12\t\n\x05LPS22\x10\x08\x12\x0b\n\x07QMC6310\x10\t\x12\x0b\n\x07QMI8658\x10\n\x12\x0c\n\x08QMC5883L\x10\x0b\x12\t\n\x05SHT31\x10\x0c\x12\x0c\n\x08PMSA003I\x10\r\x12\x0b\n\x07INA3221\x10\x0e\x12\n\n\x06\x42MP085\x10\x0f\x42\x64\n\x13\x63om.geeksville.meshB\x0fTelemetryProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.telemetry_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\017TelemetryProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_TELEMETRYSENSORTYPE._serialized_start=1041
|
||||
_TELEMETRYSENSORTYPE._serialized_end=1265
|
||||
_DEVICEMETRICS._serialized_start=42
|
||||
_DEVICEMETRICS._serialized_end=147
|
||||
_ENVIRONMENTMETRICS._serialized_start=150
|
||||
_ENVIRONMENTMETRICS._serialized_end=305
|
||||
_POWERMETRICS._serialized_start=308
|
||||
_POWERMETRICS._serialized_end=448
|
||||
_AIRQUALITYMETRICS._serialized_start=451
|
||||
_AIRQUALITYMETRICS._serialized_end=770
|
||||
_TELEMETRY._serialized_start=773
|
||||
_TELEMETRY._serialized_end=1038
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
28
meshtastic/xmodem_pb2.py
Normal file
28
meshtastic/xmodem_pb2.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: meshtastic/xmodem.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
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\x17meshtastic/xmodem.proto\x12\nmeshtastic\"\xb6\x01\n\x06XModem\x12+\n\x07\x63ontrol\x18\x01 \x01(\x0e\x32\x1a.meshtastic.XModem.Control\x12\x0b\n\x03seq\x18\x02 \x01(\r\x12\r\n\x05\x63rc16\x18\x03 \x01(\r\x12\x0e\n\x06\x62uffer\x18\x04 \x01(\x0c\"S\n\x07\x43ontrol\x12\x07\n\x03NUL\x10\x00\x12\x07\n\x03SOH\x10\x01\x12\x07\n\x03STX\x10\x02\x12\x07\n\x03\x45OT\x10\x04\x12\x07\n\x03\x41\x43K\x10\x06\x12\x07\n\x03NAK\x10\x15\x12\x07\n\x03\x43\x41N\x10\x18\x12\t\n\x05\x43TRLZ\x10\x1a\x42\x61\n\x13\x63om.geeksville.meshB\x0cXmodemProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtastic.xmodem_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'\n\023com.geeksville.meshB\014XmodemProtosZ\"github.com/meshtastic/go/generated\252\002\024Meshtastic.Protobufs\272\002\000'
|
||||
_XMODEM._serialized_start=40
|
||||
_XMODEM._serialized_end=222
|
||||
_XMODEM_CONTROL._serialized_start=139
|
||||
_XMODEM_CONTROL._serialized_end=222
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
16
meshview/database.py
Normal file
16
meshview/database.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from sqlalchemy.ext.asyncio import async_sessionmaker
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from meshview import models
|
||||
|
||||
|
||||
def init_database(database_connetion_string):
|
||||
global engine, async_session
|
||||
engine = create_async_engine(database_connetion_string, echo=False)
|
||||
async_session = async_sessionmaker(engine, expire_on_commit=False)
|
||||
|
||||
|
||||
async def create_tables():
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(models.Base.metadata.create_all)
|
||||
50
meshview/decode_payload.py
Normal file
50
meshview/decode_payload.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from meshtastic.portnums_pb2 import PortNum
|
||||
from meshtastic.mesh_pb2 import (
|
||||
Position,
|
||||
NeighborInfo,
|
||||
NodeInfo,
|
||||
User,
|
||||
RouteDiscovery,
|
||||
Routing,
|
||||
MeshPacket,
|
||||
)
|
||||
from meshtastic.telemetry_pb2 import Telemetry
|
||||
from google.protobuf.message import DecodeError
|
||||
|
||||
|
||||
def text_message(payload):
|
||||
return payload.decode("utf-8")
|
||||
|
||||
|
||||
DECODE_MAP = {
|
||||
PortNum.POSITION_APP: Position.FromString,
|
||||
PortNum.NEIGHBORINFO_APP: NeighborInfo.FromString,
|
||||
PortNum.NODEINFO_APP: User.FromString,
|
||||
PortNum.TELEMETRY_APP: Telemetry.FromString,
|
||||
PortNum.TRACEROUTE_APP: RouteDiscovery.FromString,
|
||||
PortNum.ROUTING_APP: Routing.FromString,
|
||||
PortNum.TEXT_MESSAGE_APP: text_message,
|
||||
}
|
||||
|
||||
|
||||
def decode_payload(portnum, payload):
|
||||
if portnum not in DECODE_MAP:
|
||||
return None
|
||||
try:
|
||||
payload = DECODE_MAP[portnum](payload)
|
||||
except (DecodeError, UnicodeDecodeError):
|
||||
return None
|
||||
return payload
|
||||
|
||||
|
||||
def decode(packet):
|
||||
try:
|
||||
mesh_packet = MeshPacket.FromString(packet.payload)
|
||||
except DecodeError:
|
||||
return None, None
|
||||
|
||||
payload = decode_payload(mesh_packet.decoded.portnum, mesh_packet.decoded.payload)
|
||||
if payload is None:
|
||||
return mesh_packet, None
|
||||
|
||||
return mesh_packet, payload
|
||||
22
meshview/http.py
Normal file
22
meshview/http.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from aiohttp import web
|
||||
|
||||
|
||||
async def redirect(request):
|
||||
return web.Response(
|
||||
status=307,
|
||||
headers={"location": "https://meshview.armooo.net" + str(request.rel_url)},
|
||||
)
|
||||
|
||||
|
||||
async def run_server(bind, path):
|
||||
app = web.Application()
|
||||
app.add_routes(
|
||||
[
|
||||
web.static("/.well-known/acme-challenge", path),
|
||||
web.get("/{tail:.*}", redirect),
|
||||
]
|
||||
)
|
||||
runner = web.AppRunner(app)
|
||||
await runner.setup()
|
||||
site = web.TCPSite(runner, bind, 80)
|
||||
await site.start()
|
||||
51
meshview/models.py
Normal file
51
meshview/models.py
Normal file
@@ -0,0 +1,51 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy.orm import DeclarativeBase, foreign
|
||||
from sqlalchemy.ext.asyncio import AsyncAttrs
|
||||
from sqlalchemy.orm import mapped_column, relationship, Mapped
|
||||
from sqlalchemy import ForeignKey, BigInteger
|
||||
|
||||
|
||||
class Base(AsyncAttrs, DeclarativeBase):
|
||||
pass
|
||||
|
||||
|
||||
class Node(Base):
|
||||
__tablename__ = "node"
|
||||
id: Mapped[str] = mapped_column(primary_key=True)
|
||||
node_id: Mapped[int] = mapped_column(BigInteger, nullable=True, unique=True)
|
||||
long_name: Mapped[str]
|
||||
short_name: Mapped[str]
|
||||
hw_model: Mapped[str]
|
||||
|
||||
|
||||
class Packet(Base):
|
||||
__tablename__ = "packet"
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
portnum: Mapped[int]
|
||||
from_node_id: Mapped[int] = mapped_column(BigInteger)
|
||||
from_node: Mapped["Node"] = relationship(
|
||||
primaryjoin="Packet.from_node_id == foreign(Node.node_id)", lazy="joined"
|
||||
)
|
||||
to_node_id: Mapped[int] = mapped_column(BigInteger)
|
||||
to_node: Mapped["Node"] = relationship(
|
||||
primaryjoin="Packet.to_node_id == foreign(Node.node_id)", lazy="joined"
|
||||
)
|
||||
payload: Mapped[bytes]
|
||||
import_time: Mapped[datetime]
|
||||
|
||||
|
||||
class PacketSeen(Base):
|
||||
__tablename__ = "packet_seen"
|
||||
packet_id = mapped_column(ForeignKey("packet.id"), primary_key=True)
|
||||
node_id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
node: Mapped["Node"] = relationship(
|
||||
lazy="joined", primaryjoin="PacketSeen.node_id == foreign(Node.node_id)"
|
||||
)
|
||||
rx_time: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
hop_limit: Mapped[int]
|
||||
channel: Mapped[str]
|
||||
rx_snr: Mapped[float] = mapped_column(nullable=True)
|
||||
rx_rssi: Mapped[int] = mapped_column(nullable=True)
|
||||
topic: Mapped[str]
|
||||
import_time: Mapped[datetime]
|
||||
41
meshview/mqtt_reader.py
Normal file
41
meshview/mqtt_reader.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import base64
|
||||
|
||||
import aiomqtt
|
||||
from google.protobuf.message import DecodeError
|
||||
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
||||
|
||||
from meshtastic.mqtt_pb2 import ServiceEnvelope
|
||||
|
||||
KEY = base64.b64decode("1PG7OiApB1nwvP+rz05pAQ==")
|
||||
|
||||
|
||||
def decrypt(packet):
|
||||
if packet.HasField("decoded"):
|
||||
return
|
||||
packet_id = packet.id.to_bytes(8, "little")
|
||||
from_node_id = getattr(packet, "from").to_bytes(8, "little")
|
||||
nonce = packet_id + from_node_id
|
||||
|
||||
cipher = Cipher(algorithms.AES(KEY), modes.CTR(nonce))
|
||||
decryptor = cipher.decryptor()
|
||||
raw_proto = decryptor.update(packet.encrypted) + decryptor.finalize()
|
||||
try:
|
||||
packet.decoded.ParseFromString(raw_proto)
|
||||
except DecodeError:
|
||||
pass
|
||||
|
||||
|
||||
async def get_topic_envelopes(topic):
|
||||
async with aiomqtt.Client(
|
||||
"mqtt.meshtastic.org", username="meshdev", password="large4cats"
|
||||
) as client:
|
||||
await client.subscribe(topic)
|
||||
async for msg in client.messages:
|
||||
try:
|
||||
envelope = ServiceEnvelope.FromString(msg.payload)
|
||||
except DecodeError:
|
||||
continue
|
||||
decrypt(envelope.packet)
|
||||
if not envelope.packet.decoded:
|
||||
continue
|
||||
yield msg.topic.value, envelope
|
||||
59
meshview/notify.py
Normal file
59
meshview/notify.py
Normal file
@@ -0,0 +1,59 @@
|
||||
import contextlib
|
||||
from collections import defaultdict
|
||||
import asyncio
|
||||
|
||||
waiting_node_ids_events = defaultdict(set)
|
||||
|
||||
|
||||
class NodeEvent:
|
||||
def __init__(self, node_id):
|
||||
self.node_id = node_id
|
||||
self.event = asyncio.Event()
|
||||
self.packets = []
|
||||
self.uplinked = []
|
||||
|
||||
async def wait(self):
|
||||
await self.event.wait()
|
||||
|
||||
def set(self):
|
||||
return self.event.set()
|
||||
|
||||
def is_set(self):
|
||||
return self.event.is_set()
|
||||
|
||||
def clear(self):
|
||||
del self.packets[:]
|
||||
del self.uplinked[:]
|
||||
return self.event.clear()
|
||||
|
||||
|
||||
def create_event(node_id):
|
||||
event = NodeEvent(node_id)
|
||||
waiting_node_ids_events[node_id].add(event)
|
||||
return event
|
||||
|
||||
|
||||
def remove_event(node_event):
|
||||
print("removing event")
|
||||
waiting_node_ids_events[node_event.node_id].remove(node_event)
|
||||
|
||||
|
||||
def notify_packet(node_id, packet):
|
||||
for event in waiting_node_ids_events[node_id]:
|
||||
event.packets.append(packet)
|
||||
event.set()
|
||||
|
||||
|
||||
def notify_uplinked(node_id, packet):
|
||||
for event in waiting_node_ids_events[node_id]:
|
||||
event.uplinked.append(packet)
|
||||
event.set()
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def subscribe(node_id):
|
||||
event = create_event(node_id)
|
||||
try:
|
||||
yield event
|
||||
finally:
|
||||
remove_event(event)
|
||||
157
meshview/store.py
Normal file
157
meshview/store.py
Normal file
@@ -0,0 +1,157 @@
|
||||
import datetime
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
from meshtastic.portnums_pb2 import PortNum
|
||||
from meshtastic.mesh_pb2 import User, HardwareModel
|
||||
from meshview import database
|
||||
from meshview import decode_payload
|
||||
from meshview.models import Packet, PacketSeen, Node
|
||||
from meshview import notify
|
||||
|
||||
|
||||
async def process_envelope(topic, env):
|
||||
if not env.packet.id:
|
||||
return
|
||||
|
||||
async with database.async_session() as session:
|
||||
result = await session.execute(select(Packet).where(Packet.id == env.packet.id))
|
||||
if not result.scalar_one_or_none():
|
||||
new_packet = True
|
||||
packet = Packet(
|
||||
id=env.packet.id,
|
||||
portnum=env.packet.decoded.portnum,
|
||||
from_node_id=getattr(env.packet, "from"),
|
||||
to_node_id=env.packet.to,
|
||||
payload=env.packet.SerializeToString(),
|
||||
import_time=datetime.datetime.utcnow(),
|
||||
)
|
||||
session.add(packet)
|
||||
else:
|
||||
packet = None
|
||||
result = await session.execute(
|
||||
select(PacketSeen).where(
|
||||
PacketSeen.packet_id == env.packet.id,
|
||||
PacketSeen.node_id == int(env.gateway_id[1:], 16),
|
||||
PacketSeen.rx_time == env.packet.rx_time,
|
||||
)
|
||||
)
|
||||
seen = None
|
||||
if not result.scalar_one_or_none():
|
||||
seen = PacketSeen(
|
||||
packet_id=env.packet.id,
|
||||
node_id=int(env.gateway_id[1:], 16),
|
||||
channel=env.channel_id,
|
||||
rx_time=env.packet.rx_time,
|
||||
rx_snr=env.packet.rx_snr,
|
||||
rx_rssi=env.packet.rx_rssi,
|
||||
hop_limit=env.packet.hop_limit,
|
||||
topic=topic,
|
||||
import_time=datetime.datetime.utcnow(),
|
||||
)
|
||||
session.add(seen)
|
||||
|
||||
if env.packet.decoded.portnum == PortNum.NODEINFO_APP:
|
||||
user = decode_payload.decode_payload(
|
||||
PortNum.NODEINFO_APP, env.packet.decoded.payload
|
||||
)
|
||||
if user:
|
||||
result = await session.execute(select(Node).where(Node.id == user.id))
|
||||
if user.id and user.id[0] == "!":
|
||||
try:
|
||||
node_id = int(user.id[1:], 16)
|
||||
except ValueError:
|
||||
node_id = None
|
||||
pass
|
||||
else:
|
||||
node_id = None
|
||||
|
||||
try:
|
||||
hw_model = HardwareModel.Name(user.hw_model)
|
||||
except ValueError:
|
||||
hw_model = "unknown"
|
||||
|
||||
if node := result.scalar_one_or_none():
|
||||
node.node_id = node_id
|
||||
node.long_name = user.long_name
|
||||
node.short_name = user.short_name
|
||||
node.hw_model = hw_model
|
||||
else:
|
||||
node = Node(
|
||||
id=user.id,
|
||||
node_id=node_id,
|
||||
long_name=user.long_name,
|
||||
short_name=user.short_name,
|
||||
hw_model=hw_model,
|
||||
)
|
||||
session.add(node)
|
||||
|
||||
await session.commit()
|
||||
if packet:
|
||||
await packet.awaitable_attrs.to_node
|
||||
await packet.awaitable_attrs.from_node
|
||||
notify.notify_packet(packet.to_node_id, packet)
|
||||
notify.notify_packet(packet.from_node_id, packet)
|
||||
notify.notify_packet(None, packet)
|
||||
if seen:
|
||||
notify.notify_uplinked(seen.node_id, packet)
|
||||
|
||||
|
||||
async def get_node(node_id):
|
||||
async with database.async_session() as session:
|
||||
result = await session.execute(select(Node).where(Node.node_id == node_id))
|
||||
return result.scalar_one_or_none()
|
||||
|
||||
|
||||
async def get_fuzzy_nodes(query):
|
||||
async with database.async_session() as session:
|
||||
q = select(Node).where(
|
||||
Node.id.ilike(query + "%")
|
||||
| Node.long_name.ilike(query + "%")
|
||||
| Node.short_name.ilike(query + "%")
|
||||
)
|
||||
result = await session.execute(q)
|
||||
return result.scalars()
|
||||
|
||||
|
||||
async def get_packets(node_id=None, portnum=None):
|
||||
async with database.async_session() as session:
|
||||
q = select(Packet)
|
||||
|
||||
if node_id:
|
||||
q = q.where(
|
||||
(Packet.from_node_id == node_id) | (Packet.to_node_id == node_id)
|
||||
)
|
||||
if portnum:
|
||||
q = q.where(Packet.portnum == portnum)
|
||||
result = await session.execute(q.limit(500).order_by(Packet.import_time.desc()))
|
||||
return result.scalars()
|
||||
|
||||
|
||||
async def get_packet(packet_id):
|
||||
async with database.async_session() as session:
|
||||
q = select(Packet).where(Packet.id == packet_id)
|
||||
result = await session.execute(q)
|
||||
return result.scalar_one_or_none()
|
||||
|
||||
|
||||
async def get_uplinked_packets(node_id):
|
||||
async with database.async_session() as session:
|
||||
result = await session.execute(
|
||||
select(Packet)
|
||||
.join(PacketSeen)
|
||||
.where(PacketSeen.node_id == node_id)
|
||||
.order_by(Packet.import_time.desc())
|
||||
.limit(500)
|
||||
)
|
||||
return result.scalars()
|
||||
|
||||
|
||||
async def get_packets_seen(packet_id):
|
||||
async with database.async_session() as session:
|
||||
result = await session.execute(
|
||||
select(PacketSeen)
|
||||
.where(PacketSeen.packet_id == packet_id)
|
||||
.order_by(PacketSeen.import_time.desc())
|
||||
)
|
||||
return result.scalars()
|
||||
30
meshview/templates/base.html
Normal file
30
meshview/templates/base.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>MeshView {% if node and node.short_name %}-- {{node.short_name}}{% endif %}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://unpkg.com/htmx.org@1.9.11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/sse.js" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<style>
|
||||
.htmx-indicator{
|
||||
opacity:0;
|
||||
transition: opacity 500ms ease-in;
|
||||
}
|
||||
.htmx-request .htmx-indicator{
|
||||
opacity:1
|
||||
}
|
||||
{% block css %}
|
||||
{% endblock %}
|
||||
</style>
|
||||
</head>
|
||||
<body hx-indicator="#spinner">
|
||||
<div id="spinner" class="spinner-border secondary-primary htmx-indicator position-absolute top-50 start-50" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
16
meshview/templates/buttons.html
Normal file
16
meshview/templates/buttons.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<div id="buttons" class="btn-group" role="group">
|
||||
<a
|
||||
role="button"
|
||||
class="btn {{ 'btn-primary' if packet_event == 'packet' else 'btn-secondary'}}"
|
||||
href="/packet_list/{{node_id}}"
|
||||
>
|
||||
TX/RX
|
||||
</a>
|
||||
<a
|
||||
role="button"
|
||||
class="btn {{ 'btn-primary' if packet_event == 'uplinked' else 'btn-secondary'}}"
|
||||
href="/uplinked_list/{{node_id}}"
|
||||
>
|
||||
Uplinked
|
||||
</a>
|
||||
</div>
|
||||
24
meshview/templates/chat.html
Normal file
24
meshview/templates/chat.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block css %}
|
||||
.timestamp {
|
||||
min-width:10em;
|
||||
}
|
||||
.chat-packet:nth-of-type(odd){
|
||||
background-color:#CCC;
|
||||
}
|
||||
.chat-packet:nth-of-type(even){
|
||||
background-color:#EEE;
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<div class="container" hx-ext="sse" sse-connect="/chat_events" sse-swap="chat_packet" hx-swap="afterbegin">
|
||||
{% for packet in packets %}
|
||||
{% include 'chat_packet.html' %}
|
||||
{% else %}
|
||||
No packets found.
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
5
meshview/templates/chat_packet.html
Normal file
5
meshview/templates/chat_packet.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="row chat-packet">
|
||||
<span class="col-2 timestamp">{{packet.import_time | format_timestamp}}</span>
|
||||
<span class="col-3 username">{{packet.from_node.long_name or (packet.from_node_id | node_id_to_hex) }}</span>
|
||||
<span class="col message">{{packet.payload}}</span>
|
||||
</div>
|
||||
7
meshview/templates/datalist.html
Normal file
7
meshview/templates/datalist.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<datalist
|
||||
id="node_options"
|
||||
>
|
||||
{% for option in node_options %}
|
||||
<option value="{{option.id}}">{{option.id}} -- {{option.long_name}} ({{option.short_name}})</option)>
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
16
meshview/templates/firehose.html
Normal file
16
meshview/templates/firehose.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container" hx-ext="sse" sse-connect="/events">
|
||||
<div class="row">
|
||||
<div class="col-6" id="packet_list" sse-swap="packet" hx-swap="afterbegin">
|
||||
{% for packet in packets %}
|
||||
{% include 'packet.html' %}
|
||||
{% else %}
|
||||
No packets found.
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-6 sticky-top" id="packet_details" style="height: 95vh; overflow: scroll">
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
7
meshview/templates/index.html
Normal file
7
meshview/templates/index.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
{% include "search_form.html" %}
|
||||
<p><a href="/chat">See what people are saying</a></p>
|
||||
<p><a href="/firehose">See <strong>everything</strong></a></p>
|
||||
{% endblock %}
|
||||
47
meshview/templates/node.html
Normal file
47
meshview/templates/node.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
{% include "search_form.html" %}
|
||||
<div id="node" class="container text-center">
|
||||
<div class="container"
|
||||
{% if node %}
|
||||
hx-ext="sse"
|
||||
sse-connect="/events?node_id={{node_id}}{% if portnum %}&portnum={{portnum}}{% endif %}">
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card text-white bg-primary mb-3" id="node_info">
|
||||
{% if node %}
|
||||
<div class="card-header">
|
||||
{{node.long_name}} ({{node.node_id|node_id_to_hex}})
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="card-body">
|
||||
<dt>short name</dt>
|
||||
<dd>{{node.short_name}}</dd>
|
||||
<dt>hw model</dt>
|
||||
<dd>{{node.hw_model}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card-body">
|
||||
A NodeInfo has not been seen.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% include "buttons.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{% include 'packet_list.html' %}
|
||||
<div class="col-6 sticky-top" id="packet_details" style="height: 95vh; overflow: scroll">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
50
meshview/templates/packet.html
Normal file
50
meshview/templates/packet.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<div class="card mt-1">
|
||||
<div class="card-header">
|
||||
{% set from_me = packet.from_node_id == node_id %}
|
||||
{% set to_me = packet.to_node_id == node_id %}
|
||||
<span {% if from_me %} class="fw-bold" {% endif %}>
|
||||
{{packet.from_node.long_name}}(
|
||||
{%- if not from_me -%}
|
||||
<a hx-target="#node" href="/node_search?q={{packet.from_node_id|node_id_to_hex}}">
|
||||
{%- endif -%}
|
||||
{{packet.from_node_id|node_id_to_hex}}
|
||||
{%- if not from_me -%}
|
||||
</a>
|
||||
{%- endif -%}
|
||||
)
|
||||
</span>
|
||||
->
|
||||
<span {% if to_me %} class="fw-bold" {% endif %}>
|
||||
{{packet.to_node.long_name}}(
|
||||
{%- if not to_me -%}
|
||||
<a hx-target="#node" href="/node_search?q={{packet.to_node_id|node_id_to_hex}}">
|
||||
{%- endif -%}
|
||||
{{packet.to_node_id|node_id_to_hex}}
|
||||
{%- if not to_me -%}
|
||||
</a>
|
||||
{%- endif -%}
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-title">
|
||||
<a hx-boost="false" href="#" hx-target="#packet_details" hx-get="/packet_details/{{packet.id}}" hx-swap="innerHTML scroll:top">{{packet.id}}</a>
|
||||
</div>
|
||||
<div class="card-text text-start">
|
||||
<dl>
|
||||
<dt>import_time</dt>
|
||||
<dd>{{packet.import_time | format_timestamp}}</dd>
|
||||
<dt>packet</dt>
|
||||
<dd><pre>{{packet.data}}</pre></dd>
|
||||
<dt>payload</dt>
|
||||
<dd>
|
||||
{% if packet.pretty_payload %}
|
||||
<div>{{packet.pretty_payload}}<div>
|
||||
{% endif %}
|
||||
<pre>{{packet.payload}}</pre>
|
||||
</dd>
|
||||
</dl>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
31
meshview/templates/packet_details.html
Normal file
31
meshview/templates/packet_details.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% for seen in packets_seen %}
|
||||
<div class="card mt-2">
|
||||
<div class="card-header">
|
||||
{{seen.node.long_name}}(
|
||||
<a hx-target="#node" href="/node_search?q={{seen.node_id|node_id_to_hex}}">
|
||||
{{seen.node_id|node_id_to_hex}}
|
||||
</a>
|
||||
)
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-text text-start">
|
||||
<dl>
|
||||
<dt>import_time</dt>
|
||||
<dd>{{seen.import_time|format_timestamp}}</dd>
|
||||
<dt>rx_time</dt>
|
||||
<dd>{{seen.rx_time|format_timestamp}}</dd>
|
||||
<dt>hop_limit</dt>
|
||||
<dd>{{seen.hop_limit}}</dd>
|
||||
<dt>channel</dt>
|
||||
<dd>{{seen.channel}}</dd>
|
||||
<dt>rx_snr</dt>
|
||||
<dd>{{seen.rx_snr}}</dd>
|
||||
<dt>rx_rssi</dt>
|
||||
<dd>{{seen.rx_rssi}}</dd>
|
||||
<dt>topic</dt>
|
||||
<dd>{{seen.topic}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
7
meshview/templates/packet_index.html
Normal file
7
meshview/templates/packet_index.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
{% include 'packet.html' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
7
meshview/templates/packet_list.html
Normal file
7
meshview/templates/packet_list.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="col-6" id="packet_list" sse-swap="{{packet_event | default('packet')}}" hx-swap="afterbegin">
|
||||
{% for packet in packets %}
|
||||
{% include 'packet.html' %}
|
||||
{% else %}
|
||||
No packets found.
|
||||
{% endfor %}
|
||||
</div>
|
||||
23
meshview/templates/search_form.html
Normal file
23
meshview/templates/search_form.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<form
|
||||
class="container-fluid p-2 sticky-top mx-auto"
|
||||
id="search_form"
|
||||
style="width: 80%;"
|
||||
action="/node_search"
|
||||
>
|
||||
<input
|
||||
id="q"
|
||||
type="text"
|
||||
name="q"
|
||||
placeholder="Node id"
|
||||
autocomplete="off"
|
||||
size="100"
|
||||
list="node_options"
|
||||
value="{{raw_node_id}}"
|
||||
hx-trigger="keyup delay:100ms"
|
||||
hx-get="/node_match"
|
||||
hx-target="#node_options"
|
||||
/>
|
||||
{% include "datalist.html" %}
|
||||
<input type="submit"/>
|
||||
<input type="reset"/>
|
||||
</form>
|
||||
382
meshview/web.py
Normal file
382
meshview/web.py
Normal file
@@ -0,0 +1,382 @@
|
||||
import asyncio
|
||||
from dataclasses import dataclass
|
||||
import datetime
|
||||
from aiohttp_sse import sse_response
|
||||
import ssl
|
||||
|
||||
from aiohttp import web
|
||||
from markupsafe import Markup
|
||||
from jinja2 import Environment, PackageLoader, select_autoescape
|
||||
from google.protobuf import text_format
|
||||
from google.protobuf.message import Message
|
||||
|
||||
from meshtastic.portnums_pb2 import PortNum
|
||||
from meshview import store
|
||||
from meshview import models
|
||||
from meshview import decode_payload
|
||||
from meshview import notify
|
||||
|
||||
env = Environment(loader=PackageLoader("meshview"), autoescape=select_autoescape())
|
||||
|
||||
|
||||
def node_id_to_hex(node_id):
|
||||
if node_id == 4294967295:
|
||||
return "^all"
|
||||
else:
|
||||
return f"!{hex(node_id)[2:]}"
|
||||
|
||||
|
||||
def format_timestamp(timestamp):
|
||||
if isinstance(timestamp, int):
|
||||
timestamp = datetime.datetime.fromtimestamp(timestamp, datetime.timezone.utc)
|
||||
return timestamp.isoformat(timespec="seconds")
|
||||
|
||||
|
||||
env.filters["node_id_to_hex"] = node_id_to_hex
|
||||
env.filters["format_timestamp"] = format_timestamp
|
||||
|
||||
|
||||
routes = web.RouteTableDef()
|
||||
|
||||
|
||||
@routes.get("/")
|
||||
async def index(request):
|
||||
template = env.get_template("index.html")
|
||||
return web.Response(
|
||||
text=template.render(is_hx_request="HX-Request" in request.headers, node=None),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Packet:
|
||||
id: int
|
||||
from_node_id: int
|
||||
from_node: models.Node
|
||||
to_node_id: int
|
||||
to_node: models.Node
|
||||
data: str
|
||||
payload: str
|
||||
pretty_payload: Markup
|
||||
import_time: datetime.datetime
|
||||
|
||||
@classmethod
|
||||
def from_model(cls, packet):
|
||||
mesh_packet, payload = decode_payload.decode(packet)
|
||||
|
||||
pretty_payload = None
|
||||
|
||||
if mesh_packet:
|
||||
mesh_packet.decoded.payload = b""
|
||||
text_mesh_packet = text_format.MessageToString(mesh_packet)
|
||||
else:
|
||||
text_mesh_packet = "Did node decode"
|
||||
|
||||
if payload is None:
|
||||
text_payload = "Did not decode"
|
||||
elif isinstance(payload, Message):
|
||||
text_payload = text_format.MessageToString(payload)
|
||||
elif (
|
||||
packet.portnum == PortNum.TEXT_MESSAGE_APP
|
||||
and packet.to_node_id != 0xFFFFFFFF
|
||||
):
|
||||
text_payload = "<redacted>"
|
||||
else:
|
||||
text_payload = payload
|
||||
|
||||
if payload:
|
||||
if (
|
||||
packet.portnum == PortNum.POSITION_APP
|
||||
and payload.latitude_i
|
||||
and payload.longitude_i
|
||||
):
|
||||
pretty_payload = Markup(
|
||||
f'<a href="https://www.google.com/maps/search/?api=1&query={payload.latitude_i * 1e-7},{payload.longitude_i * 1e-7}" target="_blank">map</a>'
|
||||
)
|
||||
|
||||
return cls(
|
||||
id=packet.id,
|
||||
from_node=packet.from_node,
|
||||
from_node_id=packet.from_node_id,
|
||||
to_node=packet.to_node,
|
||||
to_node_id=packet.to_node_id,
|
||||
data=text_mesh_packet,
|
||||
payload=text_payload,
|
||||
pretty_payload=pretty_payload,
|
||||
import_time=packet.import_time,
|
||||
)
|
||||
|
||||
|
||||
def generate_responce(request, body, raw_node_id="", node=None):
|
||||
if "HX-Request" in request.headers:
|
||||
return web.Response(text=body, content_type="text/html")
|
||||
|
||||
template = env.get_template("index.html")
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
is_hx_request="HX-Request" in request.headers,
|
||||
raw_node_id=raw_node_id,
|
||||
node_html=Markup(body),
|
||||
node=node,
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/node_search")
|
||||
async def node_search(request):
|
||||
if not "q" in request.query or not request.query["q"]:
|
||||
return web.Response(text="Bad node id")
|
||||
portnum = request.query.get("portnum")
|
||||
if portnum:
|
||||
portnum = int(portnum)
|
||||
raw_node_id = request.query["q"]
|
||||
|
||||
node_id = None
|
||||
if raw_node_id == "^all":
|
||||
node_id = 0xFFFFFFFF
|
||||
elif raw_node_id[0] == "!":
|
||||
try:
|
||||
node_id = int(raw_node_id[1:], 16)
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
node_id = int(raw_node_id)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
if node_id:
|
||||
node_task = tg.create_task(store.get_node(node_id))
|
||||
packets_task = tg.create_task(store.get_packets(node_id, portnum=portnum))
|
||||
else:
|
||||
loop = asyncio.get_running_loop()
|
||||
node_task = loop.create_future()
|
||||
node_task.set_result(None)
|
||||
packets_task = loop.create_future()
|
||||
packets_task.set_result(())
|
||||
node_options_task = tg.create_task(store.get_fuzzy_nodes(raw_node_id))
|
||||
|
||||
packets = (Packet.from_model(p) for p in packets_task.result())
|
||||
template = env.get_template("node.html")
|
||||
options = list(node_options_task.result())
|
||||
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
raw_node_id=raw_node_id,
|
||||
node_id=node_id,
|
||||
node=node_task.result(),
|
||||
packets=packets,
|
||||
packet_event="packet",
|
||||
node_options=options,
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/node_match")
|
||||
async def node_match(request):
|
||||
if not "q" in request.query or not request.query["q"]:
|
||||
return web.Response(text="Bad node id")
|
||||
raw_node_id = request.query["q"]
|
||||
node_options = await store.get_fuzzy_nodes(raw_node_id)
|
||||
|
||||
template = env.get_template("datalist.html")
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
node_options=node_options,
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/packet_list/{node_id}")
|
||||
async def packet_list(request):
|
||||
node_id = int(request.match_info["node_id"])
|
||||
raw_packets = await store.get_packets(node_id)
|
||||
packets = (Packet.from_model(p) for p in raw_packets)
|
||||
|
||||
template = env.get_template("node.html")
|
||||
node = await store.get_node(node_id)
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
raw_node_id=node_id_to_hex(node_id),
|
||||
node_id=node_id,
|
||||
node=node,
|
||||
packets=packets,
|
||||
packet_event="packet",
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/uplinked_list/{node_id}")
|
||||
async def uplinked_list(request):
|
||||
node_id = int(request.match_info["node_id"])
|
||||
raw_packets = await store.get_uplinked_packets(node_id)
|
||||
packets = (Packet.from_model(p) for p in raw_packets)
|
||||
|
||||
node = await store.get_node(node_id)
|
||||
template = env.get_template("node.html")
|
||||
node_html = template.render()
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
raw_node_id=node_id_to_hex(node_id),
|
||||
node_id=node_id,
|
||||
node=node,
|
||||
packets=packets,
|
||||
packet_event="uplinked",
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/chat_events")
|
||||
async def chat_events(request):
|
||||
chat_packet = env.get_template("chat_packet.html")
|
||||
|
||||
with notify.subscribe(node_id=0xFFFFFFFF) as event:
|
||||
async with sse_response(request) as resp:
|
||||
while resp.is_connected():
|
||||
try:
|
||||
async with asyncio.timeout(10):
|
||||
await event.wait()
|
||||
except TimeoutError:
|
||||
continue
|
||||
if event.is_set():
|
||||
packets = [
|
||||
p
|
||||
for p in event.packets
|
||||
if PortNum.TEXT_MESSAGE_APP == p.portnum
|
||||
]
|
||||
event.clear()
|
||||
try:
|
||||
for packet in packets:
|
||||
await resp.send(
|
||||
chat_packet.render(
|
||||
packet=Packet.from_model(packet),
|
||||
),
|
||||
event="chat_packet",
|
||||
)
|
||||
except ConnectionResetError:
|
||||
return
|
||||
|
||||
|
||||
@routes.get("/events")
|
||||
async def events(request):
|
||||
node_id = request.query.get("node_id")
|
||||
if node_id:
|
||||
node_id = int(node_id)
|
||||
portnum = request.query.get("portnum")
|
||||
if portnum:
|
||||
portnum = int(portnum)
|
||||
|
||||
packet_template = env.get_template("packet.html")
|
||||
with notify.subscribe(node_id) as event:
|
||||
async with sse_response(request) as resp:
|
||||
while resp.is_connected():
|
||||
try:
|
||||
async with asyncio.timeout(10):
|
||||
await event.wait()
|
||||
except TimeoutError:
|
||||
continue
|
||||
if event.is_set():
|
||||
packets = [
|
||||
p
|
||||
for p in event.packets
|
||||
if portnum is None or portnum == p.portnum
|
||||
]
|
||||
uplinked = [
|
||||
u
|
||||
for u in event.uplinked
|
||||
if portnum is None or portnum == p.portnum
|
||||
]
|
||||
event.clear()
|
||||
try:
|
||||
for packet in packets:
|
||||
await resp.send(
|
||||
packet_template.render(
|
||||
is_hx_request="HX-Request" in request.headers,
|
||||
node_id=node_id,
|
||||
packet=Packet.from_model(packet),
|
||||
),
|
||||
event="packet",
|
||||
)
|
||||
for packet in uplinked:
|
||||
await resp.send(
|
||||
packet_template.render(
|
||||
is_hx_request="HX-Request" in request.headers,
|
||||
node_id=node_id,
|
||||
packet=Packet.from_model(packet),
|
||||
),
|
||||
event="uplinked",
|
||||
)
|
||||
except ConnectionResetError:
|
||||
return
|
||||
|
||||
|
||||
@routes.get("/packet_details/{packet_id}")
|
||||
async def packet_details(request):
|
||||
packets_seen = await store.get_packets_seen(int(request.match_info["packet_id"]))
|
||||
template = env.get_template("packet_details.html")
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
is_hx_request="HX-Request" in request.headers, packets_seen=packets_seen
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/firehose")
|
||||
async def packet_details(request):
|
||||
packets = await store.get_packets()
|
||||
template = env.get_template("firehose.html")
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
packets=(Packet.from_model(p) for p in packets),
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/chat")
|
||||
async def chat(request):
|
||||
packets = await store.get_packets(
|
||||
node_id=0xFFFFFFFF, portnum=PortNum.TEXT_MESSAGE_APP
|
||||
)
|
||||
template = env.get_template("chat.html")
|
||||
return web.Response(
|
||||
text=template.render(
|
||||
packets=(Packet.from_model(p) for p in packets),
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
@routes.get("/packet/{packet_id}")
|
||||
async def packet(request):
|
||||
packet = await store.get_packet(int(request.match_info["packet_id"]))
|
||||
print(packet)
|
||||
template = env.get_template("packet_index.html")
|
||||
return web.Response(
|
||||
text=template.render(packet=Packet.from_model(packet)),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
|
||||
async def run_server(bind, port, tls_cert):
|
||||
app = web.Application()
|
||||
app.add_routes(routes)
|
||||
runner = web.AppRunner(app)
|
||||
await runner.setup()
|
||||
if tls_cert:
|
||||
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
|
||||
ssl_context.load_cert_chain(tls_cert)
|
||||
else:
|
||||
ssl_context = None
|
||||
site = web.TCPSite(runner, bind, port, ssl_context=ssl_context)
|
||||
await site.start()
|
||||
|
||||
while True:
|
||||
await asyncio.sleep(3600) # sleep forever
|
||||
674
proto_def/LICENSE
Normal file
674
proto_def/LICENSE
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
12
proto_def/meshtastic/admin.options
Normal file
12
proto_def/meshtastic/admin.options
Normal file
@@ -0,0 +1,12 @@
|
||||
*AdminMessage.payload_variant anonymous_oneof:true
|
||||
|
||||
*AdminMessage.set_canned_message_module_messages max_size:201
|
||||
*AdminMessage.get_canned_message_module_messages_response max_size:201
|
||||
*AdminMessage.delete_file_request max_size:201
|
||||
|
||||
*AdminMessage.set_ringtone_message max_size:231
|
||||
*AdminMessage.get_ringtone_response max_size:231
|
||||
|
||||
*HamParameters.call_sign max_size:8
|
||||
*HamParameters.short_name max_size:6
|
||||
*NodeRemoteHardwarePinsResponse.node_remote_hardware_pins max_count:16
|
||||
383
proto_def/meshtastic/admin.proto
Normal file
383
proto_def/meshtastic/admin.proto
Normal file
@@ -0,0 +1,383 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/channel.proto";
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/connection_status.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
import "meshtastic/module_config.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "AdminProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
||||
* This message is used to do settings operations to both remote AND local nodes.
|
||||
* (Prior to 1.2 these operations were done via special ToRadio operations)
|
||||
*/
|
||||
message AdminMessage {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum ConfigType {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DEVICE_CONFIG = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
POSITION_CONFIG = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
POWER_CONFIG = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NETWORK_CONFIG = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DISPLAY_CONFIG = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
LORA_CONFIG = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
BLUETOOTH_CONFIG = 6;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum ModuleConfigType {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
MQTT_CONFIG = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
SERIAL_CONFIG = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
EXTNOTIF_CONFIG = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
STOREFORWARD_CONFIG = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RANGETEST_CONFIG = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
TELEMETRY_CONFIG = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
CANNEDMSG_CONFIG = 6;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AUDIO_CONFIG = 7;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
REMOTEHARDWARE_CONFIG = 8;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NEIGHBORINFO_CONFIG = 9;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AMBIENTLIGHTING_CONFIG = 10;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DETECTIONSENSOR_CONFIG = 11;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
PAXCOUNTER_CONFIG = 12;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
oneof payload_variant {
|
||||
/*
|
||||
* Send the specified channel in the response to this message
|
||||
* NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
|
||||
*/
|
||||
uint32 get_channel_request = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Channel get_channel_response = 2;
|
||||
|
||||
/*
|
||||
* Send the current owner data in the response to this message.
|
||||
*/
|
||||
bool get_owner_request = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
User get_owner_response = 4;
|
||||
|
||||
/*
|
||||
* Ask for the following config data to be sent
|
||||
*/
|
||||
ConfigType get_config_request = 5;
|
||||
|
||||
/*
|
||||
* Send the current Config in the response to this message.
|
||||
*/
|
||||
Config get_config_response = 6;
|
||||
|
||||
/*
|
||||
* Ask for the following config data to be sent
|
||||
*/
|
||||
ModuleConfigType get_module_config_request = 7;
|
||||
|
||||
/*
|
||||
* Send the current Config in the response to this message.
|
||||
*/
|
||||
ModuleConfig get_module_config_response = 8;
|
||||
|
||||
/*
|
||||
* Get the Canned Message Module messages in the response to this message.
|
||||
*/
|
||||
bool get_canned_message_module_messages_request = 10;
|
||||
|
||||
/*
|
||||
* Get the Canned Message Module messages in the response to this message.
|
||||
*/
|
||||
string get_canned_message_module_messages_response = 11;
|
||||
|
||||
/*
|
||||
* Request the node to send device metadata (firmware, protobuf version, etc)
|
||||
*/
|
||||
bool get_device_metadata_request = 12;
|
||||
|
||||
/*
|
||||
* Device metadata response
|
||||
*/
|
||||
DeviceMetadata get_device_metadata_response = 13;
|
||||
|
||||
/*
|
||||
* Get the Ringtone in the response to this message.
|
||||
*/
|
||||
bool get_ringtone_request = 14;
|
||||
|
||||
/*
|
||||
* Get the Ringtone in the response to this message.
|
||||
*/
|
||||
string get_ringtone_response = 15;
|
||||
|
||||
/*
|
||||
* Request the node to send it's connection status
|
||||
*/
|
||||
bool get_device_connection_status_request = 16;
|
||||
|
||||
/*
|
||||
* Device connection status response
|
||||
*/
|
||||
DeviceConnectionStatus get_device_connection_status_response = 17;
|
||||
|
||||
/*
|
||||
* Setup a node for licensed amateur (ham) radio operation
|
||||
*/
|
||||
HamParameters set_ham_mode = 18;
|
||||
|
||||
/*
|
||||
* Get the mesh's nodes with their available gpio pins for RemoteHardware module use
|
||||
*/
|
||||
bool get_node_remote_hardware_pins_request = 19;
|
||||
|
||||
/*
|
||||
* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
|
||||
*/
|
||||
NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response = 20;
|
||||
|
||||
/*
|
||||
* Enter (UF2) DFU mode
|
||||
* Only implemented on NRF52 currently
|
||||
*/
|
||||
bool enter_dfu_mode_request = 21;
|
||||
|
||||
/*
|
||||
* Delete the file by the specified path from the device
|
||||
*/
|
||||
string delete_file_request = 22;
|
||||
|
||||
/*
|
||||
* Set the owner for this node
|
||||
*/
|
||||
User set_owner = 32;
|
||||
|
||||
/*
|
||||
* Set channels (using the new API).
|
||||
* A special channel is the "primary channel".
|
||||
* The other records are secondary channels.
|
||||
* Note: only one channel can be marked as primary.
|
||||
* If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically.
|
||||
*/
|
||||
Channel set_channel = 33;
|
||||
|
||||
/*
|
||||
* Set the current Config
|
||||
*/
|
||||
Config set_config = 34;
|
||||
|
||||
/*
|
||||
* Set the current Config
|
||||
*/
|
||||
ModuleConfig set_module_config = 35;
|
||||
|
||||
/*
|
||||
* Set the Canned Message Module messages text.
|
||||
*/
|
||||
string set_canned_message_module_messages = 36;
|
||||
|
||||
/*
|
||||
* Set the ringtone for ExternalNotification.
|
||||
*/
|
||||
string set_ringtone_message = 37;
|
||||
|
||||
/*
|
||||
* Remove the node by the specified node-num from the NodeDB on the device
|
||||
*/
|
||||
uint32 remove_by_nodenum = 38;
|
||||
|
||||
/*
|
||||
* Set specified node-num to be favorited on the NodeDB on the device
|
||||
*/
|
||||
uint32 set_favorite_node = 39;
|
||||
|
||||
/*
|
||||
* Set specified node-num to be un-favorited on the NodeDB on the device
|
||||
*/
|
||||
uint32 remove_favorite_node = 40;
|
||||
|
||||
/*
|
||||
* Set fixed position data on the node and then set the position.fixed_position = true
|
||||
*/
|
||||
Position set_fixed_position = 41;
|
||||
|
||||
/*
|
||||
* Clear fixed position coordinates and then set position.fixed_position = false
|
||||
*/
|
||||
bool remove_fixed_position = 42;
|
||||
|
||||
/*
|
||||
* Begins an edit transaction for config, module config, owner, and channel settings changes
|
||||
* This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
|
||||
*/
|
||||
bool begin_edit_settings = 64;
|
||||
|
||||
/*
|
||||
* Commits an open transaction for any edits made to config, module config, owner, and channel settings
|
||||
*/
|
||||
bool commit_edit_settings = 65;
|
||||
|
||||
/*
|
||||
* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
|
||||
* Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth.
|
||||
*/
|
||||
int32 reboot_ota_seconds = 95;
|
||||
|
||||
/*
|
||||
* This message is only supported for the simulator Portduino build.
|
||||
* If received the simulator will exit successfully.
|
||||
*/
|
||||
bool exit_simulator = 96;
|
||||
|
||||
/*
|
||||
* Tell the node to reboot in this many seconds (or <0 to cancel reboot)
|
||||
*/
|
||||
int32 reboot_seconds = 97;
|
||||
|
||||
/*
|
||||
* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
|
||||
*/
|
||||
int32 shutdown_seconds = 98;
|
||||
|
||||
/*
|
||||
* Tell the node to factory reset, all device settings will be returned to factory defaults.
|
||||
*/
|
||||
int32 factory_reset = 99;
|
||||
|
||||
/*
|
||||
* Tell the node to reset the nodedb.
|
||||
*/
|
||||
int32 nodedb_reset = 100;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Parameters for setting up Meshtastic for ameteur radio usage
|
||||
*/
|
||||
message HamParameters {
|
||||
/*
|
||||
* Amateur radio call sign, eg. KD2ABC
|
||||
*/
|
||||
string call_sign = 1;
|
||||
|
||||
/*
|
||||
* Transmit power in dBm at the LoRA transceiver, not including any amplification
|
||||
*/
|
||||
int32 tx_power = 2;
|
||||
|
||||
/*
|
||||
* The selected frequency of LoRA operation
|
||||
* Please respect your local laws, regulations, and band plans.
|
||||
* Ensure your radio is capable of operating of the selected frequency before setting this.
|
||||
*/
|
||||
float frequency = 3;
|
||||
|
||||
/*
|
||||
* Optional short name of user
|
||||
*/
|
||||
string short_name = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Response envelope for node_remote_hardware_pins
|
||||
*/
|
||||
message NodeRemoteHardwarePinsResponse {
|
||||
/*
|
||||
* Nodes and their respective remote hardware GPIO pins
|
||||
*/
|
||||
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 1;
|
||||
}
|
||||
1
proto_def/meshtastic/apponly.options
Normal file
1
proto_def/meshtastic/apponly.options
Normal file
@@ -0,0 +1 @@
|
||||
*ChannelSet.settings max_count:8
|
||||
31
proto_def/meshtastic/apponly.proto
Normal file
31
proto_def/meshtastic/apponly.proto
Normal file
@@ -0,0 +1,31 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/channel.proto";
|
||||
import "meshtastic/config.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "AppOnlyProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This is the most compact possible representation for a set of channels.
|
||||
* It includes only one PRIMARY channel (which must be first) and
|
||||
* any SECONDARY channels.
|
||||
* No DISABLED channels are included.
|
||||
* This abstraction is used only on the the 'app side' of the world (ie python, javascript and android etc) to show a group of Channels as a (long) URL
|
||||
*/
|
||||
message ChannelSet {
|
||||
/*
|
||||
* Channel list with settings
|
||||
*/
|
||||
repeated ChannelSettings settings = 1;
|
||||
|
||||
/*
|
||||
* LoRa config
|
||||
*/
|
||||
Config.LoRaConfig lora_config = 2;
|
||||
}
|
||||
6
proto_def/meshtastic/atak.options
Normal file
6
proto_def/meshtastic/atak.options
Normal file
@@ -0,0 +1,6 @@
|
||||
*Contact.callsign max_size:120
|
||||
*Contact.device_callsign max_size:120
|
||||
*Status.battery int_size:8
|
||||
*PLI.course int_size:16
|
||||
*GeoChat.message max_size:200
|
||||
*GeoChat.to max_size:120
|
||||
252
proto_def/meshtastic/atak.proto
Normal file
252
proto_def/meshtastic/atak.proto
Normal file
@@ -0,0 +1,252 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ATAKProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Packets for the official ATAK Plugin
|
||||
*/
|
||||
message TAKPacket {
|
||||
/*
|
||||
* Are the payloads strings compressed for LoRA transport?
|
||||
*/
|
||||
bool is_compressed = 1;
|
||||
/*
|
||||
* The contact / callsign for ATAK user
|
||||
*/
|
||||
Contact contact = 2;
|
||||
/*
|
||||
* The group for ATAK user
|
||||
*/
|
||||
Group group = 3;
|
||||
/*
|
||||
* The status of the ATAK EUD
|
||||
*/
|
||||
Status status = 4;
|
||||
/*
|
||||
* The payload of the packet
|
||||
*/
|
||||
oneof payload_variant {
|
||||
/*
|
||||
* TAK position report
|
||||
*/
|
||||
PLI pli = 5;
|
||||
/*
|
||||
* ATAK GeoChat message
|
||||
*/
|
||||
GeoChat chat = 6;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK GeoChat message
|
||||
*/
|
||||
message GeoChat {
|
||||
/*
|
||||
* The text message
|
||||
*/
|
||||
string message = 1;
|
||||
|
||||
/*
|
||||
* Uid recipient of the message
|
||||
*/
|
||||
optional string to = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK Group
|
||||
* <__group role='Team Member' name='Cyan'/>
|
||||
*/
|
||||
message Group {
|
||||
/*
|
||||
* Role of the group member
|
||||
*/
|
||||
MemberRole role = 1;
|
||||
/*
|
||||
* Team (color)
|
||||
* Default Cyan
|
||||
*/
|
||||
Team team = 2;
|
||||
}
|
||||
|
||||
enum Team {
|
||||
/*
|
||||
* Unspecifed
|
||||
*/
|
||||
Unspecifed_Color = 0;
|
||||
/*
|
||||
* White
|
||||
*/
|
||||
White = 1;
|
||||
/*
|
||||
* Yellow
|
||||
*/
|
||||
Yellow = 2;
|
||||
/*
|
||||
* Orange
|
||||
*/
|
||||
Orange = 3;
|
||||
/*
|
||||
* Magenta
|
||||
*/
|
||||
Magenta = 4;
|
||||
/*
|
||||
* Red
|
||||
*/
|
||||
Red = 5;
|
||||
/*
|
||||
* Maroon
|
||||
*/
|
||||
Maroon = 6;
|
||||
/*
|
||||
* Purple
|
||||
*/
|
||||
Purple = 7;
|
||||
/*
|
||||
* Dark Blue
|
||||
*/
|
||||
Dark_Blue = 8;
|
||||
/*
|
||||
* Blue
|
||||
*/
|
||||
Blue = 9;
|
||||
/*
|
||||
* Cyan
|
||||
*/
|
||||
Cyan = 10;
|
||||
/*
|
||||
* Teal
|
||||
*/
|
||||
Teal = 11;
|
||||
/*
|
||||
* Green
|
||||
*/
|
||||
Green = 12;
|
||||
/*
|
||||
* Dark Green
|
||||
*/
|
||||
Dark_Green = 13;
|
||||
/*
|
||||
* Brown
|
||||
*/
|
||||
Brown = 14;
|
||||
}
|
||||
|
||||
/*
|
||||
* Role of the group member
|
||||
*/
|
||||
enum MemberRole {
|
||||
/*
|
||||
* Unspecifed
|
||||
*/
|
||||
Unspecifed = 0;
|
||||
/*
|
||||
* Team Member
|
||||
*/
|
||||
TeamMember = 1;
|
||||
/*
|
||||
* Team Lead
|
||||
*/
|
||||
TeamLead = 2;
|
||||
/*
|
||||
* Headquarters
|
||||
*/
|
||||
HQ = 3;
|
||||
/*
|
||||
* Airsoft enthusiast
|
||||
*/
|
||||
Sniper = 4;
|
||||
/*
|
||||
* Medic
|
||||
*/
|
||||
Medic = 5;
|
||||
/*
|
||||
* ForwardObserver
|
||||
*/
|
||||
ForwardObserver = 6;
|
||||
/*
|
||||
* Radio Telephone Operator
|
||||
*/
|
||||
RTO = 7;
|
||||
/*
|
||||
* Doggo
|
||||
*/
|
||||
K9 = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK EUD Status
|
||||
* <status battery='100' />
|
||||
*/
|
||||
message Status {
|
||||
/*
|
||||
* Battery level
|
||||
*/
|
||||
uint32 battery = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK Contact
|
||||
* <contact endpoint='0.0.0.0:4242:tcp' phone='+12345678' callsign='FALKE'/>
|
||||
*/
|
||||
message Contact {
|
||||
/*
|
||||
* Callsign
|
||||
*/
|
||||
string callsign = 1;
|
||||
|
||||
/*
|
||||
* Device callsign
|
||||
*/
|
||||
string device_callsign = 2;
|
||||
/*
|
||||
* IP address of endpoint in integer form (0.0.0.0 default)
|
||||
*/
|
||||
// fixed32 enpoint_address = 3;
|
||||
/*
|
||||
* Port of endpoint (4242 default)
|
||||
*/
|
||||
// uint32 endpoint_port = 4;
|
||||
/*
|
||||
* Phone represented as integer
|
||||
* Terrible practice, but we really need the wire savings
|
||||
*/
|
||||
// uint32 phone = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Position Location Information from ATAK
|
||||
*/
|
||||
message PLI {
|
||||
/*
|
||||
* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||
* in floating point
|
||||
*/
|
||||
sfixed32 latitude_i = 1;
|
||||
|
||||
/*
|
||||
* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||
* in floating point
|
||||
*/
|
||||
sfixed32 longitude_i = 2;
|
||||
|
||||
/*
|
||||
* Altitude (ATAK prefers HAE)
|
||||
*/
|
||||
int32 altitude = 3;
|
||||
|
||||
/*
|
||||
* Speed
|
||||
*/
|
||||
uint32 speed = 4;
|
||||
|
||||
/*
|
||||
* Course in degrees
|
||||
*/
|
||||
uint32 course = 5;
|
||||
}
|
||||
1
proto_def/meshtastic/cannedmessages.options
Normal file
1
proto_def/meshtastic/cannedmessages.options
Normal file
@@ -0,0 +1 @@
|
||||
*CannedMessageModuleConfig.messages max_size:201
|
||||
19
proto_def/meshtastic/cannedmessages.proto
Normal file
19
proto_def/meshtastic/cannedmessages.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "CannedMessageConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Canned message module configuration.
|
||||
*/
|
||||
message CannedMessageModuleConfig {
|
||||
/*
|
||||
* Predefined messages for canned message module separated by '|' characters.
|
||||
*/
|
||||
string messages = 1;
|
||||
}
|
||||
5
proto_def/meshtastic/channel.options
Normal file
5
proto_def/meshtastic/channel.options
Normal file
@@ -0,0 +1,5 @@
|
||||
*Channel.index int_size:8
|
||||
|
||||
# 256 bit or 128 bit psk key
|
||||
*ChannelSettings.psk max_size:32
|
||||
*ChannelSettings.name max_size:12
|
||||
150
proto_def/meshtastic/channel.proto
Normal file
150
proto_def/meshtastic/channel.proto
Normal file
@@ -0,0 +1,150 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ChannelProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This information can be encoded as a QRcode/url so that other users can configure
|
||||
* their radio to join the same channel.
|
||||
* A note about how channel names are shown to users: channelname-X
|
||||
* poundsymbol is a prefix used to indicate this is a channel name (idea from @professr).
|
||||
* Where X is a letter from A-Z (base 26) representing a hash of the PSK for this
|
||||
* channel - so that if the user changes anything about the channel (which does
|
||||
* force a new PSK) this letter will also change. Thus preventing user confusion if
|
||||
* two friends try to type in a channel name of "BobsChan" and then can't talk
|
||||
* because their PSKs will be different.
|
||||
* The PSK is hashed into this letter by "0x41 + [xor all bytes of the psk ] modulo 26"
|
||||
* This also allows the option of someday if people have the PSK off (zero), the
|
||||
* users COULD type in a channel name and be able to talk.
|
||||
* FIXME: Add description of multi-channel support and how primary vs secondary channels are used.
|
||||
* FIXME: explain how apps use channels for security.
|
||||
* explain how remote settings and remote gpio are managed as an example
|
||||
*/
|
||||
message ChannelSettings {
|
||||
/*
|
||||
* Deprecated in favor of LoraConfig.channel_num
|
||||
*/
|
||||
uint32 channel_num = 1 [deprecated = true];
|
||||
|
||||
/*
|
||||
* A simple pre-shared key for now for crypto.
|
||||
* Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256).
|
||||
* A special shorthand is used for 1 byte long psks.
|
||||
* These psks should be treated as only minimally secure,
|
||||
* because they are listed in this source code.
|
||||
* Those bytes are mapped using the following scheme:
|
||||
* `0` = No crypto
|
||||
* `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0x01}
|
||||
* `2` through 10 = The default channel key, except with 1 through 9 added to the last byte.
|
||||
* Shown to user as simple1 through 10
|
||||
*/
|
||||
bytes psk = 2;
|
||||
|
||||
/*
|
||||
* A SHORT name that will be packed into the URL.
|
||||
* Less than 12 bytes.
|
||||
* Something for end users to call the channel
|
||||
* If this is the empty string it is assumed that this channel
|
||||
* is the special (minimally secure) "Default"channel.
|
||||
* In user interfaces it should be rendered as a local language translation of "X".
|
||||
* For channel_num hashing empty string will be treated as "X".
|
||||
* Where "X" is selected based on the English words listed above for ModemPreset
|
||||
*/
|
||||
string name = 3;
|
||||
|
||||
/*
|
||||
* Used to construct a globally unique channel ID.
|
||||
* The full globally unique ID will be: "name.id" where ID is shown as base36.
|
||||
* Assuming that the number of meshtastic users is below 20K (true for a long time)
|
||||
* the chance of this 64 bit random number colliding with anyone else is super low.
|
||||
* And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to
|
||||
* try multiple candidate channels.
|
||||
* Any time a non wire compatible change is made to a channel, this field should be regenerated.
|
||||
* There are a small number of 'special' globally known (and fairly) insecure standard channels.
|
||||
* Those channels do not have a numeric id included in the settings, but instead it is pulled from
|
||||
* a table of well known IDs.
|
||||
* (see Well Known Channels FIXME)
|
||||
*/
|
||||
fixed32 id = 4;
|
||||
|
||||
/*
|
||||
* If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe
|
||||
*/
|
||||
bool uplink_enabled = 5;
|
||||
|
||||
/*
|
||||
* If true, messages seen on the internet will be forwarded to the local mesh.
|
||||
*/
|
||||
bool downlink_enabled = 6;
|
||||
|
||||
/*
|
||||
* Per-channel module settings.
|
||||
*/
|
||||
ModuleSettings module_settings = 7;
|
||||
}
|
||||
|
||||
/*
|
||||
* This message is specifically for modules to store per-channel configuration data.
|
||||
*/
|
||||
message ModuleSettings {
|
||||
/*
|
||||
* Bits of precision for the location sent in position packets.
|
||||
*/
|
||||
uint32 position_precision = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* A pair of a channel number, mode and the (sharable) settings for that channel
|
||||
*/
|
||||
message Channel {
|
||||
/*
|
||||
* How this channel is being used (or not).
|
||||
* Note: this field is an enum to give us options for the future.
|
||||
* In particular, someday we might make a 'SCANNING' option.
|
||||
* SCANNING channels could have different frequencies and the radio would
|
||||
* occasionally check that freq to see if anything is being transmitted.
|
||||
* For devices that have multiple physical radios attached, we could keep multiple PRIMARY/SCANNING channels active at once to allow
|
||||
* cross band routing as needed.
|
||||
* If a device has only a single radio (the common case) only one channel can be PRIMARY at a time
|
||||
* (but any number of SECONDARY channels can't be sent received on that common frequency)
|
||||
*/
|
||||
enum Role {
|
||||
/*
|
||||
* This channel is not in use right now
|
||||
*/
|
||||
DISABLED = 0;
|
||||
|
||||
/*
|
||||
* This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY
|
||||
*/
|
||||
PRIMARY = 1;
|
||||
|
||||
/*
|
||||
* Secondary channels are only used for encryption/decryption/authentication purposes.
|
||||
* Their radio settings (freq etc) are ignored, only psk is used.
|
||||
*/
|
||||
SECONDARY = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1)
|
||||
* (Someday - not currently implemented) An index of -1 could be used to mean "set by name",
|
||||
* in which case the target node will find and set the channel by settings.name.
|
||||
*/
|
||||
int32 index = 1;
|
||||
|
||||
/*
|
||||
* The new settings, or NULL to disable that channel
|
||||
*/
|
||||
ChannelSettings settings = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Role role = 3;
|
||||
}
|
||||
2
proto_def/meshtastic/clientonly.options
Normal file
2
proto_def/meshtastic/clientonly.options
Normal file
@@ -0,0 +1,2 @@
|
||||
*DeviceProfile.long_name max_size:40
|
||||
*DeviceProfile.short_name max_size:5
|
||||
42
proto_def/meshtastic/clientonly.proto
Normal file
42
proto_def/meshtastic/clientonly.proto
Normal file
@@ -0,0 +1,42 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/localonly.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ClientOnlyProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This abstraction is used to contain any configuration for provisioning a node on any client.
|
||||
* It is useful for importing and exporting configurations.
|
||||
*/
|
||||
message DeviceProfile {
|
||||
/*
|
||||
* Long name for the node
|
||||
*/
|
||||
optional string long_name = 1;
|
||||
|
||||
/*
|
||||
* Short name of the node
|
||||
*/
|
||||
optional string short_name = 2;
|
||||
|
||||
/*
|
||||
* The url of the channels from our node
|
||||
*/
|
||||
optional string channel_url = 3;
|
||||
|
||||
/*
|
||||
* The Config of the node
|
||||
*/
|
||||
optional LocalConfig config = 4;
|
||||
|
||||
/*
|
||||
* The ModuleConfig of the node
|
||||
*/
|
||||
optional LocalModuleConfig module_config = 5;
|
||||
}
|
||||
14
proto_def/meshtastic/config.options
Normal file
14
proto_def/meshtastic/config.options
Normal file
@@ -0,0 +1,14 @@
|
||||
*NetworkConfig.wifi_ssid max_size:33
|
||||
*NetworkConfig.wifi_psk max_size:65
|
||||
*NetworkConfig.ntp_server max_size:33
|
||||
*NetworkConfig.rsyslog_server max_size:33
|
||||
|
||||
# Max of three ignored nodes for our testing
|
||||
*LoRaConfig.ignore_incoming max_count:3
|
||||
|
||||
*LoRaConfig.tx_power int_size:8
|
||||
*LoRaConfig.bandwidth int_size:16
|
||||
*LoRaConfig.coding_rate int_size:8
|
||||
*LoRaConfig.channel_num int_size:16
|
||||
|
||||
*PowerConfig.device_battery_ina_address int_size:8
|
||||
955
proto_def/meshtastic/config.proto
Normal file
955
proto_def/meshtastic/config.proto
Normal file
@@ -0,0 +1,955 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
message Config {
|
||||
/*
|
||||
* Configuration
|
||||
*/
|
||||
message DeviceConfig {
|
||||
/*
|
||||
* Defines the device's role on the Mesh network
|
||||
*/
|
||||
enum Role {
|
||||
/*
|
||||
* Description: App connected or stand alone messaging device.
|
||||
* Technical Details: Default Role
|
||||
*/
|
||||
CLIENT = 0;
|
||||
/*
|
||||
* Description: Device that does not forward packets from other devices.
|
||||
*/
|
||||
CLIENT_MUTE = 1;
|
||||
|
||||
/*
|
||||
* Description: Infrastructure node for extending network coverage by relaying messages. Visible in Nodes list.
|
||||
* Technical Details: Mesh packets will prefer to be routed over this node. This node will not be used by client apps.
|
||||
* The wifi radio and the oled screen will be put to sleep.
|
||||
* This mode may still potentially have higher power usage due to it's preference in message rebroadcasting on the mesh.
|
||||
*/
|
||||
ROUTER = 2;
|
||||
|
||||
/*
|
||||
* Description: Combination of both ROUTER and CLIENT. Not for mobile devices.
|
||||
*/
|
||||
ROUTER_CLIENT = 3;
|
||||
|
||||
/*
|
||||
* Description: Infrastructure node for extending network coverage by relaying messages with minimal overhead. Not visible in Nodes list.
|
||||
* Technical Details: Mesh packets will simply be rebroadcasted over this node. Nodes configured with this role will not originate NodeInfo, Position, Telemetry
|
||||
* or any other packet type. They will simply rebroadcast any mesh packets on the same frequency, channel num, spread factor, and coding rate.
|
||||
*/
|
||||
REPEATER = 4;
|
||||
|
||||
/*
|
||||
* Description: Broadcasts GPS position packets as priority.
|
||||
* Technical Details: Position Mesh packets will be prioritized higher and sent more frequently by default.
|
||||
* When used in conjunction with power.is_power_saving = true, nodes will wake up,
|
||||
* send position, and then sleep for position.position_broadcast_secs seconds.
|
||||
*/
|
||||
TRACKER = 5;
|
||||
|
||||
/*
|
||||
* Description: Broadcasts telemetry packets as priority.
|
||||
* Technical Details: Telemetry Mesh packets will be prioritized higher and sent more frequently by default.
|
||||
* When used in conjunction with power.is_power_saving = true, nodes will wake up,
|
||||
* send environment telemetry, and then sleep for telemetry.environment_update_interval seconds.
|
||||
*/
|
||||
SENSOR = 6;
|
||||
|
||||
/*
|
||||
* Description: Optimized for ATAK system communication and reduces routine broadcasts.
|
||||
* Technical Details: Used for nodes dedicated for connection to an ATAK EUD.
|
||||
* Turns off many of the routine broadcasts to favor CoT packet stream
|
||||
* from the Meshtastic ATAK plugin -> IMeshService -> Node
|
||||
*/
|
||||
TAK = 7;
|
||||
|
||||
/*
|
||||
* Description: Device that only broadcasts as needed for stealth or power savings.
|
||||
* Technical Details: Used for nodes that "only speak when spoken to"
|
||||
* Turns all of the routine broadcasts but allows for ad-hoc communication
|
||||
* Still rebroadcasts, but with local only rebroadcast mode (known meshes only)
|
||||
* Can be used for clandestine operation or to dramatically reduce airtime / power consumption
|
||||
*/
|
||||
CLIENT_HIDDEN = 8;
|
||||
|
||||
/*
|
||||
* Description: Broadcasts location as message to default channel regularly for to assist with device recovery.
|
||||
* Technical Details: Used to automatically send a text message to the mesh
|
||||
* with the current position of the device on a frequent interval:
|
||||
* "I'm lost! Position: lat / long"
|
||||
*/
|
||||
LOST_AND_FOUND = 9;
|
||||
|
||||
/*
|
||||
* Description: Enables automatic TAK PLI broadcasts and reduces routine broadcasts.
|
||||
* Technical Details: Turns off many of the routine broadcasts to favor ATAK CoT packet stream
|
||||
* and automatic TAK PLI (position location information) broadcasts.
|
||||
* Uses position module configuration to determine TAK PLI broadcast interval.
|
||||
*/
|
||||
TAK_TRACKER = 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* Defines the device's behavior for how messages are rebroadcast
|
||||
*/
|
||||
enum RebroadcastMode {
|
||||
/*
|
||||
* Default behavior.
|
||||
* Rebroadcast any observed message, if it was on our private channel or from another mesh with the same lora params.
|
||||
*/
|
||||
ALL = 0;
|
||||
|
||||
/*
|
||||
* Same as behavior as ALL but skips packet decoding and simply rebroadcasts them.
|
||||
* Only available in Repeater role. Setting this on any other roles will result in ALL behavior.
|
||||
*/
|
||||
ALL_SKIP_DECODING = 1;
|
||||
|
||||
/*
|
||||
* Ignores observed messages from foreign meshes that are open or those which it cannot decrypt.
|
||||
* Only rebroadcasts message on the nodes local primary / secondary channels.
|
||||
*/
|
||||
LOCAL_ONLY = 2;
|
||||
|
||||
/*
|
||||
* Ignores observed messages from foreign meshes like LOCAL_ONLY,
|
||||
* but takes it step further by also ignoring messages from nodenums not in the node's known list (NodeDB)
|
||||
*/
|
||||
KNOWN_ONLY = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the role of node
|
||||
*/
|
||||
Role role = 1;
|
||||
|
||||
/*
|
||||
* Disabling this will disable the SerialConsole by not initilizing the StreamAPI
|
||||
*/
|
||||
bool serial_enabled = 2;
|
||||
|
||||
/*
|
||||
* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
|
||||
* Set this to true to leave the debug log outputting even when API is active.
|
||||
*/
|
||||
bool debug_log_enabled = 3;
|
||||
|
||||
/*
|
||||
* For boards without a hard wired button, this is the pin number that will be used
|
||||
* Boards that have more than one button can swap the function with this one. defaults to BUTTON_PIN if defined.
|
||||
*/
|
||||
uint32 button_gpio = 4;
|
||||
|
||||
/*
|
||||
* For boards without a PWM buzzer, this is the pin number that will be used
|
||||
* Defaults to PIN_BUZZER if defined.
|
||||
*/
|
||||
uint32 buzzer_gpio = 5;
|
||||
|
||||
/*
|
||||
* Sets the role of node
|
||||
*/
|
||||
RebroadcastMode rebroadcast_mode = 6;
|
||||
|
||||
/*
|
||||
* Send our nodeinfo this often
|
||||
* Defaults to 900 Seconds (15 minutes)
|
||||
*/
|
||||
uint32 node_info_broadcast_secs = 7;
|
||||
|
||||
/*
|
||||
* Treat double tap interrupt on supported accelerometers as a button press if set to true
|
||||
*/
|
||||
bool double_tap_as_button_press = 8;
|
||||
|
||||
/*
|
||||
* If true, device is considered to be "managed" by a mesh administrator
|
||||
* Clients should then limit available configuration and administrative options inside the user interface
|
||||
*/
|
||||
bool is_managed = 9;
|
||||
|
||||
/*
|
||||
* Disables the triple-press of user button to enable or disable GPS
|
||||
*/
|
||||
bool disable_triple_click = 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* Position Config
|
||||
*/
|
||||
message PositionConfig {
|
||||
/*
|
||||
* Bit field of boolean configuration options, indicating which optional
|
||||
* fields to include when assembling POSITION messages.
|
||||
* Longitude, latitude, altitude, speed, heading, and DOP
|
||||
* are always included (also time if GPS-synced)
|
||||
* NOTE: the more fields are included, the larger the message will be -
|
||||
* leading to longer airtime and a higher risk of packet loss
|
||||
*/
|
||||
enum PositionFlags {
|
||||
/*
|
||||
* Required for compilation
|
||||
*/
|
||||
UNSET = 0x0000;
|
||||
|
||||
/*
|
||||
* Include an altitude value (if available)
|
||||
*/
|
||||
ALTITUDE = 0x0001;
|
||||
|
||||
/*
|
||||
* Altitude value is MSL
|
||||
*/
|
||||
ALTITUDE_MSL = 0x0002;
|
||||
|
||||
/*
|
||||
* Include geoidal separation
|
||||
*/
|
||||
GEOIDAL_SEPARATION = 0x0004;
|
||||
|
||||
/*
|
||||
* Include the DOP value ; PDOP used by default, see below
|
||||
*/
|
||||
DOP = 0x0008;
|
||||
|
||||
/*
|
||||
* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP
|
||||
*/
|
||||
HVDOP = 0x0010;
|
||||
|
||||
/*
|
||||
* Include number of "satellites in view"
|
||||
*/
|
||||
SATINVIEW = 0x0020;
|
||||
|
||||
/*
|
||||
* Include a sequence number incremented per packet
|
||||
*/
|
||||
SEQ_NO = 0x0040;
|
||||
|
||||
/*
|
||||
* Include positional timestamp (from GPS solution)
|
||||
*/
|
||||
TIMESTAMP = 0x0080;
|
||||
|
||||
/*
|
||||
* Include positional heading
|
||||
* Intended for use with vehicle not walking speeds
|
||||
* walking speeds are likely to be error prone like the compass
|
||||
*/
|
||||
HEADING = 0x0100;
|
||||
|
||||
/*
|
||||
* Include positional speed
|
||||
* Intended for use with vehicle not walking speeds
|
||||
* walking speeds are likely to be error prone like the compass
|
||||
*/
|
||||
SPEED = 0x0200;
|
||||
}
|
||||
|
||||
enum GpsMode {
|
||||
/*
|
||||
* GPS is present but disabled
|
||||
*/
|
||||
DISABLED = 0;
|
||||
|
||||
/*
|
||||
* GPS is present and enabled
|
||||
*/
|
||||
ENABLED = 1;
|
||||
|
||||
/*
|
||||
* GPS is not present on the device
|
||||
*/
|
||||
NOT_PRESENT = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* We should send our position this often (but only if it has changed significantly)
|
||||
* Defaults to 15 minutes
|
||||
*/
|
||||
uint32 position_broadcast_secs = 1;
|
||||
|
||||
/*
|
||||
* Adaptive position braoadcast, which is now the default.
|
||||
*/
|
||||
bool position_broadcast_smart_enabled = 2;
|
||||
|
||||
/*
|
||||
* If set, this node is at a fixed position.
|
||||
* We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node.
|
||||
* The lat/lon/alt can be set by an internal GPS or with the help of the app.
|
||||
*/
|
||||
bool fixed_position = 3;
|
||||
|
||||
/*
|
||||
* Is GPS enabled for this node?
|
||||
*/
|
||||
bool gps_enabled = 4 [deprecated = true];
|
||||
|
||||
/*
|
||||
* How often should we try to get GPS position (in seconds)
|
||||
* or zero for the default of once every 30 seconds
|
||||
* or a very large value (maxint) to update only once at boot.
|
||||
*/
|
||||
uint32 gps_update_interval = 5;
|
||||
|
||||
/*
|
||||
* Deprecated in favor of using smart / regular broadcast intervals as implicit attempt time
|
||||
*/
|
||||
uint32 gps_attempt_time = 6 [deprecated = true];
|
||||
|
||||
/*
|
||||
* Bit field of boolean configuration options for POSITION messages
|
||||
* (bitwise OR of PositionFlags)
|
||||
*/
|
||||
uint32 position_flags = 7;
|
||||
|
||||
/*
|
||||
* (Re)define GPS_RX_PIN for your board.
|
||||
*/
|
||||
uint32 rx_gpio = 8;
|
||||
|
||||
/*
|
||||
* (Re)define GPS_TX_PIN for your board.
|
||||
*/
|
||||
uint32 tx_gpio = 9;
|
||||
|
||||
/*
|
||||
* The minimum distance in meters traveled (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled
|
||||
*/
|
||||
uint32 broadcast_smart_minimum_distance = 10;
|
||||
|
||||
/*
|
||||
* The minimum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled
|
||||
*/
|
||||
uint32 broadcast_smart_minimum_interval_secs = 11;
|
||||
|
||||
/*
|
||||
* (Re)define PIN_GPS_EN for your board.
|
||||
*/
|
||||
uint32 gps_en_gpio = 12;
|
||||
|
||||
/*
|
||||
* Set where GPS is enabled, disabled, or not present
|
||||
*/
|
||||
GpsMode gps_mode = 13;
|
||||
}
|
||||
|
||||
/*
|
||||
* Power Config\
|
||||
* See [Power Config](/docs/settings/config/power) for additional power config details.
|
||||
*/
|
||||
message PowerConfig {
|
||||
/*
|
||||
* If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in
|
||||
* we should try to minimize power consumption as much as possible.
|
||||
* YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case).
|
||||
* Advanced Option
|
||||
*/
|
||||
bool is_power_saving = 1;
|
||||
|
||||
/*
|
||||
* If non-zero, the device will fully power off this many seconds after external power is removed.
|
||||
*/
|
||||
uint32 on_battery_shutdown_after_secs = 2;
|
||||
|
||||
/*
|
||||
* Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k)
|
||||
* Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation.
|
||||
* Should be set to floating point value between 2 and 4
|
||||
* Fixes issues on Heltec v2
|
||||
*/
|
||||
float adc_multiplier_override = 3;
|
||||
|
||||
/*
|
||||
* Wait Bluetooth Seconds
|
||||
* The number of seconds for to wait before turning off BLE in No Bluetooth states
|
||||
* 0 for default of 1 minute
|
||||
*/
|
||||
uint32 wait_bluetooth_secs = 4;
|
||||
|
||||
/*
|
||||
* Super Deep Sleep Seconds
|
||||
* While in Light Sleep if mesh_sds_timeout_secs is exceeded we will lower into super deep sleep
|
||||
* for this value (default 1 year) or a button press
|
||||
* 0 for default of one year
|
||||
*/
|
||||
uint32 sds_secs = 6;
|
||||
|
||||
/*
|
||||
* Light Sleep Seconds
|
||||
* In light sleep the CPU is suspended, LoRa radio is on, BLE is off an GPS is on
|
||||
* ESP32 Only
|
||||
* 0 for default of 300
|
||||
*/
|
||||
uint32 ls_secs = 7;
|
||||
|
||||
/*
|
||||
* Minimum Wake Seconds
|
||||
* While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value
|
||||
* 0 for default of 10 seconds
|
||||
*/
|
||||
uint32 min_wake_secs = 8;
|
||||
|
||||
/*
|
||||
* I2C address of INA_2XX to use for reading device battery voltage
|
||||
*/
|
||||
uint32 device_battery_ina_address = 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* Network Config
|
||||
*/
|
||||
message NetworkConfig {
|
||||
enum AddressMode {
|
||||
/*
|
||||
* obtain ip address via DHCP
|
||||
*/
|
||||
DHCP = 0;
|
||||
|
||||
/*
|
||||
* use static ip address
|
||||
*/
|
||||
STATIC = 1;
|
||||
}
|
||||
|
||||
message IpV4Config {
|
||||
/*
|
||||
* Static IP address
|
||||
*/
|
||||
fixed32 ip = 1;
|
||||
|
||||
/*
|
||||
* Static gateway address
|
||||
*/
|
||||
fixed32 gateway = 2;
|
||||
|
||||
/*
|
||||
* Static subnet mask
|
||||
*/
|
||||
fixed32 subnet = 3;
|
||||
|
||||
/*
|
||||
* Static DNS server address
|
||||
*/
|
||||
fixed32 dns = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable WiFi (disables Bluetooth)
|
||||
*/
|
||||
bool wifi_enabled = 1;
|
||||
|
||||
/*
|
||||
* If set, this node will try to join the specified wifi network and
|
||||
* acquire an address via DHCP
|
||||
*/
|
||||
string wifi_ssid = 3;
|
||||
|
||||
/*
|
||||
* If set, will be use to authenticate to the named wifi
|
||||
*/
|
||||
string wifi_psk = 4;
|
||||
|
||||
/*
|
||||
* NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org`
|
||||
*/
|
||||
string ntp_server = 5;
|
||||
|
||||
/*
|
||||
* Enable Ethernet
|
||||
*/
|
||||
bool eth_enabled = 6;
|
||||
|
||||
/*
|
||||
* acquire an address via DHCP or assign static
|
||||
*/
|
||||
AddressMode address_mode = 7;
|
||||
|
||||
/*
|
||||
* struct to keep static address
|
||||
*/
|
||||
IpV4Config ipv4_config = 8;
|
||||
|
||||
/*
|
||||
* rsyslog Server and Port
|
||||
*/
|
||||
string rsyslog_server = 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Config
|
||||
*/
|
||||
message DisplayConfig {
|
||||
/*
|
||||
* How the GPS coordinates are displayed on the OLED screen.
|
||||
*/
|
||||
enum GpsCoordinateFormat {
|
||||
/*
|
||||
* GPS coordinates are displayed in the normal decimal degrees format:
|
||||
* DD.DDDDDD DDD.DDDDDD
|
||||
*/
|
||||
DEC = 0;
|
||||
|
||||
/*
|
||||
* GPS coordinates are displayed in the degrees minutes seconds format:
|
||||
* DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant
|
||||
*/
|
||||
DMS = 1;
|
||||
|
||||
/*
|
||||
* Universal Transverse Mercator format:
|
||||
* ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing
|
||||
*/
|
||||
UTM = 2;
|
||||
|
||||
/*
|
||||
* Military Grid Reference System format:
|
||||
* ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square,
|
||||
* E is easting, N is northing
|
||||
*/
|
||||
MGRS = 3;
|
||||
|
||||
/*
|
||||
* Open Location Code (aka Plus Codes).
|
||||
*/
|
||||
OLC = 4;
|
||||
|
||||
/*
|
||||
* Ordnance Survey Grid Reference (the National Grid System of the UK).
|
||||
* Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square,
|
||||
* E is the easting, N is the northing
|
||||
*/
|
||||
OSGR = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unit display preference
|
||||
*/
|
||||
enum DisplayUnits {
|
||||
/*
|
||||
* Metric (Default)
|
||||
*/
|
||||
METRIC = 0;
|
||||
|
||||
/*
|
||||
* Imperial
|
||||
*/
|
||||
IMPERIAL = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Override OLED outo detect with this if it fails.
|
||||
*/
|
||||
enum OledType {
|
||||
/*
|
||||
* Default / Auto
|
||||
*/
|
||||
OLED_AUTO = 0;
|
||||
|
||||
/*
|
||||
* Default / Auto
|
||||
*/
|
||||
OLED_SSD1306 = 1;
|
||||
|
||||
/*
|
||||
* Default / Auto
|
||||
*/
|
||||
OLED_SH1106 = 2;
|
||||
|
||||
/*
|
||||
* Can not be auto detected but set by proto. Used for 128x128 screens
|
||||
*/
|
||||
OLED_SH1107 = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Number of seconds the screen stays on after pressing the user button or receiving a message
|
||||
* 0 for default of one minute MAXUINT for always on
|
||||
*/
|
||||
uint32 screen_on_secs = 1;
|
||||
|
||||
/*
|
||||
* How the GPS coordinates are formatted on the OLED screen.
|
||||
*/
|
||||
GpsCoordinateFormat gps_format = 2;
|
||||
|
||||
/*
|
||||
* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds.
|
||||
* Potentially useful for devices without user buttons.
|
||||
*/
|
||||
uint32 auto_screen_carousel_secs = 3;
|
||||
|
||||
/*
|
||||
* If this is set, the displayed compass will always point north. if unset, the old behaviour
|
||||
* (top of display is heading direction) is used.
|
||||
*/
|
||||
bool compass_north_top = 4;
|
||||
|
||||
/*
|
||||
* Flip screen vertically, for cases that mount the screen upside down
|
||||
*/
|
||||
bool flip_screen = 5;
|
||||
|
||||
/*
|
||||
* Perferred display units
|
||||
*/
|
||||
DisplayUnits units = 6;
|
||||
|
||||
/*
|
||||
* Override auto-detect in screen
|
||||
*/
|
||||
OledType oled = 7;
|
||||
|
||||
enum DisplayMode {
|
||||
/*
|
||||
* Default. The old style for the 128x64 OLED screen
|
||||
*/
|
||||
DEFAULT = 0;
|
||||
|
||||
/*
|
||||
* Rearrange display elements to cater for bicolor OLED displays
|
||||
*/
|
||||
TWOCOLOR = 1;
|
||||
|
||||
/*
|
||||
* Same as TwoColor, but with inverted top bar. Not so good for Epaper displays
|
||||
*/
|
||||
INVERTED = 2;
|
||||
|
||||
/*
|
||||
* TFT Full Color Displays (not implemented yet)
|
||||
*/
|
||||
COLOR = 3;
|
||||
}
|
||||
/*
|
||||
* Display Mode
|
||||
*/
|
||||
DisplayMode displaymode = 8;
|
||||
|
||||
/*
|
||||
* Print first line in pseudo-bold? FALSE is original style, TRUE is bold
|
||||
*/
|
||||
bool heading_bold = 9;
|
||||
|
||||
/*
|
||||
* Should we wake the screen up on accelerometer detected motion or tap
|
||||
*/
|
||||
bool wake_on_tap_or_motion = 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* Lora Config
|
||||
*/
|
||||
message LoRaConfig {
|
||||
enum RegionCode {
|
||||
/*
|
||||
* Region is not set
|
||||
*/
|
||||
UNSET = 0;
|
||||
|
||||
/*
|
||||
* United States
|
||||
*/
|
||||
US = 1;
|
||||
|
||||
/*
|
||||
* European Union 433mhz
|
||||
*/
|
||||
EU_433 = 2;
|
||||
|
||||
/*
|
||||
* European Union 868mhz
|
||||
*/
|
||||
EU_868 = 3;
|
||||
|
||||
/*
|
||||
* China
|
||||
*/
|
||||
CN = 4;
|
||||
|
||||
/*
|
||||
* Japan
|
||||
*/
|
||||
JP = 5;
|
||||
|
||||
/*
|
||||
* Australia / New Zealand
|
||||
*/
|
||||
ANZ = 6;
|
||||
|
||||
/*
|
||||
* Korea
|
||||
*/
|
||||
KR = 7;
|
||||
|
||||
/*
|
||||
* Taiwan
|
||||
*/
|
||||
TW = 8;
|
||||
|
||||
/*
|
||||
* Russia
|
||||
*/
|
||||
RU = 9;
|
||||
|
||||
/*
|
||||
* India
|
||||
*/
|
||||
IN = 10;
|
||||
|
||||
/*
|
||||
* New Zealand 865mhz
|
||||
*/
|
||||
NZ_865 = 11;
|
||||
|
||||
/*
|
||||
* Thailand
|
||||
*/
|
||||
TH = 12;
|
||||
|
||||
/*
|
||||
* WLAN Band
|
||||
*/
|
||||
LORA_24 = 13;
|
||||
|
||||
/*
|
||||
* Ukraine 433mhz
|
||||
*/
|
||||
UA_433 = 14;
|
||||
|
||||
/*
|
||||
* Ukraine 868mhz
|
||||
*/
|
||||
UA_868 = 15;
|
||||
|
||||
/*
|
||||
* Malaysia 433mhz
|
||||
*/
|
||||
MY_433 = 16;
|
||||
|
||||
/*
|
||||
* Malaysia 919mhz
|
||||
*/
|
||||
MY_919 = 17;
|
||||
|
||||
/*
|
||||
* Singapore 923mhz
|
||||
*/
|
||||
SG_923 = 18;
|
||||
}
|
||||
|
||||
/*
|
||||
* Standard predefined channel settings
|
||||
* Note: these mappings must match ModemPreset Choice in the device code.
|
||||
*/
|
||||
enum ModemPreset {
|
||||
/*
|
||||
* Long Range - Fast
|
||||
*/
|
||||
LONG_FAST = 0;
|
||||
|
||||
/*
|
||||
* Long Range - Slow
|
||||
*/
|
||||
LONG_SLOW = 1;
|
||||
|
||||
/*
|
||||
* Very Long Range - Slow
|
||||
*/
|
||||
VERY_LONG_SLOW = 2;
|
||||
|
||||
/*
|
||||
* Medium Range - Slow
|
||||
*/
|
||||
MEDIUM_SLOW = 3;
|
||||
|
||||
/*
|
||||
* Medium Range - Fast
|
||||
*/
|
||||
MEDIUM_FAST = 4;
|
||||
|
||||
/*
|
||||
* Short Range - Slow
|
||||
*/
|
||||
SHORT_SLOW = 5;
|
||||
|
||||
/*
|
||||
* Short Range - Fast
|
||||
*/
|
||||
SHORT_FAST = 6;
|
||||
|
||||
/*
|
||||
* Long Range - Moderately Fast
|
||||
*/
|
||||
LONG_MODERATE = 7;
|
||||
}
|
||||
|
||||
/*
|
||||
* When enabled, the `modem_preset` fields will be adhered to, else the `bandwidth`/`spread_factor`/`coding_rate`
|
||||
* will be taked from their respective manually defined fields
|
||||
*/
|
||||
bool use_preset = 1;
|
||||
|
||||
/*
|
||||
* Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH.
|
||||
* As a heuristic: If bandwidth is specified, do not use modem_config.
|
||||
* Because protobufs take ZERO space when the value is zero this works out nicely.
|
||||
* This value is replaced by bandwidth/spread_factor/coding_rate.
|
||||
* If you'd like to experiment with other options add them to MeshRadio.cpp in the device code.
|
||||
*/
|
||||
ModemPreset modem_preset = 2;
|
||||
|
||||
/*
|
||||
* Bandwidth in MHz
|
||||
* Certain bandwidth numbers are 'special' and will be converted to the
|
||||
* appropriate floating point value: 31 -> 31.25MHz
|
||||
*/
|
||||
uint32 bandwidth = 3;
|
||||
|
||||
/*
|
||||
* A number from 7 to 12.
|
||||
* Indicates number of chirps per symbol as 1<<spread_factor.
|
||||
*/
|
||||
uint32 spread_factor = 4;
|
||||
|
||||
/*
|
||||
* The denominator of the coding rate.
|
||||
* ie for 4/5, the value is 5. 4/8 the value is 8.
|
||||
*/
|
||||
uint32 coding_rate = 5;
|
||||
|
||||
/*
|
||||
* This parameter is for advanced users with advanced test equipment, we do not recommend most users use it.
|
||||
* A frequency offset that is added to to the calculated band center frequency.
|
||||
* Used to correct for crystal calibration errors.
|
||||
*/
|
||||
float frequency_offset = 6;
|
||||
|
||||
/*
|
||||
* The region code for the radio (US, CN, EU433, etc...)
|
||||
*/
|
||||
RegionCode region = 7;
|
||||
|
||||
/*
|
||||
* Maximum number of hops. This can't be greater than 7.
|
||||
* Default of 3
|
||||
* Attempting to set a value > 7 results in the default
|
||||
*/
|
||||
uint32 hop_limit = 8;
|
||||
|
||||
/*
|
||||
* Disable TX from the LoRa radio. Useful for hot-swapping antennas and other tests.
|
||||
* Defaults to false
|
||||
*/
|
||||
bool tx_enabled = 9;
|
||||
|
||||
/*
|
||||
* If zero, then use default max legal continuous power (ie. something that won't
|
||||
* burn out the radio hardware)
|
||||
* In most cases you should use zero here.
|
||||
* Units are in dBm.
|
||||
*/
|
||||
int32 tx_power = 10;
|
||||
|
||||
/*
|
||||
* This controls the actual hardware frequency the radio transmits on.
|
||||
* Most users should never need to be exposed to this field/concept.
|
||||
* A channel number between 1 and NUM_CHANNELS (whatever the max is in the current region).
|
||||
* If ZERO then the rule is "use the old channel name hash based
|
||||
* algorithm to derive the channel number")
|
||||
* If using the hash algorithm the channel number will be: hash(channel_name) %
|
||||
* NUM_CHANNELS (Where num channels depends on the regulatory region).
|
||||
*/
|
||||
uint32 channel_num = 11;
|
||||
|
||||
/*
|
||||
* If true, duty cycle limits will be exceeded and thus you're possibly not following
|
||||
* the local regulations if you're not a HAM.
|
||||
* Has no effect if the duty cycle of the used region is 100%.
|
||||
*/
|
||||
bool override_duty_cycle = 12;
|
||||
|
||||
/*
|
||||
* If true, sets RX boosted gain mode on SX126X based radios
|
||||
*/
|
||||
bool sx126x_rx_boosted_gain = 13;
|
||||
|
||||
/*
|
||||
* This parameter is for advanced users and licensed HAM radio operators.
|
||||
* Ignore Channel Calculation and use this frequency instead. The frequency_offset
|
||||
* will still be applied. This will allow you to use out-of-band frequencies.
|
||||
* Please respect your local laws and regulations. If you are a HAM, make sure you
|
||||
* enable HAM mode and turn off encryption.
|
||||
*/
|
||||
float override_frequency = 14;
|
||||
|
||||
/*
|
||||
* For testing it is useful sometimes to force a node to never listen to
|
||||
* particular other nodes (simulating radio out of range). All nodenums listed
|
||||
* in ignore_incoming will have packets they send dropped on receive (by router.cpp)
|
||||
*/
|
||||
repeated uint32 ignore_incoming = 103;
|
||||
|
||||
/*
|
||||
* If true, the device will not process any packets received via LoRa that passed via MQTT anywhere on the path towards it.
|
||||
*/
|
||||
bool ignore_mqtt = 104;
|
||||
}
|
||||
|
||||
message BluetoothConfig {
|
||||
enum PairingMode {
|
||||
/*
|
||||
* Device generates a random PIN that will be shown on the screen of the device for pairing
|
||||
*/
|
||||
RANDOM_PIN = 0;
|
||||
|
||||
/*
|
||||
* Device requires a specified fixed PIN for pairing
|
||||
*/
|
||||
FIXED_PIN = 1;
|
||||
|
||||
/*
|
||||
* Device requires no PIN for pairing
|
||||
*/
|
||||
NO_PIN = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable Bluetooth on the device
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Determines the pairing strategy for the device
|
||||
*/
|
||||
PairingMode mode = 2;
|
||||
|
||||
/*
|
||||
* Specified PIN for PairingMode.FixedPin
|
||||
*/
|
||||
uint32 fixed_pin = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Payload Variant
|
||||
*/
|
||||
oneof payload_variant {
|
||||
DeviceConfig device = 1;
|
||||
PositionConfig position = 2;
|
||||
PowerConfig power = 3;
|
||||
NetworkConfig network = 4;
|
||||
DisplayConfig display = 5;
|
||||
LoRaConfig lora = 6;
|
||||
BluetoothConfig bluetooth = 7;
|
||||
}
|
||||
}
|
||||
1
proto_def/meshtastic/connection_status.options
Normal file
1
proto_def/meshtastic/connection_status.options
Normal file
@@ -0,0 +1 @@
|
||||
*WifiConnectionStatus.ssid max_size:33
|
||||
120
proto_def/meshtastic/connection_status.proto
Normal file
120
proto_def/meshtastic/connection_status.proto
Normal file
@@ -0,0 +1,120 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ConnStatusProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
message DeviceConnectionStatus {
|
||||
/*
|
||||
* WiFi Status
|
||||
*/
|
||||
optional WifiConnectionStatus wifi = 1;
|
||||
/*
|
||||
* WiFi Status
|
||||
*/
|
||||
optional EthernetConnectionStatus ethernet = 2;
|
||||
|
||||
/*
|
||||
* Bluetooth Status
|
||||
*/
|
||||
optional BluetoothConnectionStatus bluetooth = 3;
|
||||
|
||||
/*
|
||||
* Serial Status
|
||||
*/
|
||||
optional SerialConnectionStatus serial = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* WiFi connection status
|
||||
*/
|
||||
message WifiConnectionStatus {
|
||||
/*
|
||||
* Connection status
|
||||
*/
|
||||
NetworkConnectionStatus status = 1;
|
||||
|
||||
/*
|
||||
* WiFi access point SSID
|
||||
*/
|
||||
string ssid = 2;
|
||||
|
||||
/*
|
||||
* RSSI of wireless connection
|
||||
*/
|
||||
int32 rssi = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ethernet connection status
|
||||
*/
|
||||
message EthernetConnectionStatus {
|
||||
/*
|
||||
* Connection status
|
||||
*/
|
||||
NetworkConnectionStatus status = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ethernet or WiFi connection status
|
||||
*/
|
||||
message NetworkConnectionStatus {
|
||||
/*
|
||||
* IP address of device
|
||||
*/
|
||||
fixed32 ip_address = 1;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection or not
|
||||
*/
|
||||
bool is_connected = 2;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection to an MQTT broker or not
|
||||
*/
|
||||
bool is_mqtt_connected = 3;
|
||||
|
||||
/*
|
||||
* Whether the device is actively remote syslogging or not
|
||||
*/
|
||||
bool is_syslog_connected = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Bluetooth connection status
|
||||
*/
|
||||
message BluetoothConnectionStatus {
|
||||
/*
|
||||
* The pairing PIN for bluetooth
|
||||
*/
|
||||
uint32 pin = 1;
|
||||
|
||||
/*
|
||||
* RSSI of bluetooth connection
|
||||
*/
|
||||
int32 rssi = 2;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection or not
|
||||
*/
|
||||
bool is_connected = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serial connection status
|
||||
*/
|
||||
message SerialConnectionStatus {
|
||||
/*
|
||||
* Serial baud rate
|
||||
*/
|
||||
uint32 baud = 1;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection or not
|
||||
*/
|
||||
bool is_connected = 2;
|
||||
}
|
||||
16
proto_def/meshtastic/deviceonly.options
Normal file
16
proto_def/meshtastic/deviceonly.options
Normal file
@@ -0,0 +1,16 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
# FIXME - max_count is actually 32 but we save/load this as one long string of preencoded MeshPacket bytes - not a big array in RAM
|
||||
*DeviceState.receive_queue max_count:1
|
||||
|
||||
*ChannelFile.channels max_count:8
|
||||
|
||||
*OEMStore.oem_text max_size:40
|
||||
*OEMStore.oem_icon_bits max_size:2048
|
||||
*OEMStore.oem_aes_key max_size:32
|
||||
|
||||
*DeviceState.node_remote_hardware_pins max_count:12
|
||||
|
||||
*NodeInfoLite.channel int_size:8
|
||||
*NodeInfoLite.hops_away int_size:8
|
||||
256
proto_def/meshtastic/deviceonly.proto
Normal file
256
proto_def/meshtastic/deviceonly.proto
Normal file
@@ -0,0 +1,256 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/channel.proto";
|
||||
import "meshtastic/localonly.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
import "meshtastic/module_config.proto";
|
||||
import "meshtastic/telemetry.proto";
|
||||
import "nanopb.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "DeviceOnly";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
option (nanopb_fileopt).include = "<vector>";
|
||||
|
||||
/*
|
||||
* This message is never sent over the wire, but it is used for serializing DB
|
||||
* state to flash in the device code
|
||||
* FIXME, since we write this each time we enter deep sleep (and have infinite
|
||||
* flash) it would be better to use some sort of append only data structure for
|
||||
* the receive queue and use the preferences store for the other stuff
|
||||
*/
|
||||
message DeviceState {
|
||||
/*
|
||||
* Read only settings/info about this node
|
||||
*/
|
||||
MyNodeInfo my_node = 2;
|
||||
|
||||
/*
|
||||
* My owner info
|
||||
*/
|
||||
User owner = 3;
|
||||
|
||||
/*
|
||||
* Received packets saved for delivery to the phone
|
||||
*/
|
||||
repeated MeshPacket receive_queue = 5;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 8;
|
||||
|
||||
/*
|
||||
* We keep the last received text message (only) stored in the device flash,
|
||||
* so we can show it on the screen.
|
||||
* Might be null
|
||||
*/
|
||||
MeshPacket rx_text_message = 7;
|
||||
|
||||
/*
|
||||
* Used only during development.
|
||||
* Indicates developer is testing and changes should never be saved to flash.
|
||||
* Deprecated in 2.3.1
|
||||
*/
|
||||
bool no_save = 9 [deprecated = true];
|
||||
|
||||
/*
|
||||
* Some GPS receivers seem to have bogus settings from the factory, so we always do one factory reset.
|
||||
*/
|
||||
bool did_gps_reset = 11;
|
||||
|
||||
/*
|
||||
* We keep the last received waypoint stored in the device flash,
|
||||
* so we can show it on the screen.
|
||||
* Might be null
|
||||
*/
|
||||
MeshPacket rx_waypoint = 12;
|
||||
|
||||
/*
|
||||
* The mesh's nodes with their available gpio pins for RemoteHardware module
|
||||
*/
|
||||
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 13;
|
||||
|
||||
/*
|
||||
* New lite version of NodeDB to decrease memory footprint
|
||||
*/
|
||||
repeated NodeInfoLite node_db_lite = 14 [(nanopb).callback_datatype = "std::vector<meshtastic_NodeInfoLite>"];
|
||||
}
|
||||
|
||||
message NodeInfoLite {
|
||||
/*
|
||||
* The node number
|
||||
*/
|
||||
uint32 num = 1;
|
||||
|
||||
/*
|
||||
* The user info for this node
|
||||
*/
|
||||
User user = 2;
|
||||
|
||||
/*
|
||||
* This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true.
|
||||
* Position.time now indicates the last time we received a POSITION from that node.
|
||||
*/
|
||||
PositionLite position = 3;
|
||||
|
||||
/*
|
||||
* Returns the Signal-to-noise ratio (SNR) of the last received message,
|
||||
* as measured by the receiver. Return SNR of the last received message in dB
|
||||
*/
|
||||
float snr = 4;
|
||||
|
||||
/*
|
||||
* Set to indicate the last time we received a packet from this node
|
||||
*/
|
||||
fixed32 last_heard = 5;
|
||||
/*
|
||||
* The latest device metrics for the node.
|
||||
*/
|
||||
DeviceMetrics device_metrics = 6;
|
||||
|
||||
/*
|
||||
* local channel index we heard that node on. Only populated if its not the default channel.
|
||||
*/
|
||||
uint32 channel = 7;
|
||||
|
||||
/*
|
||||
* True if we witnessed the node over MQTT instead of LoRA transport
|
||||
*/
|
||||
bool via_mqtt = 8;
|
||||
|
||||
/*
|
||||
* Number of hops away from us this node is (0 if adjacent)
|
||||
*/
|
||||
uint32 hops_away = 9;
|
||||
|
||||
/*
|
||||
* True if node is in our favorites list
|
||||
* Persists between NodeDB internal clean ups
|
||||
*/
|
||||
bool is_favorite = 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* Position with static location information only for NodeDBLite
|
||||
*/
|
||||
message PositionLite {
|
||||
/*
|
||||
* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||
* in floating point
|
||||
*/
|
||||
sfixed32 latitude_i = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
sfixed32 longitude_i = 2;
|
||||
|
||||
/*
|
||||
* In meters above MSL (but see issue #359)
|
||||
*/
|
||||
int32 altitude = 3;
|
||||
|
||||
/*
|
||||
* This is usually not sent over the mesh (to save space), but it is sent
|
||||
* from the phone so that the local device can set its RTC If it is sent over
|
||||
* the mesh (because there are devices on the mesh without GPS), it will only
|
||||
* be sent by devices which has a hardware GPS clock.
|
||||
* seconds since 1970
|
||||
*/
|
||||
fixed32 time = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Position.LocSource location_source = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* The on-disk saved channels
|
||||
*/
|
||||
message ChannelFile {
|
||||
/*
|
||||
* The channels our node knows about
|
||||
*/
|
||||
repeated Channel channels = 1;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum ScreenFonts {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
FONT_SMALL = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
FONT_MEDIUM = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
FONT_LARGE = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* This can be used for customizing the firmware distribution. If populated,
|
||||
* show a secondary bootup screen with custom logo and text for 2.5 seconds.
|
||||
*/
|
||||
message OEMStore {
|
||||
/*
|
||||
* The Logo width in Px
|
||||
*/
|
||||
uint32 oem_icon_width = 1;
|
||||
|
||||
/*
|
||||
* The Logo height in Px
|
||||
*/
|
||||
uint32 oem_icon_height = 2;
|
||||
|
||||
/*
|
||||
* The Logo in XBM bytechar format
|
||||
*/
|
||||
bytes oem_icon_bits = 3;
|
||||
|
||||
/*
|
||||
* Use this font for the OEM text.
|
||||
*/
|
||||
ScreenFonts oem_font = 4;
|
||||
|
||||
/*
|
||||
* Use this font for the OEM text.
|
||||
*/
|
||||
string oem_text = 5;
|
||||
|
||||
/*
|
||||
* The default device encryption key, 16 or 32 byte
|
||||
*/
|
||||
bytes oem_aes_key = 6;
|
||||
|
||||
/*
|
||||
* A Preset LocalConfig to apply during factory reset
|
||||
*/
|
||||
LocalConfig oem_local_config = 7;
|
||||
|
||||
/*
|
||||
* A Preset LocalModuleConfig to apply during factory reset
|
||||
*/
|
||||
LocalModuleConfig oem_local_module_config = 8;
|
||||
}
|
||||
135
proto_def/meshtastic/localonly.proto
Normal file
135
proto_def/meshtastic/localonly.proto
Normal file
@@ -0,0 +1,135 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/module_config.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "LocalOnlyProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Protobuf structures common to apponly.proto and deviceonly.proto
|
||||
* This is never sent over the wire, only for local use
|
||||
*/
|
||||
|
||||
message LocalConfig {
|
||||
/*
|
||||
* The part of the config that is specific to the Device
|
||||
*/
|
||||
Config.DeviceConfig device = 1;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the GPS Position
|
||||
*/
|
||||
Config.PositionConfig position = 2;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Power settings
|
||||
*/
|
||||
Config.PowerConfig power = 3;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Wifi Settings
|
||||
*/
|
||||
Config.NetworkConfig network = 4;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Display
|
||||
*/
|
||||
Config.DisplayConfig display = 5;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Lora Radio
|
||||
*/
|
||||
Config.LoRaConfig lora = 6;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Bluetooth settings
|
||||
*/
|
||||
Config.BluetoothConfig bluetooth = 7;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 8;
|
||||
}
|
||||
|
||||
message LocalModuleConfig {
|
||||
/*
|
||||
* The part of the config that is specific to the MQTT module
|
||||
*/
|
||||
ModuleConfig.MQTTConfig mqtt = 1;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Serial module
|
||||
*/
|
||||
ModuleConfig.SerialConfig serial = 2;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the ExternalNotification module
|
||||
*/
|
||||
ModuleConfig.ExternalNotificationConfig external_notification = 3;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Store & Forward module
|
||||
*/
|
||||
ModuleConfig.StoreForwardConfig store_forward = 4;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the RangeTest module
|
||||
*/
|
||||
ModuleConfig.RangeTestConfig range_test = 5;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Telemetry module
|
||||
*/
|
||||
ModuleConfig.TelemetryConfig telemetry = 6;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Canned Message module
|
||||
*/
|
||||
ModuleConfig.CannedMessageConfig canned_message = 7;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Audio module
|
||||
*/
|
||||
ModuleConfig.AudioConfig audio = 9;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Remote Hardware module
|
||||
*/
|
||||
ModuleConfig.RemoteHardwareConfig remote_hardware = 10;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Neighbor Info module
|
||||
*/
|
||||
ModuleConfig.NeighborInfoConfig neighbor_info = 11;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Ambient Lighting module
|
||||
*/
|
||||
ModuleConfig.AmbientLightingConfig ambient_lighting = 12;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Detection Sensor module
|
||||
*/
|
||||
ModuleConfig.DetectionSensorConfig detection_sensor = 13;
|
||||
|
||||
/*
|
||||
* Paxcounter Config
|
||||
*/
|
||||
ModuleConfig.PaxcounterConfig paxcounter = 14;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 8;
|
||||
}
|
||||
61
proto_def/meshtastic/mesh.options
Normal file
61
proto_def/meshtastic/mesh.options
Normal file
@@ -0,0 +1,61 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
*macaddr max_size:6 fixed_length:true # macaddrs
|
||||
*id max_size:16 # node id strings
|
||||
|
||||
*User.long_name max_size:40
|
||||
*User.short_name max_size:5
|
||||
|
||||
*RouteDiscovery.route max_count:8
|
||||
|
||||
# note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
|
||||
# outside of this envelope
|
||||
*Data.payload max_size:237
|
||||
|
||||
*NodeInfo.channel int_size:8
|
||||
*NodeInfo.hops_away int_size:8
|
||||
|
||||
# Big enough for 1.2.28.568032c-d
|
||||
*MyNodeInfo.firmware_version max_size:18
|
||||
|
||||
*MyNodeInfo.air_period_tx max_count:8
|
||||
*MyNodeInfo.air_period_rx max_count:8
|
||||
|
||||
# Note: the actual limit (because of header bytes) on the size of encrypted payloads is 251 bytes, but I use 256
|
||||
# here because we might need to fill with zeros for padding to encryption block size (16 bytes per block)
|
||||
*MeshPacket.encrypted max_size:256
|
||||
*MeshPacket.payload_variant anonymous_oneof:true
|
||||
*MeshPacket.hop_limit int_size:8
|
||||
*MeshPacket.hop_start int_size:8
|
||||
*MeshPacket.channel int_size:8
|
||||
|
||||
*QueueStatus.res int_size:8
|
||||
*QueueStatus.free int_size:8
|
||||
*QueueStatus.maxlen int_size:8
|
||||
|
||||
*ToRadio.payload_variant anonymous_oneof:true
|
||||
|
||||
*FromRadio.payload_variant anonymous_oneof:true
|
||||
|
||||
*Routing.variant anonymous_oneof:true
|
||||
|
||||
*LogRecord.message max_size:64
|
||||
*LogRecord.source max_size:8
|
||||
|
||||
# MyMessage.name max_size:40
|
||||
# or fixed_length or fixed_count, or max_count
|
||||
|
||||
#This value may want to be a few bytes smaller to compensate for the parent fields.
|
||||
*Compressed.data max_size:237
|
||||
|
||||
*Waypoint.name max_size:30
|
||||
*Waypoint.description max_size:100
|
||||
|
||||
*NeighborInfo.neighbors max_count:10
|
||||
|
||||
*DeviceMetadata.firmware_version max_size:18
|
||||
|
||||
*MqttClientProxyMessage.topic max_size:60
|
||||
*MqttClientProxyMessage.data max_size:435
|
||||
*MqttClientProxyMessage.text max_size:435
|
||||
1601
proto_def/meshtastic/mesh.proto
Normal file
1601
proto_def/meshtastic/mesh.proto
Normal file
File diff suppressed because it is too large
Load Diff
28
proto_def/meshtastic/module_config.options
Normal file
28
proto_def/meshtastic/module_config.options
Normal file
@@ -0,0 +1,28 @@
|
||||
*CannedMessageConfig.allow_input_source max_size:16
|
||||
|
||||
*MQTTConfig.address max_size:64
|
||||
*MQTTConfig.username max_size:64
|
||||
*MQTTConfig.password max_size:64
|
||||
*MQTTConfig.root max_size:32
|
||||
|
||||
*AudioConfig.ptt_pin int_size:8
|
||||
*AudioConfig.i2s_ws int_size:8
|
||||
*AudioConfig.i2s_sd int_size:8
|
||||
*AudioConfig.i2s_din int_size:8
|
||||
*AudioConfig.i2s_sck int_size:8
|
||||
|
||||
*ExternalNotificationConfig.output_vibra int_size:8
|
||||
*ExternalNotificationConfig.output_buzzer int_size:8
|
||||
*ExternalNotificationConfig.nag_timeout int_size:16
|
||||
|
||||
*RemoteHardwareConfig.available_pins max_count:4
|
||||
*RemoteHardwarePin.name max_size:15
|
||||
*RemoteHardwarePin.gpio_pin int_size:8
|
||||
|
||||
*AmbientLightingConfig.current int_size:8
|
||||
*AmbientLightingConfig.red int_size:8
|
||||
*AmbientLightingConfig.green int_size:8
|
||||
*AmbientLightingConfig.blue int_size:8
|
||||
|
||||
*DetectionSensorConfig.monitor_pin int_size:8
|
||||
*DetectionSensorConfig.name max_size:20
|
||||
791
proto_def/meshtastic/module_config.proto
Normal file
791
proto_def/meshtastic/module_config.proto
Normal file
@@ -0,0 +1,791 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ModuleConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Module Config
|
||||
*/
|
||||
message ModuleConfig {
|
||||
/*
|
||||
* MQTT Client Config
|
||||
*/
|
||||
message MQTTConfig {
|
||||
/*
|
||||
* If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as
|
||||
* is_uplink_enabled or is_downlink_enabled.
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* The server to use for our MQTT global message gateway feature.
|
||||
* If not set, the default server will be used
|
||||
*/
|
||||
string address = 2;
|
||||
|
||||
/*
|
||||
* MQTT username to use (most useful for a custom MQTT server).
|
||||
* If using a custom server, this will be honoured even if empty.
|
||||
* If using the default server, this will only be honoured if set, otherwise the device will use the default username
|
||||
*/
|
||||
string username = 3;
|
||||
|
||||
/*
|
||||
* MQTT password to use (most useful for a custom MQTT server).
|
||||
* If using a custom server, this will be honoured even if empty.
|
||||
* If using the default server, this will only be honoured if set, otherwise the device will use the default password
|
||||
*/
|
||||
string password = 4;
|
||||
|
||||
/*
|
||||
* Whether to send encrypted or decrypted packets to MQTT.
|
||||
* This parameter is only honoured if you also set server
|
||||
* (the default official mqtt.meshtastic.org server can handle encrypted packets)
|
||||
* Decrypted packets may be useful for external systems that want to consume meshtastic packets
|
||||
*/
|
||||
bool encryption_enabled = 5;
|
||||
|
||||
/*
|
||||
* Whether to send / consume json packets on MQTT
|
||||
*/
|
||||
bool json_enabled = 6;
|
||||
|
||||
/*
|
||||
* If true, we attempt to establish a secure connection using TLS
|
||||
*/
|
||||
bool tls_enabled = 7;
|
||||
|
||||
/*
|
||||
* The root topic to use for MQTT messages. Default is "msh".
|
||||
* This is useful if you want to use a single MQTT server for multiple meshtastic networks and separate them via ACLs
|
||||
*/
|
||||
string root = 8;
|
||||
|
||||
/*
|
||||
* If true, we can use the connected phone / client to proxy messages to MQTT instead of a direct connection
|
||||
*/
|
||||
bool proxy_to_client_enabled = 9;
|
||||
|
||||
/*
|
||||
* If true, we will periodically report unencrypted information about our node to a map via MQTT
|
||||
*/
|
||||
bool map_reporting_enabled = 10;
|
||||
|
||||
/*
|
||||
* Settings for reporting information about our node to a map via MQTT
|
||||
*/
|
||||
MapReportSettings map_report_settings = 11;
|
||||
}
|
||||
|
||||
/*
|
||||
* Settings for reporting unencrypted information about our node to a map via MQTT
|
||||
*/
|
||||
message MapReportSettings {
|
||||
/*
|
||||
* How often we should report our info to the map (in seconds)
|
||||
*/
|
||||
uint32 publish_interval_secs = 1;
|
||||
|
||||
/*
|
||||
* Bits of precision for the location sent (default of 32 is full precision).
|
||||
*/
|
||||
uint32 position_precision = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* RemoteHardwareModule Config
|
||||
*/
|
||||
message RemoteHardwareConfig {
|
||||
/*
|
||||
* Whether the Module is enabled
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Whether the Module allows consumers to read / write to pins not defined in available_pins
|
||||
*/
|
||||
bool allow_undefined_pin_access = 2;
|
||||
|
||||
/*
|
||||
* Exposes the available pins to the mesh for reading and writing
|
||||
*/
|
||||
repeated RemoteHardwarePin available_pins = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* NeighborInfoModule Config
|
||||
*/
|
||||
message NeighborInfoConfig {
|
||||
/*
|
||||
* Whether the Module is enabled
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* Neighbor Info to the mesh
|
||||
*/
|
||||
uint32 update_interval = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Detection Sensor Module Config
|
||||
*/
|
||||
message DetectionSensorConfig {
|
||||
/*
|
||||
* Whether the Module is enabled
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we can send a message to the mesh when a state change is detected
|
||||
*/
|
||||
uint32 minimum_broadcast_secs = 2;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should send a message to the mesh with the current state regardless of changes
|
||||
* When set to 0, only state changes will be broadcasted
|
||||
* Works as a sort of status heartbeat for peace of mind
|
||||
*/
|
||||
uint32 state_broadcast_secs = 3;
|
||||
/*
|
||||
* Send ASCII bell with alert message
|
||||
* Useful for triggering ext. notification on bell
|
||||
*/
|
||||
bool send_bell = 4;
|
||||
|
||||
/*
|
||||
* Friendly name used to format message sent to mesh
|
||||
* Example: A name "Motion" would result in a message "Motion detected"
|
||||
* Maximum length of 20 characters
|
||||
*/
|
||||
string name = 5;
|
||||
|
||||
/*
|
||||
* GPIO pin to monitor for state changes
|
||||
*/
|
||||
uint32 monitor_pin = 6;
|
||||
|
||||
/*
|
||||
* Whether or not the GPIO pin state detection is triggered on HIGH (1)
|
||||
* Otherwise LOW (0)
|
||||
*/
|
||||
bool detection_triggered_high = 7;
|
||||
|
||||
/*
|
||||
* Whether or not use INPUT_PULLUP mode for GPIO pin
|
||||
* Only applicable if the board uses pull-up resistors on the pin
|
||||
*/
|
||||
bool use_pullup = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* Audio Config for codec2 voice
|
||||
*/
|
||||
message AudioConfig {
|
||||
/*
|
||||
* Baudrate for codec2 voice
|
||||
*/
|
||||
enum Audio_Baud {
|
||||
CODEC2_DEFAULT = 0;
|
||||
CODEC2_3200 = 1;
|
||||
CODEC2_2400 = 2;
|
||||
CODEC2_1600 = 3;
|
||||
CODEC2_1400 = 4;
|
||||
CODEC2_1300 = 5;
|
||||
CODEC2_1200 = 6;
|
||||
CODEC2_700 = 7;
|
||||
CODEC2_700B = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether Audio is enabled
|
||||
*/
|
||||
bool codec2_enabled = 1;
|
||||
|
||||
/*
|
||||
* PTT Pin
|
||||
*/
|
||||
uint32 ptt_pin = 2;
|
||||
|
||||
/*
|
||||
* The audio sample rate to use for codec2
|
||||
*/
|
||||
Audio_Baud bitrate = 3;
|
||||
|
||||
/*
|
||||
* I2S Word Select
|
||||
*/
|
||||
uint32 i2s_ws = 4;
|
||||
|
||||
/*
|
||||
* I2S Data IN
|
||||
*/
|
||||
uint32 i2s_sd = 5;
|
||||
|
||||
/*
|
||||
* I2S Data OUT
|
||||
*/
|
||||
uint32 i2s_din = 6;
|
||||
|
||||
/*
|
||||
* I2S Clock
|
||||
*/
|
||||
uint32 i2s_sck = 7;
|
||||
}
|
||||
|
||||
/*
|
||||
* Config for the Paxcounter Module
|
||||
*/
|
||||
message PaxcounterConfig {
|
||||
/*
|
||||
* Enable the Paxcounter Module
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* metrics to the mesh
|
||||
*/
|
||||
|
||||
uint32 paxcounter_update_interval = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serial Config
|
||||
*/
|
||||
message SerialConfig {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum Serial_Baud {
|
||||
BAUD_DEFAULT = 0;
|
||||
BAUD_110 = 1;
|
||||
BAUD_300 = 2;
|
||||
BAUD_600 = 3;
|
||||
BAUD_1200 = 4;
|
||||
BAUD_2400 = 5;
|
||||
BAUD_4800 = 6;
|
||||
BAUD_9600 = 7;
|
||||
BAUD_19200 = 8;
|
||||
BAUD_38400 = 9;
|
||||
BAUD_57600 = 10;
|
||||
BAUD_115200 = 11;
|
||||
BAUD_230400 = 12;
|
||||
BAUD_460800 = 13;
|
||||
BAUD_576000 = 14;
|
||||
BAUD_921600 = 15;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum Serial_Mode {
|
||||
DEFAULT = 0;
|
||||
SIMPLE = 1;
|
||||
PROTO = 2;
|
||||
TEXTMSG = 3;
|
||||
NMEA = 4;
|
||||
// NMEA messages specifically tailored for CalTopo
|
||||
CALTOPO = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* Preferences for the SerialModule
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
bool echo = 2;
|
||||
|
||||
/*
|
||||
* RX pin (should match Arduino gpio pin number)
|
||||
*/
|
||||
uint32 rxd = 3;
|
||||
|
||||
/*
|
||||
* TX pin (should match Arduino gpio pin number)
|
||||
*/
|
||||
uint32 txd = 4;
|
||||
|
||||
/*
|
||||
* Serial baud rate
|
||||
*/
|
||||
Serial_Baud baud = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 timeout = 6;
|
||||
|
||||
/*
|
||||
* Mode for serial module operation
|
||||
*/
|
||||
Serial_Mode mode = 7;
|
||||
|
||||
/*
|
||||
* Overrides the platform's defacto Serial port instance to use with Serial module config settings
|
||||
* This is currently only usable in output modes like NMEA / CalTopo and may behave strangely or not work at all in other modes
|
||||
* Existing logging over the Serial Console will still be present
|
||||
*/
|
||||
bool override_console_serial_port = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* External Notifications Config
|
||||
*/
|
||||
message ExternalNotificationConfig {
|
||||
/*
|
||||
* Enable the ExternalNotificationModule
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* When using in On/Off mode, keep the output on for this many
|
||||
* milliseconds. Default 1000ms (1 second).
|
||||
*/
|
||||
uint32 output_ms = 2;
|
||||
|
||||
/*
|
||||
* Define the output pin GPIO setting Defaults to
|
||||
* EXT_NOTIFY_OUT if set for the board.
|
||||
* In standalone devices this pin should drive the LED to match the UI.
|
||||
*/
|
||||
uint32 output = 3;
|
||||
|
||||
/*
|
||||
* Optional: Define a secondary output pin for a vibra motor
|
||||
* This is used in standalone devices to match the UI.
|
||||
*/
|
||||
uint32 output_vibra = 8;
|
||||
|
||||
/*
|
||||
* Optional: Define a tertiary output pin for an active buzzer
|
||||
* This is used in standalone devices to to match the UI.
|
||||
*/
|
||||
uint32 output_buzzer = 9;
|
||||
|
||||
/*
|
||||
* IF this is true, the 'output' Pin will be pulled active high, false
|
||||
* means active low.
|
||||
*/
|
||||
bool active = 4;
|
||||
|
||||
/*
|
||||
* True: Alert when a text message arrives (output)
|
||||
*/
|
||||
bool alert_message = 5;
|
||||
|
||||
/*
|
||||
* True: Alert when a text message arrives (output_vibra)
|
||||
*/
|
||||
bool alert_message_vibra = 10;
|
||||
|
||||
/*
|
||||
* True: Alert when a text message arrives (output_buzzer)
|
||||
*/
|
||||
bool alert_message_buzzer = 11;
|
||||
|
||||
/*
|
||||
* True: Alert when the bell character is received (output)
|
||||
*/
|
||||
bool alert_bell = 6;
|
||||
|
||||
/*
|
||||
* True: Alert when the bell character is received (output_vibra)
|
||||
*/
|
||||
bool alert_bell_vibra = 12;
|
||||
|
||||
/*
|
||||
* True: Alert when the bell character is received (output_buzzer)
|
||||
*/
|
||||
bool alert_bell_buzzer = 13;
|
||||
|
||||
/*
|
||||
* use a PWM output instead of a simple on/off output. This will ignore
|
||||
* the 'output', 'output_ms' and 'active' settings and use the
|
||||
* device.buzzer_gpio instead.
|
||||
*/
|
||||
bool use_pwm = 7;
|
||||
|
||||
/*
|
||||
* The notification will toggle with 'output_ms' for this time of seconds.
|
||||
* Default is 0 which means don't repeat at all. 60 would mean blink
|
||||
* and/or beep for 60 seconds
|
||||
*/
|
||||
uint32 nag_timeout = 14;
|
||||
|
||||
/*
|
||||
* When true, enables devices with native I2S audio output to use the RTTTL over speaker like a buzzer
|
||||
* T-Watch S3 and T-Deck for example have this capability
|
||||
*/
|
||||
bool use_i2s_as_buzzer = 15;
|
||||
}
|
||||
|
||||
/*
|
||||
* Store and Forward Module Config
|
||||
*/
|
||||
message StoreForwardConfig {
|
||||
/*
|
||||
* Enable the Store and Forward Module
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
bool heartbeat = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 records = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 history_return_max = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 history_return_window = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* Preferences for the RangeTestModule
|
||||
*/
|
||||
message RangeTestConfig {
|
||||
/*
|
||||
* Enable the Range Test Module
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Send out range test messages from this node
|
||||
*/
|
||||
uint32 sender = 2;
|
||||
|
||||
/*
|
||||
* Bool value indicating that this node should save a RangeTest.csv file.
|
||||
* ESP32 Only
|
||||
*/
|
||||
bool save = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Configuration for both device and environment metrics
|
||||
*/
|
||||
message TelemetryConfig {
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* device metrics to the mesh
|
||||
*/
|
||||
uint32 device_update_interval = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* environment measurements to the mesh
|
||||
*/
|
||||
|
||||
uint32 environment_update_interval = 2;
|
||||
|
||||
/*
|
||||
* Preferences for the Telemetry Module (Environment)
|
||||
* Enable/Disable the telemetry measurement module measurement collection
|
||||
*/
|
||||
bool environment_measurement_enabled = 3;
|
||||
|
||||
/*
|
||||
* Enable/Disable the telemetry measurement module on-device display
|
||||
*/
|
||||
bool environment_screen_enabled = 4;
|
||||
|
||||
/*
|
||||
* We'll always read the sensor in Celsius, but sometimes we might want to
|
||||
* display the results in Fahrenheit as a "user preference".
|
||||
*/
|
||||
bool environment_display_fahrenheit = 5;
|
||||
|
||||
/*
|
||||
* Enable/Disable the air quality metrics
|
||||
*/
|
||||
bool air_quality_enabled = 6;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* air quality metrics to the mesh
|
||||
*/
|
||||
uint32 air_quality_interval = 7;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* air quality metrics to the mesh
|
||||
*/
|
||||
bool power_measurement_enabled = 8;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* air quality metrics to the mesh
|
||||
*/
|
||||
uint32 power_update_interval = 9;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* air quality metrics to the mesh
|
||||
*/
|
||||
bool power_screen_enabled = 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message CannedMessageConfig {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum InputEventChar {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NONE = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
UP = 17;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DOWN = 18;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
LEFT = 19;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RIGHT = 20;
|
||||
|
||||
/*
|
||||
* '\n'
|
||||
*/
|
||||
SELECT = 10;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
BACK = 27;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
CANCEL = 24;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating.
|
||||
*/
|
||||
bool rotary1_enabled = 1;
|
||||
|
||||
/*
|
||||
* GPIO pin for rotary encoder A port.
|
||||
*/
|
||||
uint32 inputbroker_pin_a = 2;
|
||||
|
||||
/*
|
||||
* GPIO pin for rotary encoder B port.
|
||||
*/
|
||||
uint32 inputbroker_pin_b = 3;
|
||||
|
||||
/*
|
||||
* GPIO pin for rotary encoder Press port.
|
||||
*/
|
||||
uint32 inputbroker_pin_press = 4;
|
||||
|
||||
/*
|
||||
* Generate input event on CW of this kind.
|
||||
*/
|
||||
InputEventChar inputbroker_event_cw = 5;
|
||||
|
||||
/*
|
||||
* Generate input event on CCW of this kind.
|
||||
*/
|
||||
InputEventChar inputbroker_event_ccw = 6;
|
||||
|
||||
/*
|
||||
* Generate input event on Press of this kind.
|
||||
*/
|
||||
InputEventChar inputbroker_event_press = 7;
|
||||
|
||||
/*
|
||||
* Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker.
|
||||
*/
|
||||
bool updown1_enabled = 8;
|
||||
|
||||
/*
|
||||
* Enable/disable CannedMessageModule.
|
||||
*/
|
||||
bool enabled = 9;
|
||||
|
||||
/*
|
||||
* Input event origin accepted by the canned message module.
|
||||
* Can be e.g. "rotEnc1", "upDownEnc1" or keyword "_any"
|
||||
*/
|
||||
string allow_input_source = 10;
|
||||
|
||||
/*
|
||||
* CannedMessageModule also sends a bell character with the messages.
|
||||
* ExternalNotificationModule can benefit from this feature.
|
||||
*/
|
||||
bool send_bell = 11;
|
||||
}
|
||||
|
||||
/*
|
||||
Ambient Lighting Module - Settings for control of onboard LEDs to allow users to adjust the brightness levels and respective color levels.
|
||||
Initially created for the RAK14001 RGB LED module.
|
||||
*/
|
||||
message AmbientLightingConfig {
|
||||
/*
|
||||
* Sets LED to on or off.
|
||||
*/
|
||||
bool led_state = 1;
|
||||
|
||||
/*
|
||||
* Sets the current for the LED output. Default is 10.
|
||||
*/
|
||||
uint32 current = 2;
|
||||
|
||||
/*
|
||||
* Sets the red LED level. Values are 0-255.
|
||||
*/
|
||||
uint32 red = 3;
|
||||
|
||||
/*
|
||||
* Sets the green LED level. Values are 0-255.
|
||||
*/
|
||||
uint32 green = 4;
|
||||
|
||||
/*
|
||||
* Sets the blue LED level. Values are 0-255.
|
||||
*/
|
||||
uint32 blue = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
oneof payload_variant {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
MQTTConfig mqtt = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
SerialConfig serial = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
ExternalNotificationConfig external_notification = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
StoreForwardConfig store_forward = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RangeTestConfig range_test = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
TelemetryConfig telemetry = 6;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
CannedMessageConfig canned_message = 7;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AudioConfig audio = 8;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RemoteHardwareConfig remote_hardware = 9;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NeighborInfoConfig neighbor_info = 10;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AmbientLightingConfig ambient_lighting = 11;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DetectionSensorConfig detection_sensor = 12;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
PaxcounterConfig paxcounter = 13;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A GPIO pin definition for remote hardware module
|
||||
*/
|
||||
message RemoteHardwarePin {
|
||||
/*
|
||||
* GPIO Pin number (must match Arduino)
|
||||
*/
|
||||
uint32 gpio_pin = 1;
|
||||
|
||||
/*
|
||||
* Name for the GPIO pin (i.e. Front gate, mailbox, etc)
|
||||
*/
|
||||
string name = 2;
|
||||
|
||||
/*
|
||||
* Type of GPIO access available to consumers on the mesh
|
||||
*/
|
||||
RemoteHardwarePinType type = 3;
|
||||
}
|
||||
|
||||
enum RemoteHardwarePinType {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNKNOWN = 0;
|
||||
|
||||
/*
|
||||
* GPIO pin can be read (if it is high / low)
|
||||
*/
|
||||
DIGITAL_READ = 1;
|
||||
|
||||
/*
|
||||
* GPIO pin can be written to (high / low)
|
||||
*/
|
||||
DIGITAL_WRITE = 2;
|
||||
}
|
||||
8
proto_def/meshtastic/mqtt.options
Normal file
8
proto_def/meshtastic/mqtt.options
Normal file
@@ -0,0 +1,8 @@
|
||||
*ServiceEnvelope.packet type:FT_POINTER
|
||||
*ServiceEnvelope.channel_id type:FT_POINTER
|
||||
*ServiceEnvelope.gateway_id type:FT_POINTER
|
||||
|
||||
*MapReport.long_name max_size:40
|
||||
*MapReport.short_name max_size:5
|
||||
*MapReport.firmware_version max_size:18
|
||||
*MapReport.num_online_local_nodes int_size:16
|
||||
106
proto_def/meshtastic/mqtt.proto
Normal file
106
proto_def/meshtastic/mqtt.proto
Normal file
@@ -0,0 +1,106 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "MQTTProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This message wraps a MeshPacket with extra metadata about the sender and how it arrived.
|
||||
*/
|
||||
message ServiceEnvelope {
|
||||
/*
|
||||
* The (probably encrypted) packet
|
||||
*/
|
||||
MeshPacket packet = 1;
|
||||
|
||||
/*
|
||||
* The global channel ID it was sent on
|
||||
*/
|
||||
string channel_id = 2;
|
||||
|
||||
/*
|
||||
* The sending gateway node ID. Can we use this to authenticate/prevent fake
|
||||
* nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as
|
||||
* the globally trusted nodenum
|
||||
*/
|
||||
string gateway_id = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Information about a node intended to be reported unencrypted to a map using MQTT.
|
||||
*/
|
||||
message MapReport {
|
||||
/*
|
||||
* A full name for this user, i.e. "Kevin Hester"
|
||||
*/
|
||||
string long_name = 1;
|
||||
|
||||
/*
|
||||
* A VERY short name, ideally two characters.
|
||||
* Suitable for a tiny OLED screen
|
||||
*/
|
||||
string short_name = 2;
|
||||
|
||||
/*
|
||||
* Role of the node that applies specific settings for a particular use-case
|
||||
*/
|
||||
Config.DeviceConfig.Role role = 3;
|
||||
|
||||
/*
|
||||
* Hardware model of the node, i.e. T-Beam, Heltec V3, etc...
|
||||
*/
|
||||
HardwareModel hw_model = 4;
|
||||
|
||||
/*
|
||||
* Device firmware version string
|
||||
*/
|
||||
string firmware_version = 5;
|
||||
|
||||
/*
|
||||
* The region code for the radio (US, CN, EU433, etc...)
|
||||
*/
|
||||
Config.LoRaConfig.RegionCode region = 6;
|
||||
|
||||
/*
|
||||
* Modem preset used by the radio (LongFast, MediumSlow, etc...)
|
||||
*/
|
||||
Config.LoRaConfig.ModemPreset modem_preset = 7;
|
||||
|
||||
/*
|
||||
* Whether the node has a channel with default PSK and name (LongFast, MediumSlow, etc...)
|
||||
* and it uses the default frequency slot given the region and modem preset.
|
||||
*/
|
||||
bool has_default_channel = 8;
|
||||
|
||||
/*
|
||||
* Latitude: multiply by 1e-7 to get degrees in floating point
|
||||
*/
|
||||
sfixed32 latitude_i = 9;
|
||||
|
||||
/*
|
||||
* Longitude: multiply by 1e-7 to get degrees in floating point
|
||||
*/
|
||||
sfixed32 longitude_i = 10;
|
||||
|
||||
/*
|
||||
* Altitude in meters above MSL
|
||||
*/
|
||||
int32 altitude = 11;
|
||||
|
||||
/*
|
||||
* Indicates the bits of precision for latitude and longitude set by the sending node
|
||||
*/
|
||||
uint32 position_precision = 12;
|
||||
|
||||
/*
|
||||
* Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT)
|
||||
*/
|
||||
uint32 num_online_local_nodes = 13;
|
||||
}
|
||||
29
proto_def/meshtastic/paxcount.proto
Normal file
29
proto_def/meshtastic/paxcount.proto
Normal file
@@ -0,0 +1,29 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "PaxcountProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message Paxcount {
|
||||
/*
|
||||
* seen Wifi devices
|
||||
*/
|
||||
uint32 wifi = 1;
|
||||
|
||||
/*
|
||||
* Seen BLE devices
|
||||
*/
|
||||
uint32 ble = 2;
|
||||
|
||||
/*
|
||||
* Uptime in seconds
|
||||
*/
|
||||
uint32 uptime = 3;
|
||||
}
|
||||
216
proto_def/meshtastic/portnums.proto
Normal file
216
proto_def/meshtastic/portnums.proto
Normal file
@@ -0,0 +1,216 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "Portnums";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a
|
||||
* unique 'portnum' for their application.
|
||||
* If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this
|
||||
* master table.
|
||||
* PortNums should be assigned in the following range:
|
||||
* 0-63 Core Meshtastic use, do not use for third party apps
|
||||
* 64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application
|
||||
* 256-511 Use one of these portnums for your private applications that you don't want to register publically
|
||||
* All other values are reserved.
|
||||
* Note: This was formerly a Type enum named 'typ' with the same id #
|
||||
* We have change to this 'portnum' based scheme for specifying app handlers for particular payloads.
|
||||
* This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically.
|
||||
*/
|
||||
enum PortNum {
|
||||
/*
|
||||
* Deprecated: do not use in new code (formerly called OPAQUE)
|
||||
* A message sent from a device outside of the mesh, in a form the mesh does not understand
|
||||
* NOTE: This must be 0, because it is documented in IMeshService.aidl to be so
|
||||
* ENCODING: binary undefined
|
||||
*/
|
||||
UNKNOWN_APP = 0;
|
||||
|
||||
/*
|
||||
* A simple UTF-8 text message, which even the little micros in the mesh
|
||||
* can understand and show on their screen eventually in some circumstances
|
||||
* even signal might send messages in this form (see below)
|
||||
* ENCODING: UTF-8 Plaintext (?)
|
||||
*/
|
||||
TEXT_MESSAGE_APP = 1;
|
||||
|
||||
/*
|
||||
* Reserved for built-in GPIO/example app.
|
||||
* See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
REMOTE_HARDWARE_APP = 2;
|
||||
|
||||
/*
|
||||
* The built-in position messaging app.
|
||||
* Payload is a Position message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
POSITION_APP = 3;
|
||||
|
||||
/*
|
||||
* The built-in user info app.
|
||||
* Payload is a User message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
NODEINFO_APP = 4;
|
||||
|
||||
/*
|
||||
* Protocol control packets for mesh protocol use.
|
||||
* Payload is a Routing message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
ROUTING_APP = 5;
|
||||
|
||||
/*
|
||||
* Admin control packets.
|
||||
* Payload is a AdminMessage message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
ADMIN_APP = 6;
|
||||
|
||||
/*
|
||||
* Compressed TEXT_MESSAGE payloads.
|
||||
* ENCODING: UTF-8 Plaintext (?) with Unishox2 Compression
|
||||
* NOTE: The Device Firmware converts a TEXT_MESSAGE_APP to TEXT_MESSAGE_COMPRESSED_APP if the compressed
|
||||
* payload is shorter. There's no need for app developers to do this themselves. Also the firmware will decompress
|
||||
* any incoming TEXT_MESSAGE_COMPRESSED_APP payload and convert to TEXT_MESSAGE_APP.
|
||||
*/
|
||||
TEXT_MESSAGE_COMPRESSED_APP = 7;
|
||||
|
||||
/*
|
||||
* Waypoint payloads.
|
||||
* Payload is a Waypoint message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
WAYPOINT_APP = 8;
|
||||
|
||||
/*
|
||||
* Audio Payloads.
|
||||
* Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now
|
||||
* ENCODING: codec2 audio frames
|
||||
* NOTE: audio frames contain a 3 byte header (0xc0 0xde 0xc2) and a one byte marker for the decompressed bitrate.
|
||||
* This marker comes from the 'moduleConfig.audio.bitrate' enum minus one.
|
||||
*/
|
||||
AUDIO_APP = 9;
|
||||
|
||||
/*
|
||||
* Same as Text Message but originating from Detection Sensor Module.
|
||||
* NOTE: This portnum traffic is not sent to the public MQTT starting at firmware version 2.2.9
|
||||
*/
|
||||
DETECTION_SENSOR_APP = 10;
|
||||
|
||||
/*
|
||||
* Provides a 'ping' service that replies to any packet it receives.
|
||||
* Also serves as a small example module.
|
||||
* ENCODING: ASCII Plaintext
|
||||
*/
|
||||
REPLY_APP = 32;
|
||||
|
||||
/*
|
||||
* Used for the python IP tunnel feature
|
||||
* ENCODING: IP Packet. Handled by the python API, firmware ignores this one and pases on.
|
||||
*/
|
||||
IP_TUNNEL_APP = 33;
|
||||
|
||||
/*
|
||||
* Paxcounter lib included in the firmware
|
||||
* ENCODING: protobuf
|
||||
*/
|
||||
PAXCOUNTER_APP = 34;
|
||||
|
||||
/*
|
||||
* Provides a hardware serial interface to send and receive from the Meshtastic network.
|
||||
* Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
|
||||
* network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network.
|
||||
* Maximum packet size of 240 bytes.
|
||||
* Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp.
|
||||
* ENCODING: binary undefined
|
||||
*/
|
||||
SERIAL_APP = 64;
|
||||
|
||||
/*
|
||||
* STORE_FORWARD_APP (Work in Progress)
|
||||
* Maintained by Jm Casler (MC Hamster) : jm@casler.org
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
STORE_FORWARD_APP = 65;
|
||||
|
||||
/*
|
||||
* Optional port for messages for the range test module.
|
||||
* ENCODING: ASCII Plaintext
|
||||
* NOTE: This portnum traffic is not sent to the public MQTT starting at firmware version 2.2.9
|
||||
*/
|
||||
RANGE_TEST_APP = 66;
|
||||
|
||||
/*
|
||||
* Provides a format to send and receive telemetry data from the Meshtastic network.
|
||||
* Maintained by Charles Crossan (crossan007) : crossan007@gmail.com
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
TELEMETRY_APP = 67;
|
||||
|
||||
/*
|
||||
* Experimental tools for estimating node position without a GPS
|
||||
* Maintained by Github user a-f-G-U-C (a Meshtastic contributor)
|
||||
* Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS
|
||||
* ENCODING: arrays of int64 fields
|
||||
*/
|
||||
ZPS_APP = 68;
|
||||
|
||||
/*
|
||||
* Used to let multiple instances of Linux native applications communicate
|
||||
* as if they did using their LoRa chip.
|
||||
* Maintained by GitHub user GUVWAF.
|
||||
* Project files at https://github.com/GUVWAF/Meshtasticator
|
||||
* ENCODING: Protobuf (?)
|
||||
*/
|
||||
SIMULATOR_APP = 69;
|
||||
|
||||
/*
|
||||
* Provides a traceroute functionality to show the route a packet towards
|
||||
* a certain destination would take on the mesh.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
TRACEROUTE_APP = 70;
|
||||
|
||||
/*
|
||||
* Aggregates edge info for the network by sending out a list of each node's neighbors
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
NEIGHBORINFO_APP = 71;
|
||||
|
||||
/*
|
||||
* ATAK Plugin
|
||||
* Portnum for payloads from the official Meshtastic ATAK plugin
|
||||
*/
|
||||
ATAK_PLUGIN = 72;
|
||||
|
||||
/*
|
||||
* Provides unencrypted information about a node for consumption by a map via MQTT
|
||||
*/
|
||||
MAP_REPORT_APP = 73;
|
||||
|
||||
/*
|
||||
* Private applications should use portnums >= 256.
|
||||
* To simplify initial development and testing you can use "PRIVATE_APP"
|
||||
* in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh))
|
||||
*/
|
||||
PRIVATE_APP = 256;
|
||||
|
||||
/*
|
||||
* ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder
|
||||
* ENCODING: libcotshrink
|
||||
*/
|
||||
ATAK_FORWARDER = 257;
|
||||
|
||||
/*
|
||||
* Currently we limit port nums to no higher than this value
|
||||
*/
|
||||
MAX = 511;
|
||||
}
|
||||
75
proto_def/meshtastic/remote_hardware.proto
Normal file
75
proto_def/meshtastic/remote_hardware.proto
Normal file
@@ -0,0 +1,75 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "RemoteHardware";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* An example app to show off the module system. This message is used for
|
||||
* REMOTE_HARDWARE_APP PortNums.
|
||||
* Also provides easy remote access to any GPIO.
|
||||
* In the future other remote hardware operations can be added based on user interest
|
||||
* (i.e. serial output, spi/i2c input/output).
|
||||
* FIXME - currently this feature is turned on by default which is dangerous
|
||||
* because no security yet (beyond the channel mechanism).
|
||||
* It should be off by default and then protected based on some TBD mechanism
|
||||
* (a special channel once multichannel support is included?)
|
||||
*/
|
||||
message HardwareMessage {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum Type {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNSET = 0;
|
||||
|
||||
/*
|
||||
* Set gpio gpios based on gpio_mask/gpio_value
|
||||
*/
|
||||
WRITE_GPIOS = 1;
|
||||
|
||||
/*
|
||||
* We are now interested in watching the gpio_mask gpios.
|
||||
* If the selected gpios change, please broadcast GPIOS_CHANGED.
|
||||
* Will implicitly change the gpios requested to be INPUT gpios.
|
||||
*/
|
||||
WATCH_GPIOS = 2;
|
||||
|
||||
/*
|
||||
* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value
|
||||
*/
|
||||
GPIOS_CHANGED = 3;
|
||||
|
||||
/*
|
||||
* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated
|
||||
*/
|
||||
READ_GPIOS = 4;
|
||||
|
||||
/*
|
||||
* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated
|
||||
*/
|
||||
READ_GPIOS_REPLY = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* What type of HardwareMessage is this?
|
||||
*/
|
||||
Type type = 1;
|
||||
|
||||
/*
|
||||
* What gpios are we changing. Not used for all MessageTypes, see MessageType for details
|
||||
*/
|
||||
uint64 gpio_mask = 2;
|
||||
|
||||
/*
|
||||
* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
|
||||
* Not used for all MessageTypes, see MessageType for details
|
||||
*/
|
||||
uint64 gpio_value = 3;
|
||||
}
|
||||
1
proto_def/meshtastic/rtttl.options
Normal file
1
proto_def/meshtastic/rtttl.options
Normal file
@@ -0,0 +1 @@
|
||||
*RTTTLConfig.ringtone max_size:230
|
||||
19
proto_def/meshtastic/rtttl.proto
Normal file
19
proto_def/meshtastic/rtttl.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "RTTTLConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Canned message module configuration.
|
||||
*/
|
||||
message RTTTLConfig {
|
||||
/*
|
||||
* Ringtone for PWM Buzzer in RTTTL Format.
|
||||
*/
|
||||
string ringtone = 1;
|
||||
}
|
||||
1
proto_def/meshtastic/storeforward.options
Normal file
1
proto_def/meshtastic/storeforward.options
Normal file
@@ -0,0 +1 @@
|
||||
*StoreAndForward.text max_size:237
|
||||
218
proto_def/meshtastic/storeforward.proto
Normal file
218
proto_def/meshtastic/storeforward.proto
Normal file
@@ -0,0 +1,218 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "StoreAndForwardProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message StoreAndForward {
|
||||
/*
|
||||
* 001 - 063 = From Router
|
||||
* 064 - 127 = From Client
|
||||
*/
|
||||
enum RequestResponse {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNSET = 0;
|
||||
|
||||
/*
|
||||
* Router is an in error state.
|
||||
*/
|
||||
ROUTER_ERROR = 1;
|
||||
|
||||
/*
|
||||
* Router heartbeat
|
||||
*/
|
||||
ROUTER_HEARTBEAT = 2;
|
||||
|
||||
/*
|
||||
* Router has requested the client respond. This can work as a
|
||||
* "are you there" message.
|
||||
*/
|
||||
ROUTER_PING = 3;
|
||||
|
||||
/*
|
||||
* The response to a "Ping"
|
||||
*/
|
||||
ROUTER_PONG = 4;
|
||||
|
||||
/*
|
||||
* Router is currently busy. Please try again later.
|
||||
*/
|
||||
ROUTER_BUSY = 5;
|
||||
|
||||
/*
|
||||
* Router is responding to a request for history.
|
||||
*/
|
||||
ROUTER_HISTORY = 6;
|
||||
|
||||
/*
|
||||
* Router is responding to a request for stats.
|
||||
*/
|
||||
ROUTER_STATS = 7;
|
||||
|
||||
/*
|
||||
* Router sends a text message from its history that was a direct message.
|
||||
*/
|
||||
ROUTER_TEXT_DIRECT = 8;
|
||||
|
||||
/*
|
||||
* Router sends a text message from its history that was a broadcast.
|
||||
*/
|
||||
ROUTER_TEXT_BROADCAST = 9;
|
||||
|
||||
/*
|
||||
* Client is an in error state.
|
||||
*/
|
||||
CLIENT_ERROR = 64;
|
||||
|
||||
/*
|
||||
* Client has requested a replay from the router.
|
||||
*/
|
||||
CLIENT_HISTORY = 65;
|
||||
|
||||
/*
|
||||
* Client has requested stats from the router.
|
||||
*/
|
||||
CLIENT_STATS = 66;
|
||||
|
||||
/*
|
||||
* Client has requested the router respond. This can work as a
|
||||
* "are you there" message.
|
||||
*/
|
||||
CLIENT_PING = 67;
|
||||
|
||||
/*
|
||||
* The response to a "Ping"
|
||||
*/
|
||||
CLIENT_PONG = 68;
|
||||
|
||||
/*
|
||||
* Client has requested that the router abort processing the client's request
|
||||
*/
|
||||
CLIENT_ABORT = 106;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message Statistics {
|
||||
/*
|
||||
* Number of messages we have ever seen
|
||||
*/
|
||||
uint32 messages_total = 1;
|
||||
|
||||
/*
|
||||
* Number of messages we have currently saved our history.
|
||||
*/
|
||||
uint32 messages_saved = 2;
|
||||
|
||||
/*
|
||||
* Maximum number of messages we will save
|
||||
*/
|
||||
uint32 messages_max = 3;
|
||||
|
||||
/*
|
||||
* Router uptime in seconds
|
||||
*/
|
||||
uint32 up_time = 4;
|
||||
|
||||
/*
|
||||
* Number of times any client sent a request to the S&F.
|
||||
*/
|
||||
uint32 requests = 5;
|
||||
|
||||
/*
|
||||
* Number of times the history was requested.
|
||||
*/
|
||||
uint32 requests_history = 6;
|
||||
|
||||
/*
|
||||
* Is the heartbeat enabled on the server?
|
||||
*/
|
||||
bool heartbeat = 7;
|
||||
|
||||
/*
|
||||
* Maximum number of messages the server will return.
|
||||
*/
|
||||
uint32 return_max = 8;
|
||||
|
||||
/*
|
||||
* Maximum history window in minutes the server will return messages from.
|
||||
*/
|
||||
uint32 return_window = 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message History {
|
||||
/*
|
||||
* Number of that will be sent to the client
|
||||
*/
|
||||
uint32 history_messages = 1;
|
||||
|
||||
/*
|
||||
* The window of messages that was used to filter the history client requested
|
||||
*/
|
||||
uint32 window = 2;
|
||||
|
||||
/*
|
||||
* Index in the packet history of the last message sent in a previous request to the server.
|
||||
* Will be sent to the client before sending the history and can be set in a subsequent request to avoid getting packets the server already sent to the client.
|
||||
*/
|
||||
uint32 last_request = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message Heartbeat {
|
||||
/*
|
||||
* Period in seconds that the heartbeat is sent out that will be sent to the client
|
||||
*/
|
||||
uint32 period = 1;
|
||||
|
||||
/*
|
||||
* If set, this is not the primary Store & Forward router on the mesh
|
||||
*/
|
||||
uint32 secondary = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RequestResponse rr = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
oneof variant {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Statistics stats = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
History history = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Heartbeat heartbeat = 4;
|
||||
|
||||
/*
|
||||
* Text from history message.
|
||||
*/
|
||||
bytes text = 5;
|
||||
}
|
||||
}
|
||||
4
proto_def/meshtastic/telemetry.options
Normal file
4
proto_def/meshtastic/telemetry.options
Normal file
@@ -0,0 +1,4 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
|
||||
286
proto_def/meshtastic/telemetry.proto
Normal file
286
proto_def/meshtastic/telemetry.proto
Normal file
@@ -0,0 +1,286 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "TelemetryProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Key native device metrics such as battery level
|
||||
*/
|
||||
message DeviceMetrics {
|
||||
/*
|
||||
* 0-100 (>100 means powered)
|
||||
*/
|
||||
uint32 battery_level = 1;
|
||||
|
||||
/*
|
||||
* Voltage measured
|
||||
*/
|
||||
float voltage = 2;
|
||||
|
||||
/*
|
||||
* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise).
|
||||
*/
|
||||
float channel_utilization = 3;
|
||||
|
||||
/*
|
||||
* Percent of airtime for transmission used within the last hour.
|
||||
*/
|
||||
float air_util_tx = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Weather station or other environmental metrics
|
||||
*/
|
||||
message EnvironmentMetrics {
|
||||
/*
|
||||
* Temperature measured
|
||||
*/
|
||||
float temperature = 1;
|
||||
|
||||
/*
|
||||
* Relative humidity percent measured
|
||||
*/
|
||||
float relative_humidity = 2;
|
||||
|
||||
/*
|
||||
* Barometric pressure in hPA measured
|
||||
*/
|
||||
float barometric_pressure = 3;
|
||||
|
||||
/*
|
||||
* Gas resistance in MOhm measured
|
||||
*/
|
||||
float gas_resistance = 4;
|
||||
|
||||
/*
|
||||
* Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x)
|
||||
*/
|
||||
float voltage = 5;
|
||||
|
||||
/*
|
||||
* Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x)
|
||||
*/
|
||||
float current = 6;
|
||||
}
|
||||
|
||||
/*
|
||||
* Power Metrics (voltage / current / etc)
|
||||
*/
|
||||
message PowerMetrics {
|
||||
/*
|
||||
* Voltage (Ch1)
|
||||
*/
|
||||
float ch1_voltage = 1;
|
||||
|
||||
/*
|
||||
* Current (Ch1)
|
||||
*/
|
||||
float ch1_current = 2;
|
||||
|
||||
/*
|
||||
* Voltage (Ch2)
|
||||
*/
|
||||
float ch2_voltage = 3;
|
||||
|
||||
/*
|
||||
* Current (Ch2)
|
||||
*/
|
||||
float ch2_current = 4;
|
||||
|
||||
/*
|
||||
* Voltage (Ch3)
|
||||
*/
|
||||
float ch3_voltage = 5;
|
||||
|
||||
/*
|
||||
* Current (Ch3)
|
||||
*/
|
||||
float ch3_current = 6;
|
||||
}
|
||||
|
||||
/*
|
||||
* Air quality metrics
|
||||
*/
|
||||
message AirQualityMetrics {
|
||||
/*
|
||||
* Concentration Units Standard PM1.0
|
||||
*/
|
||||
uint32 pm10_standard = 1;
|
||||
|
||||
/*
|
||||
* Concentration Units Standard PM2.5
|
||||
*/
|
||||
uint32 pm25_standard = 2;
|
||||
|
||||
/*
|
||||
* Concentration Units Standard PM10.0
|
||||
*/
|
||||
uint32 pm100_standard = 3;
|
||||
|
||||
/*
|
||||
* Concentration Units Environmental PM1.0
|
||||
*/
|
||||
uint32 pm10_environmental = 4;
|
||||
|
||||
/*
|
||||
* Concentration Units Environmental PM2.5
|
||||
*/
|
||||
uint32 pm25_environmental = 5;
|
||||
|
||||
/*
|
||||
* Concentration Units Environmental PM10.0
|
||||
*/
|
||||
uint32 pm100_environmental = 6;
|
||||
|
||||
/*
|
||||
* 0.3um Particle Count
|
||||
*/
|
||||
uint32 particles_03um = 7;
|
||||
|
||||
/*
|
||||
* 0.5um Particle Count
|
||||
*/
|
||||
uint32 particles_05um = 8;
|
||||
|
||||
/*
|
||||
* 1.0um Particle Count
|
||||
*/
|
||||
uint32 particles_10um = 9;
|
||||
|
||||
/*
|
||||
* 2.5um Particle Count
|
||||
*/
|
||||
uint32 particles_25um = 10;
|
||||
|
||||
/*
|
||||
* 5.0um Particle Count
|
||||
*/
|
||||
uint32 particles_50um = 11;
|
||||
|
||||
/*
|
||||
* 10.0um Particle Count
|
||||
*/
|
||||
uint32 particles_100um = 12;
|
||||
}
|
||||
|
||||
/*
|
||||
* Types of Measurements the telemetry module is equipped to handle
|
||||
*/
|
||||
message Telemetry {
|
||||
/*
|
||||
* Seconds since 1970 - or 0 for unknown/unset
|
||||
*/
|
||||
fixed32 time = 1;
|
||||
|
||||
oneof variant {
|
||||
/*
|
||||
* Key native device metrics such as battery level
|
||||
*/
|
||||
DeviceMetrics device_metrics = 2;
|
||||
|
||||
/*
|
||||
* Weather station or other environmental metrics
|
||||
*/
|
||||
EnvironmentMetrics environment_metrics = 3;
|
||||
|
||||
/*
|
||||
* Air quality metrics
|
||||
*/
|
||||
AirQualityMetrics air_quality_metrics = 4;
|
||||
|
||||
/*
|
||||
* Power Metrics
|
||||
*/
|
||||
PowerMetrics power_metrics = 5;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Supported I2C Sensors for telemetry in Meshtastic
|
||||
*/
|
||||
enum TelemetrySensorType {
|
||||
/*
|
||||
* No external telemetry sensor explicitly set
|
||||
*/
|
||||
SENSOR_UNSET = 0;
|
||||
|
||||
/*
|
||||
* High accuracy temperature, pressure, humidity
|
||||
*/
|
||||
BME280 = 1;
|
||||
|
||||
/*
|
||||
* High accuracy temperature, pressure, humidity, and air resistance
|
||||
*/
|
||||
BME680 = 2;
|
||||
|
||||
/*
|
||||
* Very high accuracy temperature
|
||||
*/
|
||||
MCP9808 = 3;
|
||||
|
||||
/*
|
||||
* Moderate accuracy current and voltage
|
||||
*/
|
||||
INA260 = 4;
|
||||
|
||||
/*
|
||||
* Moderate accuracy current and voltage
|
||||
*/
|
||||
INA219 = 5;
|
||||
|
||||
/*
|
||||
* High accuracy temperature and pressure
|
||||
*/
|
||||
BMP280 = 6;
|
||||
|
||||
/*
|
||||
* High accuracy temperature and humidity
|
||||
*/
|
||||
SHTC3 = 7;
|
||||
|
||||
/*
|
||||
* High accuracy pressure
|
||||
*/
|
||||
LPS22 = 8;
|
||||
|
||||
/*
|
||||
* 3-Axis magnetic sensor
|
||||
*/
|
||||
QMC6310 = 9;
|
||||
|
||||
/*
|
||||
* 6-Axis inertial measurement sensor
|
||||
*/
|
||||
QMI8658 = 10;
|
||||
|
||||
/*
|
||||
* 3-Axis magnetic sensor
|
||||
*/
|
||||
QMC5883L = 11;
|
||||
|
||||
/*
|
||||
* High accuracy temperature and humidity
|
||||
*/
|
||||
SHT31 = 12;
|
||||
|
||||
/*
|
||||
* PM2.5 air quality sensor
|
||||
*/
|
||||
PMSA003I = 13;
|
||||
|
||||
/*
|
||||
* INA3221 3 Channel Voltage / Current Sensor
|
||||
*/
|
||||
INA3221 = 14;
|
||||
|
||||
/*
|
||||
* BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280)
|
||||
*/
|
||||
BMP085 = 15;
|
||||
}
|
||||
6
proto_def/meshtastic/xmodem.options
Normal file
6
proto_def/meshtastic/xmodem.options
Normal file
@@ -0,0 +1,6 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
*XModem.buffer max_size:128
|
||||
*XModem.seq int_size:16
|
||||
*XModem.crc16 int_size:16
|
||||
27
proto_def/meshtastic/xmodem.proto
Normal file
27
proto_def/meshtastic/xmodem.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "XmodemProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
message XModem {
|
||||
enum Control {
|
||||
NUL = 0;
|
||||
SOH = 1;
|
||||
STX = 2;
|
||||
EOT = 4;
|
||||
ACK = 6;
|
||||
NAK = 21;
|
||||
CAN = 24;
|
||||
CTRLZ = 26;
|
||||
}
|
||||
|
||||
Control control = 1;
|
||||
uint32 seq = 2;
|
||||
uint32 crc16 = 3;
|
||||
bytes buffer = 4;
|
||||
}
|
||||
10
requirements.txt
Normal file
10
requirements.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
protobuf
|
||||
aiomqtt
|
||||
sqlalchemy[asyncio]
|
||||
cryptography
|
||||
aiosqlite
|
||||
aiohttp
|
||||
aiodns
|
||||
Jinja2
|
||||
aiohttp-sse
|
||||
asyncpg
|
||||
Reference in New Issue
Block a user