Quickstart

Prerequisites

Before running through this guide, make sure you have these things ready:

  • A Karbon_ series computer.

  • Python 3 downloaded and installed on the system.

    • Be sure to add Python to your path if installing on Windows
  • An internet connection on the target Karbon.

Installation

Installing Pykarbon is as simple as opening up a terminal and running:

> pip install pykarbon --user

or, in Ubuntu:

$ python3 -m pip install pykarbon --user

Usage

Launch a Python REPL in your terminal with python in Windows or sudo python3 in Ubuntu. Now you’re just a few commands away from talking with your hardware:

# Import the module
import pykarbon.core as pkcore

# Open a terminal session and print out your firmware version
with pkcore.Terminal() as dev:
    dev.print_command('version')

# Open an can session and start listening for packets
with pkcore.Can() as dev:
    dev.sniff()

In the example above, we used core as a simple, and basic, interface tool. More advanced and useful features can be found by using the dedicated can and terminal modules. You can read more about them, and see some examples in the API.