Navio2 support for Ubuntu 20.04

It would be great if you could add support for current Ubuntu LTS for arm64, enabling to use Ubuntu+Navio2 with Raspberry Pi 3 and 4. This would be an awesome feature if you want to use ROS without Ardupilot, such as my case, or even better to move forward to the new ROS2 middleware, fully supported by Canonical in their Raspberry releases.
Since ROS/ROS2 binaries are available for the arm64 architecture, not to mention all the dependency libraries, it would make a lot easier to integrate ROS/ROS2 solutions with Navio2 and a direct interface to Navio2 such as:

Here are listed the steps I did so far and the results obtained:

After a fresh install of Ubuntu 20.04:

sudo apt-get install libnss-mdns

to get Zeroconf working

Then, I modified /boot/firmware/usercfg.txt in order to enable SPI and I2C

dtoverlay=pi3-disable-bt
dtparam=spi=on
dtoverlay=spi0-4cs
dtoverlay=spi1-1cs,cs0_pin=16,cs0_spidev=disabled
dtoverlay=rcio
dtoverlay=navio-rgb
dtparam=i2c1=on
dtparam=i2c1_baudrate=1000000

Install pigpio from source, since it is not available in the Ubuntu repositories

Download Emlid Navio2 C++ examples from

The examples compile and run as root. This is due to permissions in the devices. You can modify udev rules and and groups to let users access the SPI devices.

Access to MPU IMU, GPS and RGB led work.

What did not work?

Access to LSM IMU did not work. I suppose this is because Ubuntu does not have the spi0-4cs overlay which I think enables 4 slaves to the spi-0 port. Perhaps we could copy the binary overlay from the Raspbian Emlid distribution (which I am not sure about) or try to make one. Maybe this helps to write an overlay STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree - Page 2 - Raspberry Pi Forums

I could install rcio-dkms on the default Ubuntu kernel and load the rcio kernel modules after following instructions from GitHub - emlid/rcio-dkms but the suggested test

cat /sys/kernel/rcio/status/alive

fails and the rcio overlay is not generated (but I don’t know if it should).

If some instructions were provided by Emlid, I would be happy to try them on my Raspberry Pi 3 with a Navio2 and report any issue.

I would like to add that I tried using the lastest Debian Buster image from Emlid, which comes with ROS Kinetic preinstalled. However, the Navio2 ROS nodes from GitHub - gmsanchez/navio2_ros: Direct ROS interface for Navio2 crash with segfault, and at compile time, I get some ldd errors from libboost, which says that roscpp needs version 1.58 and that Raspbian has 1.67. Tried to solve by downgrading to libboost-1.58-dev, but the system wanted to uninstall ros-kinetic packages. I also tried to compile ROS Noetic from source, but I am stil struggling to get rosdep to run and it is a time consuming workaround.

As a matter of fact, several users could be interesting in developing other solution than Ardupilot, therefore could be very customer-oriented to make a wiki page referring to the steps to install and configure Navio2 with Ubuntu arm64 releases, to enable all these customers to develop their functionalities with Emlid hardware.

4 Likes

Dear Guido,
Did you hear any news from Emlid?
@tatiana.andreeva did you ask internally for help?

Hi all,

Your request is noted, however, in the meantime we are not planning to start supporting Ubuntu. We keep supporting Ardupilot and ROS with our Raspbian image.

@dmitriy.ershov thanks for the response.

If you could just help us a little to get Ubuntu running on a Raspberry Pi (model 3 or 4) with Navio and Navio2 that would be highly appreciated. Do you think that would be possible?

