Skip to main content

This module allows you to implement the transmitter logic for MSP

Project description

InavMSPApi

Main information

To work with SMEs, you must select a transmitter. Then you need to pass the address for the connection to the transmitter as a parameter. Connect and pass the transmitter as a parameter to an instance of the MultirotorControl class.

Examples

Example Serial

from inavmspapi import MultirotorControl 
from inavmspapi.transmitter import SerialTransmitter
from inavmspapi.msp_codes import MSPCodes

import time

ADDRESS = "COM6"

MSPV2_INAV_STATUS = 0x2000

serial_transmitter = SerialTransmitter(ADDRESS)
serial_transmitter.connect()
control = MultirotorControl(serial_transmitter)

time.sleep(2)

msg = control.send_RAW_msg(MSPV2_INAV_STATUS, data=[])
data_handler = control.receive_msg()

print("data_hendler: {0}".format(data_handler))
data = control.process_recv_data(data_handler)

print("data: {0}".format(data))

Example TCP

from inavmspapi import MultirotorControl  
from inavmspapi.transmitter import TCPTransmitter  
from inavmspapi.msp_codes import MSPCodes

import time

HOST = '127.0.0.1'
PORT = 5760
ADDRESS = (HOST,PORT)

MSPV2_INAV_STATUS = 0x2000

tcp_transmitter = TCPTransmitter(ADDRESS)
tcp_transmitter.connect()
control = MultirotorControl(tcp_transmitter)

time.sleep(2)

msg = control.send_RAW_msg(MSPV2_INAV_STATUS, data=[])
data_handler = control.receive_msg()

print("data_hendler: {0}".format(data_handler))
data = control.process_recv_data(data_handler)

print("data: {0}".format(data))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inavmspapi-1.1.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inavmspapi-1.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file inavmspapi-1.1.0.tar.gz.

File metadata

  • Download URL: inavmspapi-1.1.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for inavmspapi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d007b6742e631fdc644fdf04cf9059a72873cfe31fc73780be6d6d87fffa4d8c
MD5 281cd5d29f6448630676e1df7b2eda9e
BLAKE2b-256 7e3d04cef4c000c57e1154681e37797c49659dd25bae4d850f9e7d6d0bcb229d

See more details on using hashes here.

File details

Details for the file inavmspapi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: inavmspapi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for inavmspapi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f13948f9a21d59e33c7d994b9017aa2bb7cf72223e84d12190d914fdabe1ae3
MD5 e789cf3b49c386076bcc54d3dfd62308
BLAKE2b-256 f662e36412b5dfa06e11862dc5080ea0ac94aeddc69a10d7c25f61b35456fdc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page