Dear all,
I managed to run Navio+ into a Raspberry Pi 3B+ with Ubuntu LTS 18.04 Server Arm64.
It is quite straightforward to install ubuntu into an sd card. I recommend you to check on ubuntu website: ARM/RaspberryPi - Ubuntu Wiki
Regarding the changes with respect to the standard version, please edit /boot/firmware/config.txt
to include settings for spi and i2c as follow:
dtparam=spi=on
dtoverlay=spi0-4cs
dtoverlay=spi1-1cs,cs0_pin=16,cs0_spidev=disabled
dtparam=i2c1=on
dtparam=i2c1_baudrate=1000000
Given this setup, you can install build-essential from ubuntu:
apt install build-essential
Fetch the navio+ demo code from git: GitHub - emlid/Navio: Collection of drivers and examples for Navio shield for Raspberry Pi.
In order to detect the correct raspberry pi board, edit the file C++/Navio/gpio.cpp
go to the last function (Pin::getRaspberryPiVersion()) and replace the return value under
unknown case with 2, i.e.:
int Pin::getRaspberryPiVersion() const
{
char buffer[MAX_SIZE_LINE];
const char* hardware_description_entry = "Hardware";
const char* v1 = "BCM2708";
const char* v2 = "BCM2709";
char* flag;
FILE* fd;
fd = fopen("/proc/cpuinfo", "r");
while (fgets(buffer, MAX_SIZE_LINE, fd) != NULL) {
flag = strstr(buffer, hardware_description_entry);
if (flag != NULL) {
if (strstr(buffer, v2) != NULL) {
fclose(fd);
return 2;
} else if (strstr(buffer, v1) != NULL) {
fclose(fd);
return 1;
}
}
}
/* defaults to 1 */
fprintf(stderr, "Could not detect RPi version, defaulting to 1\n");
fclose(fd);
return 2;
}
Then you can build and run all the examples without issues.
A minor note for the Emlid guys, please consider to include ubuntu support in your roadmap, because:
- it uses arm64 architecture which guarantees higher performances for RPi3 or newer boards;
- ubuntu will support RPi4 in their development, hence a quite large audience of developers;
- it generally make life easier when ROS/ROS2 or robotics framework have to be used (without the Ardupilot)
It also will be nice to write, even as reply on this post, a guide to configure or set the kernel params even in case of the Navio2, as unfortunately Navio+ (which so far has no software issues), is out of production. For example the navio-rcio is portable? could we compile the kernel module for people like me interested in the hardware functionalities rather than the entire Ardupilot/ROS stack?
Kind regards,
Vincenzo