Skip to content

Instantly share code, notes, and snippets.

@EpicKiwi
Last active December 14, 2022 10:05
Show Gist options
  • Save EpicKiwi/9061d1a2a95654a1e0f6dabd27c02662 to your computer and use it in GitHub Desktop.
Save EpicKiwi/9061d1a2a95654a1e0f6dabd27c02662 to your computer and use it in GitHub Desktop.
µPCN Installation procedure for Linux

µPCN Installation procedure for Linux

µPCN is an implementation of the Bundle Protocol in C. This guide describes how to download, compile and install µPCN on Linux.

NOTE This guide use the folder ~ as working directory but any other location is fine. All console prompts will start by # if root access is required and $ if not.

Compile µPCN

Start by downloading the last release on https://www.upcn.eu/. (In our case it's version 0.8.0) and extract it in a directory

~$ wget "https://upcn.eu/releases/upcn-0.8.0.tar.gz"
~$ tar -xvzf "upcn-0.8.0.tar.gz"

µPCN requires gcc, make and binutils to compile (as defined in README.md). On Debian you can use the following command to install it

~# apt install gcc binutils make

µPCN requires the library Tinycbor from Intel in version v0.5.4. Code of Tinycbor must be provided in the directory external/tinycbor. Using Git, the following commands download the right version of tinycbor.

~$ cd external/tinycbor/
~/external/tinycbor$ git clone "https://github.com/intel/tinycbor.git" --depth 1 .
~/external/tinycbor$ git fetch origin tags/v0.5.4
~/external/tinycbor$ git checkout FETCH_HEAD

Get back in the main directory and execute the make posix command to build µPCN

~$ make posix

Resulting binary of µPCN is in build/posix folder.

~$ ./build/posix/upcn --help

Install pyupcn Python library

To help the creation of µPCN compatible apps, a python library is provided. Ensure you have installed Python 3 and pip. And execute the following commands to install the required dependancies and install the library globally on your system

~$ cd pyupcn
~/pyupcn# pip install -r requirements.txt
~/pyupcn# python3 install.py

Start DTN Node

Start a DTN node with an eid defined as dtn://ada.dtn with the following command.

~$ ./build/posix/upcn -e "dtn://ada.dtn"

It will start the µPCN deamon with default configuration.

Send and Receive message on a single node

While node is running, start a message listener on dtn://ada.dtn/inbox with the following commands.

~/tools/aap$ python3 aap_receive.py -a inbox

You will see this listener registration in the Node logs.

And now, in a third terminal, send a simple message using aap_send.py

~/tools/aap$ python3 aap_send.py dtn://ada.dtn/inbox "Hello world !"

Message will be sended through the Node to receiver connected. You can see the message in the receiver log and the bundle transmission in the Node log.

Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment