Skip to content

QuickStart

Rob Dobson edited this page Mar 15, 2024 · 1 revision

Raft Quick Start

Install RaftCLI

To get started quickly you will need to first install the Raft command-line-interface. To do this follow the steps described at https://github.com/robdobsn/RaftCLI

The executable program is called raft

$> raft new {ProjectFolder}

This creates a new raft app in the folder {ProjectFolder} - change {ProjectFolder} to your choice of folder for the new project. You will be asked a series of questions including the name of your app, target chip, etc. See the documentation for RaftCLI for further details

A folder structure like this:

├───components
│   └───MySysMod
├───main
└───systypes
    ├───Common
    │   ├───FSImage
    │   └───WebUI
    └───SysTypeMain

In a raft application the main app funcitonality is built in the components folder. In this example, the MySysMod folder contains file MySysMod.cpp:

void MySysMod::setup()
{
    // Code to setup your app - like Arduino setup()
}

void MySysMod::loop()
{
    // Called frequently - like Arduino loop()
}

This should be reasonably familiar to anyone who has programmed an Arduino. However this is no ordinary Arduino program:

  • app initialisation including WiFi and Bluetooth Low-Energy connectivity, WebServer, etc are all taken care of and configured using the JSON document defined by the SysType which can be found in the systypes/SysTypeMain folder in this example
  • the setup function has access to a powerful JSON-based configuration system
  • multiple SysMods can be added to split-up application functionality and inter-SysMod communication is also available
  • REST API endpoints can be registered by any SysMod and these enable sophisticated communications functionlity over WiFi, BLE, ethernet and serial connections

Clone this wiki locally