Python¶
The Kubos SDK Vagrant box comes with a Python interperter and all the modules needed to develop a basic hardware service. Services can be tested locally in the Vagrant box up until the point that they need hardware interaction.
Flashing¶
Note
Python is currently only supported on the BeagleboneBlack and MBM2
There are currently two ways to add Python programs to Kubos Linux:
- Fork and clone kubos-linux-build and add additional Python packages to Buildroot. You can see our current system packages and how they are structured here. See the SysAdmin section here for more information on building Kubos Linux.
- Individual Python files can be flashed to an attached hardware target. The
instructions are fairly similar to flashing a rust binary:
- Navigate to an existing example Kubos module like
kubos-linux-example
. - Run
kubos linux -a
. - Run
kubos -t [target] build
using the same target you cross-compiled with. - Run
kubos flash /absolute/path/to/python/file
. You must use the absolute path to the Python file you’d like to flash. Relative paths will not work.
- Navigate to an existing example Kubos module like
Running on Target¶
The following steps will allow you to run Python files which have been flashed to a Linux target:
- Run
minicom kubos
from inside of the Vagrant box. - Enter the username
kubos
and the passwordKubos123
. - Navigate to the folder
/home/system/usr/local/bin
. - This folder is the default destination for flashed files. Your
Python files should be here. You can now run them with
python file.py
.