Amazing explanation! Worked almost perfectly for me except my mavsdk_server could not start, i was able to quickly fix it by replacing it with the mavsdk_server_linux-armv7 binary release file from v0.24(latest release at time of writing) after renaming it to mavsdk_server.
I did accidently interrupt Step 5 from the ‘Building SDK from Source’, I don’t know enough about build processes to know if this could be the cause.
Additionaly, on the mavrouter part, copying the following line from the explanation does not work: ./autogen.sh && ./configure CFLAGS='-g -O2' \ --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \ --prefix=/usr
but the one from the mavlink-router github readme.MD explanaition did work:
I.e. looking at this I’m seeing comments like “… except my mavsdk_server could not start, i was able to quickly fix it by replacing it with the mavsdk_server_linux-armv7 binary release file from v0.24(latest release at time of writing) after renaming it to mavsdk_server.”
i was able to quickly fix it by replacing it with the mavsdk_server_linux-armv7
Yes, that’s what needs to be done. We don’t distribute mavsdk_server for arm through pip (yet). Would be nice to distribute arm64 there, but that requires some work on dockcross (if anybody wants to contribute, I started working on it here: https://github.com/dockcross/dockcross/issues/367).
Hello,
first of all: Thank you for this guideline!
I went through your guideline but when I try $ python3 firmware_version.py
all I get is Waiting for mavsdk_server to be ready…
So I tried to start mavsdk_server stand alone, but this creates this error message: ~/MAVSDK/build/default/src/backend/src $ ./mavsdk_server ./mavsdk_server: error while loading shared libraries: /home/pi/MAVSDK/build/default/src/backend/src/libmavsdk_server.so: unexpected reloc type 0x03
I did google for the unexpected reloc type issue, but as I am a Linux-n00b this does not get me far… ==> Can you give me some advice how to proceed?
My setup:
Raspberry Pi Zero w / armv6l
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 4.19.97+
@physicsman, first of all, thanks for the guide, it’s already helping others and having a positive impact.
I had to edit the title of this post as it went against our Code of Conduct, please try to be inclusive towards other communities and fellow community members, please DM me if you have any questions.
Hi physicsman thank you for the detailed post, I wish I had stumbled upon this before I spent a week or so to do the exact same thing. Did you get it to work via RPi uart port? All the documentation I found was to use FTDI through USB, and I just gave up on trying to connect directly.
@physicsman , credit to Adrian Rosebrock here is a quick fix for the memory issue. From https://www.pyimagesearch.com/2018/09/26/install-opencv-4-on-your-raspberry-pi/ : sudo nano /etc/dphys-swapfile, change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=2048, then sudo /etc/init.d/dphys-swapfile stop then sudo /etc/init.d/dphys-swapfile stop. Once you’re done with compilation/link, change back the value to 100.
I manage to go throught the whole tutorial (I restarted from a clean NOOS image so will delete my previous post), I don’t even have the issue with “which protoc-gen-dcsdk” but I’m stuck at “Waiting for mavsdk_server to be ready…” I’ll have a look tonight
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+
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:
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!