Getting Started with KubOS and the Kubos SDK¶
This tutorial guides the user through the process of creating a new Kubos project using Python3.5 and installing and running it on a target OBC.
Note
The iOBC does not support Python. If this is the board which you are using, please refer to the Using Rust with the Kubos SDK doc to get your first project built and running on the OBC.
After going through that document, please refer to the mission application tutorial for information about creating your first mission application.
Prerequisites¶
Have an OBC available with both Python and SSH capabilities (preferably with an installation of Kubos Linux)
Creating your Project¶
Like all good programming tutorials, we’ll start with a basic “Hello, World” program.
Log into your SDK VM and then create a new folder for your project.
Within that folder, create a new file, hello_world.py
, which will print “Hello, World!”
and then exit.
print("Hello, World!")
Running the Project Locally¶
The Kubos SDK should have all resources required to run the project locally.
Our example project can be run like so:
$ python hello_world.py
Hello, World!
Logging in to KubOS¶
By default, KubOS comes with a user account, kubos
, with the default password Kubos123
.
Log into your OBC using SSH and its configured IP address. Enter the password when prompted.
For example:
$ ssh [email protected]
[email protected]'s password: ********
If this is your first time connecting to the board via SSH, you may be prompted to confirm the target IP’s authenticity. Enter “yes” if this occurs:
$ ssh [email protected]
The authenticity of host '10.0.2.20 (10.0.2.20)' can't be established.
ECDSA key fingerprint is SHA256:ir2TC+iML+MJ5Cb3cxTReWI69aX6EtPysFQzWleKc+8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.2.20' (ECDSA) to the list of known hosts.
[email protected]'s password: ********
Please confirm that you are able to connect to the board via SSH from the SDK before proceeding with the next step. If you are unable to do so, please verify that your OBC’s network connection has been successfully configured and activated.
Once you are logged in to the OBC, you can use the exit
command to end the SSH connection and
return to the SDK.
Transferring the Project to a Target OBC¶
We can now transfer the project to the kubos
user home directory on the target OBC using SCP.
From the SDK’s command line, run the following (be sure to replace 10.0.2.20
with your OBC’s
IP address):
$ scp hello_world.py [email protected]:/home/kubos
[email protected]'s password: ********
hello_world.py 100% 21 0.0KB/s 00:00
Running the Project on the Target OBC¶
Once the project has been transferred, we can log in to the OBC and run it:
$ ssh [email protected]
[email protected]'s password: ********
/home/kubos # python hello_world.py
Hello, World!
Next Steps¶
In the next tutorial, we’ll create and run our first mission application.