On the other hand, if you plan to keep supporting Raspbian with ROS, please use the suggested ROS version for each of the Raspbian version, because the version installed with the lastest Raspbian doesn’t work (see RPI4 libboost 1.67 error - run custom ROS nodes - #26 by guido_sanchez).

Raspbian Stretch images should ship with ROS Melodic and Raspbian Buster images should ship with ROS Noetic. I am really not sure if installing the Ubuntu armhf is a good fit, I was having trouble while trying to compile ROS packages for ROS Kinetic on the lastest Raspbian image and I couldn’t update to Melodic or Noetic using the armhf Ubuntu packages (see Cross-compile ROS instead of using the Ubuntu pre-build packages by lucasgrelaud · Pull Request #8 · emlid/pi-gen-navio · GitHub) and the issues and pull requests of GitHub - emlid/pi-gen-navio. However, compiling ROS Noetic from sources worked on Raspbian Buster.

1 Like

Thanks for replying.

As I understand from your reply, Emlid has no intention to follow up on this request, neither to support @guido_sanchez in solving the issues with ROS incompatibility.

Thanks for taking note of our request and given the trend of technical support I will definitely search for a different solution for my current and future products. As CTO of a company I cannot tolerate to buy hardware not supported or with lack of technical support, especially when (as this case suggests) even the technical people of the hardware company do not fully understand ROS (or any other alternative) world and stick to Ardupilot project as the only reasonable way to deliver functionality out in the market.

You had the opportunity to fill a particular place in the market, given that your direct competitor such as Erle Robotics pxfmini is out.

But probably I also understand the reason why the same competitor is not pursuing the raspberry pi autopilot solution, as much cheaper alternative are available…

Thanks a lot for making my decision so clear.

V.

1 Like

This topic comes up as the very first result in an internet search for “navio2 ubuntu 20”.

Looks like the thread is still fresh and I’m not too late to the party. I just received my Navio2 in mail after weeks of covid-19 related shipping delays and I’ve been eager to start using it. And then I read that Navio2 is not supported by Emlid on Ubuntu (20.04 LTS)? What? This must be a mistake.

I have to agree with Vincenzo. As another CTO that was enticed by the (strictly subjective apparently) vision of leveraging Pi, Ubuntu and Navio2, and the possibilities that this combination could bring, it should be said that not supporting that combo is a missed opportunity for Emlid. I can’t imagine that the support decision to prefer Raspbian over Ubuntu was a decision guided by sound market research and engineering. Everyone knows that Raspbian is a desktop-first OS, it’s missing features (as stated in this very thread) and is notoriously behind in development for some other features. Wouldn’t you want to facilitate running something lean, with advanced AI support, and with the latest packages like Ubuntu Server 20.04 LTS as the software guts of your Flight Controller product?

The fact that Ubuntu has been strongly supported on Raspberry Pi since pretty much version 16.04 is an amazing accomplishment, and both sides of this partnership (the Raspbian Foundation and the Ubuntu community) should be commended for it. Please take advantage of that opportunity. There is a lot of server software written for Ubuntu server that could and should be used in a FC.

Who are you trying to target with your software support strategy? Beginners? Not, because of the costs and steep curve. Enthusiasts? They can buy one of the cheaper FCs out there and be done and enjoy recreational flying. Researchers? Pros? Not when you don’t intend to support Ubuntu.

It probably explains why I keep seeing Navio2s sold for cheap on internet auction sites: people are first enticed by the marketing but then are hit hard with lack of software support like evidenced here and the hardware becomes a paperweight.

The Navio2 hardware has the potential of becoming an amazing platform but if the software support is not there, it becomes a fancy and very expensive GPIO - serial adapter with some modules available elsewhere.

I just spent $250+ on your product; for that money I could have purchased a Pixhawk 4 Mini and this $10 little gizmo https://www.digikey.com/product-detail/en/4d-systems-pty-ltd/4D-SERIAL-PI-ADAPTOR/1613-1005-ND/5725396 and probably be ahead already, both in terms of costs and development schedule. Pixhawk provides the GPS (same Neo M8N) and compass units and I could just write a communication layer between the FC and the RPi and be done.

With the money you Emlid guys are charging for this fancy hardware you need to do much better than this.

Please forward this thread to your PMs and leadership at Emlid and set the Ubuntu support at Emlid on the right tracks. Don’t repeat the Magic Leap failure by creating a fancy hardware product with lackluster software support: Instead Of Being Acquired For Billions, Magic Leap Lays Off Over 50% Of Workforce

-Adam

1 Like

Hi Adam,

Thank you for the detailed opinion on this topic and welcome to the community forum!

We’re taking all of the requests into consideration as it’s important for us to understand our customers’ needs. We have forwarded the Ubuntu support request to the dev team.

However, as has been mentioned previously, we keep supporting Ardupilot. For the time being, there are no plans for the Navio2 Ubuntu support.

Hello @polina.buriak

As a person who has made the PRs to attempt to fix the ROS issue on the navio, I hope you guys do not take these opinions too heavily. What you guys are doing is great, there is just a simple technical issue that you need to fix for the Raspbian Image to work properly. A simple but software breaking technical issue that has been known for several months with proposed fixes handed to your team, (no pity on this issue from me either).

Raspbian is first class supported OS on the raspberry pi and if users want to create a ubuntu image with the proper navio/ardupilot configuration they can do so by recreating the scripts that are on the GitHub - emlid/pi-gen-navio repo. It is open source after all. Should Emlid support every Linux distribution, no of course not.

Also pardon for interjecting my opinion here, but CTOs griping about an issue like this and not coming up with a solution, I find very disconcerting. Let’s try to keep the convo civil and productive.

Hi @acxz,

Thanks for proposing your solution to this! Our devs are looking into it.

@acxz, this thread is about Ubuntu support, not Raspberry Pi OS support so your opinion advocating Raspbian does not bring anything to this particular technical discussion.

What you and some other folks fail to realize is that Ardupilot (officially supported here) has specific licensing requirements, which can be an absolute non-starter for pro users who build actual commercial autonomous products - solutions which are magnitudes more complex than simply fixing compilation issues in existing code base.

I agree with @adzio regarding Ubuntu and Ardupilot…

However, since we are talking about very cheap Imu sensors (with horrible performances seen from Allan variance tests), surrounded by a colored led and a pwm generator, I decided to abandon completely the idea to use the Emlid solution inside any fleet of underwater drones.

I will rather invest my time to deal with more serious hardware and companies with great customer support.

Nevertheless, I believe that Emlid is doing a good job for all the Ardupilot users and probably this class of customer is their main segment (more profitable). Then I also understand the lack of support for the remaining users classes :slight_smile:

V.

@guido_sanchez @vincenzocalabro You need to decompile the overlays that are found in Emlid’s prepackaged Raspberry Pi OS image and compile them back into dtbo on Ubuntu to get SPI and related devices working.

So, grab the overlay files referenced in boot config (spi0-4cs, spi1-1cs, rcio, navio-rgb) from the Emlid prebuilt image (/overlays). Decompile them into dts files while on Raspberry Pi OS:

dtc -O dts -o raspbian-dts/spi0-4cs.dts -@ spi0-4cs.dtbo

and copy the resulting dts files out of the instance. Then switch to your target Ubuntu micro SD card, copy the dts files over and compile each of them on the Ubuntu platform, like so:

dtc -O dtb -o ~/overlays/spi0-4cs.dtbo -@ raspbian-dts/spi0-4cs.dts

The next part is trickier as you’ll need to include these extra dtbo files in a new boot image so that they get unpacked from the appropriate place in the compressed image at boot time, by doing something like this (adjust for your kernel version and directory locations):

(sudo su root)
cp /boot/initrd.img-5.4.0-1016-raspi /boot/initrd.img-5.4.0-1016-raspi.orig
unlz4 -c /boot/initrd.img-5.4.0-1016-raspi > initrd.img
mkdir temp
cd temp
cpio -id < ../initrd.img
mkdir lib/firmware/overlays
cp ~/overlays/*.dtbo lib/firmware/overlays/.
find . -print -depth | cpio -ov > ../initrd.new.img
lz4 -c initrd.new.img > /boot/initrd.img-5.4.0-1016-dtbo-raspi

Clean up. Check your config. Reboot.

Disable the navio-rgb overlay Redirecting to latest version of document (main)

After I did that I have all of the sensors, including compass, gyro and GPS plus RC working in PX4 on Ubuntu 20.

6 Likes

Hi @adzio,

Thanks for this solution.

The raspbian image provided for navio2 got really slow for me (using it with ros2 on rpi4) so I also wanted to use ubuntu server 20.04 with ros2 and it is fantastic so far.

I feel specially for robotics folk this is a good solution: so please, Emlid, change your mind and support ubuntu server for raspberry pi.

From looking at the solution it does not seem to be to much effort. Of course this is an addon to support ubuntu alongside of raspbian, but it would make your product much more applicable for roboticists needs.

Best Regards,
Johannes

You’re welcome @jsqu4re

Absolutely, it’s not much effort on the Emlid side because they already have the necessary code and configs. The above is an end-to-end proof that it’s not difficult to offer multiple distros, just a matter of whether they’re willing to do it. Hopefully this thread helps to make them see.

Hi @adzio,

Could you pm me on twitter? I seem to do something wrong regarding your instructions.

https://twitter.com/J2Pow
Thanks a lot in advance,

Johannes

Hey Johannes,

I don’t do twitter. Why don’t you post your questions here so that everyone benefits from the answers? Keep in mind the caution above that you need to adapt to your kernel version and directory structure.

Also, below are some of the online resources to help troubleshoot. Guides for other Linux flavors can be used as reference points, the commands/command options (but rarely the directory structure) are usually similar enough between distros.

http://manpages.ubuntu.com/manpages/focal/man1/dtc.1.html
https://wiki.ubuntu.com/CustomizeLiveInitrd

FYI @dmitriy.ershov @polina.buriak and Emlid leadership

From Eben Upton himself:

“From the classic Raspberry Pi board to the industrial grade Compute Module, this first step to an Ubuntu LTS on Raspberry Pi with long term support and security updates matches our commitment to widen access to the very best computing and open source capabilities.”

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.