MAVSDK-Python: Raspberry Pi : from mavsdk : Illegal Instruction
Im starting off with mavsdk on my raspberry pi connected to a pixhawk via the UART.
the following is the code.
when i run it with “python3 simple_arm.py”
the terminal shows the output as “Illegal Instruction”
i think ive narrowed down the issue to
from mavsdk import System
P.S : Does mavsdk python work on raspberry Pi model B+ (with arm6)?
import asyncio
from mavsdk import System
async def run():
print("In run")
drone =System()
await drone.connect(system_address="udp://localhost:14550")
print("Waiting to connect to drone.....")
async for state in drone.core.connection_state():
if state.is_connected:
print("Conected to drone: %s" % state.uuid)
break
print("Waiting for drone to have a global position estimate...")
async for health in drone.telemetry.health():
if health.is_global_position_ok:
print("Global position estimate ok")
break
if __name__ == "__main__":
print("In main loop")
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 37
I’ll try your workaround, thank you @julianoes!
EDIT: It works! 🎉
tried a different powersupply. reinstalled everything from scratch. still no luck
This should be fixed according to https://github.com/piwheels/packages/issues/217#issuecomment-872874116.
Ok, I can reproduce the problem on my RPi 1:
I believe the problem stems from grpcio. When I install grpcio using
sudo apt-get install python3-grpcio
it works. However, when I install it with pip as part ofpip3 install --user mavsdk
it doesn’t work and fails withIllegal Instruction
.I’ve followed up in the issues, see: https://github.com/grpc/grpc/issues/26474 https://github.com/piwheels/packages/issues/217
For now, I suggest this workaround:
@julianoes Just to follow up
Pi Zero - Raspbian GNU/Linux Version 9 Python v3.9.5
mavsdk version - 0.18.0 also tried version 0.17.0