question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mavsdk.info.InfoError: INFORMATION_NOT_RECEIVED_YET

See original GitHub issue

Hi I’m using MVSDK-Python for quite some while and its helpful in many ways. Recently I tried using MAVSDK-Python to work on raspberry pi which is a companion computer with Pixhawk 4. The serial connection between Pi and Pixhawk4 is on /dev/ttyAMA0 port and the MAVLINK data is routed to udp port 13000 using mavlink-router. While the code_A.py works on the Pi, I get an error when I try to run code_B.py. Also until yesterday code_B.py ran without errors on Pi, but today I’m getting this error mavsdk.info.InfoError: INFORMATION_NOT_RECEIVED_YET (full error below)

code_A.py (this works as expected)

!/usr/bin/env python3

import asyncio
from mavsdk import System

async def run():
    # Init the drone
    drone = System()
    await drone.connect(system_address="udp://:13000")

    # Start the tasks
    asyncio.ensure_future(print_battery(drone))
    asyncio.ensure_future(print_gps_info(drone))
    asyncio.ensure_future(print_in_air(drone))
    asyncio.ensure_future(print_position(drone))

async def print_battery(drone):
    async for battery in drone.telemetry.battery():
        print(f"Battery: {battery.remaining_percent}")


async def print_gps_info(drone):
    async for gps_info in drone.telemetry.gps_info():
        print(f"GPS info: {gps_info}")


async def print_in_air(drone):
    async for in_air in drone.telemetry.in_air():
        print(f"In air: {in_air}")


async def print_position(drone):
    async for position in drone.telemetry.position():
        print(position)


if __name__ == "__main__":
    # Start the main function
    asyncio.ensure_future(run())

    # Runs the event loop until the program is canceled with e.g. CTRL-C
    asyncio.get_event_loop().run_forever()

code_B.py

#!/usr/bin/env python

import asyncio
from mavsdk import System

async def run():

    # Init the drone
    vehicle = System()
    await vehicle.connect(system_address="udp://:13000")

    # vehicle = System(mavsdk_server_address="localhost", port=50040)
    # await vehicle.connect()

    async for state in vehicle.core.connection_state():
        if state.is_connected:
            print(f"Vehicle discovered with UUID: {state.uuid}")
            break

    id_info = await vehicle.info.get_identification()
    print(id_info)

if __name__ == '__main__':
    # Start the main function
    asyncio.ensure_future(run())

    # Runs the event loop until the program is canceled with e.g. CTRL-C
    asyncio.get_event_loop().run_forever()

code_B.py output

Waiting for mavsdk_server to be ready...
Connected to mavsdk_server!
Vehicle discovered with UUID: 0
Task exception was never retrieved
future: <Task finished coro=<run() done, defined at drone_id.py:6> exception=InfoError(<mavsdk.info.InfoResult object at 0x7528a2f0>, 'get_identification()')>
Traceback (most recent call last):
  File "drone_id.py", line 20, in run
    id_info = await vehicle.info.get_identification()
  File "/home/pi/.local/lib/python3.7/site-packages/mavsdk/info.py", line 666, in get_identification
    raise InfoError(result, "get_identification()")
mavsdk.info.InfoError: INFORMATION_NOT_RECEIVED_YET: 'Information Not Received Yet'; origin: get_identification(); params: ()

I’m not able to understand why this line (id_info = await vehicle.info.get_identification()) is throwing error. Both the codes work on Ubuntu PC, only the code_B.py doesn’t work on Pi. Also, to add to the weirdness code_B.py was working yesterday on the same Pi.

I’m using the latest Raspian Buster OS.

Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
JonasVautherincommented, Dec 10, 2020

MAVSDK needs to receive the data from PX4. Until it does, if you call get_identification(), it will raise an error (that you should catch and act accordingly). My feeling is that for some reason, sometimes you call get_identification() before the information has reached MAVSDK from PX4 (either the message gets lost, or takes time to be sent, whatever).

So you may need to try multiple times, or just to wait a bit longer before you call get_identification().

1reaction
hashimKcommented, Dec 10, 2020

Ok thanks will implement error handling henceforth on every await calls. Thanks for the explanation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve connection error handling · Issue #49 - GitHub
For instance, using get_version() and catching InfoError. ... INFORMATION_NOT_RECEIVED_YET: 'Information not received yet'; origin: ...
Read more >
Usage/Paradigms · MAVSDK Guide
This topic provides general/overview information about how the MAVSDK is used, designed and some limitations.
Read more >
Info — MAVSDK-Python 1.4.1 documentation
Provide information about the hardware and/or software of a system. Generated by dcsdkgen - MAVSDK Info API ... InfoError – If the request...
Read more >
Getting started with MAVSDK – Python - Auterion
MAVSDK is a set of libraries providing a high-level API to MAVLink, providing easy to learn programmatic access to vehicle information and telemetry, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found