PilotPi with Ubuntu Server
Last updated
Last updated
:::warning Ubuntu Server on RPi 4B consumes a lot of current and generates a lot of heat. Design for better heat dissipation and high power consumption when using this hardware. :::
Both armhf and arm64 arch are supported.
Please refer to official page for any new updates.
When setting up RaPi's WiFi for the first time we recommended using a wired Ethernet connection between your home router and RPi, and a monitor and keyboard.
Now plug the SD card onto your Pi and boot for the first time. Make sure you have shell access to the RPi - either SSH connection over wired Ethernet, or direct accessing with keyboard and monitor.
First install required package:
Then your Pi will able to join your WiFi network after reboot.
Let's set up hostname at first.
Change the hostname to whatever you like. Then install the package required by mDNS:
Perform a reboot.
Regain the accessibility through WiFi connection after the above operation.
The corresponding file in Ubuntu is /boot/firmware/usercfg.txt
.
Replace the file with:
On Ubuntu Server 20.04:
On Ubuntu Server 18.04 or earlier, nobtcmd.txt
and btcmd.txt
should both be modified.
Find console=/dev/ttyAMA0,115200
and remove that part to disable the login shell on serial interface.
Append isolcpus=2
after the last word. The whole file will then look like:
The above line tells the Linux kernel do not schedule any process on CPU core 2. We will manually run PX4 onto that core later.
Reboot and SSH onto your Pi.
Check UART interface:
There should be /dev/ttyAMA0
, /dev/ttySC0
and /dev/ttySC1
.
Check I2C interface:
There should be /dev/i2c-0
and /dev/i2c-1
Check SPI interface:
There should be /dev/spidev0.0
.
In this section we will configure the auto-start script in rc.local. Note that we need to create this file, as it is not present on a fresh Ubuntu OS.
Append the content below to the file:
Save and exit. Then set the correct permissions:
:::note Don't forget to turn off the switch when it is not needed! :::
:::warning Enable CSI camera will stop anything works on I2C-0. :::
Append the following line at the end of file:
To get the very latest version onto your computer, enter the following command into a terminal:
:::note This is all you need to do just to build the latest code. :::
Set the IP (or hostname) of your RPi using:
or
Additionally, we need to set the username:
Build the executable file:
Then upload it with:
Execute the command in firmware folder:
:::note mDNS is not supported within docker. You must specify the correct IP address every time when uploading. :::
:::note If your IDE doesn't support ninja build, NO_NINJA_BUILD=1
option will help. You can compile without uploading too. Just remove upload
target. :::
It is also possible to just compile the code with command:
:::note This step requires aarch64-linux-gnu
tool-chain to be installed. :::
Build the executable file:
Then upload it with:
Execute the command in PX4-Autopilot
folder:
:::note mDNS is not supported within docker. You must specify the correct IP address every time when uploading. :::
:::note If your IDE doesn't support ninja build, NO_NINJA_BUILD=1
option will help. You can compile without uploading too - just remove the upload
target. :::
It is also possible to just compile the code with command:
Connect over SSH and run it with:
Now PX4 is started with multi-rotor configuration.
If you encountered the similar problem executing bin/px4
on your Pi as following:
Then you should compile with docker instead.
Before proceeding to next step, clear the existing building at first:
Then go back to the corresponding chapter above.
Mount the SD card onto your computer and modify the network settings. Please follow the official instruction .
Edit the file /etc/default/crda
to change the correct WiFi region.
You may want to setup as well.
If you are compiling for the first time with docker, please refer to the .
If you are compiling for the first time with docker, please refer to the .
Please refer to the instructions