Home        Store        Learn        Blog

Reading Tether turns

Is it possible to read Tetherturns via pymavlink or mavlink2rest ?

Hi @arend,

Try this:

from pymavlink import mavutil

# Create the connection
master = mavutil.mavlink_connection('udpin:')
# Wait a heartbeat before sending commands

while True:
    msg = master.recv_match()
    if not msg:
    if msg.get_type() == 'NAMED_VALUE_FLOAT':
        if msg.name == "TetherTrn":
            print("Tether turns: %s" % msg.value)

Hi @arend,

Just a reminder that is also possible to fetch the value using mavlink2rest via the websocket feature:
You can use as argument --url\?filter\=NAMED_VALUE_FLOAT

Thank you very much for the replay :slight_smile: @patrickelectric and @williangalvani

Hi @patrickelectric ,
Sorry for the late replay.
When i try to fetch data i get:
aiohttp.client_exceptions.WSServerHandshakeError: 404, message=‘Invalid response status’, url=URL(‘*’)
Unclosed client session

This happen when i try to run the example as well. Is there anything else i need to do before i can run a websocket request ?

I believe you need to get a newer version of mavlink2rest. Download it here and replace the mavlink2rest file at ~/companion/tools/. Remember to make it executable (chmod +x).


@williangalvani is correct, you should have mavlink2rest 0.9.0+ version, also make sure to have the latest companion version available running.