Update README.md

Expanded meshtastic installation instructions.
This commit is contained in:
IZ1IVA
2021-01-04 16:46:25 +01:00
committed by GitHub
parent e0bc4318bf
commit af15b808cd

View File

@@ -2,16 +2,23 @@
A python client for using [Meshtastic](https://www.meshtastic.org) devices. This small library (and example application) provides an easy API for sending and receiving messages over mesh radios. It also provides access to any of the operations/data available in the device user interface or the Android application. Events are delivered using a publish-subscribe model, and you can subscribe to only the message types you are interested in.
Full documentation including examples and installation instructions [here](https://meshtastic.github.io/Meshtastic-python/meshtastic/index.html).
Full documentation including examples [here](https://meshtastic.github.io/Meshtastic-python/meshtastic/index.html).
But suffice it to say, it is really easy (note, you must use pip version 20 or later):
Installation is easily done through the Python package installer pip (note, you must use pip version 20 or later):
- check that your computer has the required serial drivers installed, if not download them from [here](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers).
- check that your computer has Python 3 installed.
- check that your computer has “pip3” installed, if not follow [this guide](https://www.makeuseof.com/tag/install-pip-for-python/).
- check that pytap2 is installed by pip3. If not, install it:
```
pip3 install --upgrade meshtastic
sudo pip3 install --upgrade pytap2
```
- install meshtastic:
```
sudo pip3 install --upgrade meshtastic
```
then run the following python3 code:
An example using Python 3 code to send a message to the mesh:
```
import meshtastic
interface = meshtastic.SerialInterface() # By default will try to find a meshtastic device, otherwise provide a device path like /dev/ttyUSB0
@@ -23,7 +30,12 @@ For the rough notes/implementation plan see [TODO](https://github.com/meshtastic
## Command line tool
This pip package will also install a "meshtastic" commandline executable, which displays packets sent over the network as JSON and lets you see serial debugging information from the meshtastic devices. The source code for this tool is also a good [example](https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/__main__.py) of a 'complete' application that uses the meshtastic python API.
This pip package will also install a "meshtastic" command line executable, which displays packets sent over the network as JSON and lets you see serial debugging information from the meshtastic devices. The source code for this tool is also a good [example](https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/__main__.py) of a 'complete' application that uses the meshtastic python API.
To display a (partial) list of the available commands:
```
meshtastic -h
```
You can also use this tool to set any of the device parameters which are stored in persistent storage. For instance, here's how to set the device
to keep the bluetooth link alive for eight hours (any usage of the bluetooth protcol from your phone will reset this timer)