Talking to a PX4 FMU with a RPi via Serial. #noUSB

I am newbie and having a little problem with the protoc-gen-dcsdk for my Raspberry PI.
I am following the example: https://mavsdk.mavlink.io/develop/en/contributing/build.html#build_backend
I can run “pip3 install -r requirements.txt -r requirements-dev.txt” with no errors.
If I enter “which protoc-gen-dcsdk” then nothing is returned.
I can see the directory protoc-gen-dcsdk in the directory “~/MAVSDK/MAVSDK-Python/proto/pb_plugins” with multiple .py files.
I guess that I can’t generate the Python wrappers until I resolve this issue.
What I am missing? Thanks!

@jpk @JonasVautherin @hamishwillee I am running into a similar issue where I build mavsdk_server from source and then i run the server from that file location itself. In another instance I ran python3 firmware_version.py and all i get is
Waiting for mavsdk_server to be ready…

Were you able to solve your issue?

My config is
Platform: rpi3
os: Buster
Kernel: 5.4.51-v7+

Thanks

Hi arkos,
as posted above I have cross-compiled mavsdk_server on a PC. I did not investigate further to compile it on the PiZero as this solution is fine for me.

You are the King
Almost moved to dronekit but then I found your post and it worked.
Still need to run mavsdk_server manually with $ ./mavsdk_server -p 50051 serial:///dev/serial0:921600 after copying the file from: “/home/pi/MAVSDK/build/default/src/mavsdk_server/src” to: “/home/pi/MAVSDK-Python/mavsdk/bin” in my case
Thanks!!!

For building mavsdk_server, it appears you must now use -DBUILD_MAVSDK_SERVER=ON instead of -DBUILD_BACKEND=ON. If you did the latter first, like me, you must turn -DBUILD_BACKEND off, so that CMakelist evaluates it as false. You can just do:

sudo cmake -DBUILD_BACKEND=OFF -DBUILD_MAVSDK_SERVER=ON --symlink-install --cmake-args “-DCMAKE_SHARED_LINKER_FLAGS=’-latomic’” “-DCMAKE_EXE_LINKER_FLAGS=’-latomic’” -Bbuild/default -H.

For anyone coming to this page now:

Using pip3 install --user --upgrade mavsdk will now handle everything for a raspberry pi (I have been using a raspberry pi zero). This issue was helpful to me, and has information for the correct system address for usb through mavsdk.

The instructions here will probably still work, but IT CAN TAKE A WHILE to perform all the steps. Instructions for setting up the physical layer, and setting up the correct ports, were very helpful - so thanks for that!

1 Like

It was a pain for me to install mavsdk with pip on RPi4 and Ubuntu Server until I upgraded pip.

sudo apt update && sudo apt install python3-pip
pip3 install --user --upgrade pip
pip3 install --user mavsdk
1 Like