meshtastic/website/docs/software/python/installation.md

69 lines
2.7 KiB
Markdown
Raw Normal View History

2021-04-28 14:38:14 -07:00
---
id: python-installation
title: Meshtastic-python installation
sidebar_label: Installation
---
This is a python library for using Meshtastic 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.
2021-04-28 15:47:40 -07:00
[Full documentation](https://meshtastic.github.io/Meshtastic-python) for the library, including examples, is available.
2021-04-28 14:38:14 -07:00
Installation is easily done through the Python package installer pip (note, you must use pip version 20 or later):
2021-04-28 17:02:12 -07:00
## Linux
- Check that your computer has the required serial drivers installed
2021-04-28 14:38:14 -07:00
* Connect your Meshtastic device to your USB port
* Use the command
2021-04-28 15:47:40 -07:00
```bash
2021-04-28 14:38:14 -07:00
lsusb
```
* You should see something like `CP210X USB to UART Bridge Controller`
2021-04-28 17:02:12 -07:00
* If not download the drivers from [Silicon Labs](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers).
- Check that your computer has Python 3 installed.
2021-04-28 15:47:40 -07:00
* Use the command
```bash
python3 -V
```
* If this does not return a version, install [python](https://www.python.org)
2021-04-28 17:02:12 -07:00
- Pip is typically installed if you are using python 3 version >= 3.4
2021-04-28 15:47:40 -07:00
* Check that pip is installed using this command
```bash
2021-04-29 03:22:26 -07:00
pip3 -V
2021-04-28 15:47:40 -07:00
```
* If this does not return a version, install [pip](https://pip.pypa.io/en/stable/installing/)
2021-04-28 17:02:12 -07:00
- Install pytap2
2021-04-28 15:47:40 -07:00
```bash
sudo pip3 install --upgrade pytap2
```
2021-04-28 17:02:12 -07:00
- Install meshtastic:
2021-04-28 15:47:40 -07:00
```bash
sudo pip3 install --upgrade meshtastic
```
2021-04-28 17:02:12 -07:00
## Windows
- Check that your computer has the required serial drivers installed
* Connect your Meshtastic device to your USB port
* Open Device Manager
* Under `Ports (COM & LPT)` you should see something like `Silicon Labs CP210X USB to UART Bridge (COM5)`
* If not download the drivers from [Silicon Labs](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers).
- Check that your computer has Python 3 installed.
* Use the command
```powershell
py -V
```
* If this does not return a version, install [python](https://www.python.org)
- Pip is typically installed if you are using python 3 version >= 3.4
* Check that pip is installed using this command
```powershell
pip3 -V
```
* If this does not return a version, install [pip](https://pip.pypa.io/en/stable/installing/)
- Install pytap2
```powershell
pip3 install --upgrade pytap2
```
- Install meshtastic:
```powershell
pip3 install --upgrade meshtastic
```