Skip to content

MAVProxy on a Raspberry Pi

To handle the command sending between the buttons on my controller (powered by an Arduino) and the UAV, I am using a Raspberry Pi.  This RasPi now has MAVProxy installed on it, and can successfully connect to the UAV.
IMG_20150424_135234971_HDR
The Raspberry Pi belongs to a colleague, and is running the Raspbian operating system (OS) (http://www.raspbian.org/).  This is a very stripped down version of Linux.  This has made getting MAVProxy easier on the RasPi than it was on my Windows laptop, as a lot of the Python code required to run it is native to Linux.

The RasPi only has a few ports on it.  It has 2 USB ports, which allows for a keyboard and a mouse.  However, it has been difficult to get on to my University network.  The Uni network requires all connected devices to be registered with it before they have permission to connect.  The RasPi seemed to dislike connecting to the network.  I have a USB wireless dongle which I connected to the RasPi, allowing it to access the internet via wireless tethering from my phone.  This meant that I had to switch between keyboard and mouse (I found that not all tasks could be accomplished with just a keyboard, as should be possible).  The owner of the Raspberry Pi arranged to have it manually added to the University network (using his Postgrad student powers), meaning that I can connect to it via my laptop by SSHing to it on Putty.  This also means that I can connect to the RasPi without being in close proximity to it, if I need to.  It also removes the fuss of having to locate a screen/keyboard/mouse for it.  The RasPi is now connected to the network via ethernet, and has one of the wireless 433MHz transceivers connected on a USB port.

MAVProxy seems to launch fine on the RasPi, but seems to have a weird issue.  It recieves outputs of random-ish (generally 3, x and f) characters for no apparent reason.  It does this when being connected to from both Windows and Linux-based systems.  It also does not seem to detect the port that the UAV is connected on correctly.
raspimav
This was fixed by trial and error connecting with different baud rates.  In the end, a baud rate of 57600 worked and connected to the UAV correctly.  Instead of being random characters, the data being output has become parameter names.  I am unsure as to why they are being output in this fashion however, as they were not when connected directly to the laptop.  However MAVProxy correctly accepts commands (which it did not before) and so seems to be functioning correctly.

Published inBSc Dissertation

One Comment

  1. Kate Kate

    Hi Vic,

    I’m currently taking part in a glider project that looks quite similar to what you’ve done, and I keep coming across your blog posts. I’m trying to use MAVProxy with a Raspberry Pi to programme waypoints for flight, but am currently a bit stumped. I was hoping you might be able to answer a few questions:

    – Were you able to use Python to generate MAVLink commands?
    – If so, how did you go about this, did you simply use the waypoint load command?

    If you have any other advice that would be really helpful too.

    Thanks,
    Kate

Leave a Reply to Kate Cancel reply

Your email address will not be published. Required fields are marked *