-
Notifications
You must be signed in to change notification settings - Fork 3
QuickStart
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
Ready to put real behaviour behind that empty setup() / loop()? Head to Writing Your First SysMod for an end-to-end walkthrough — registering a REST endpoint, reading typed values out of the JSON configuration, publishing state through StatePublisher, and wiring the SysMod into your SysType so it builds and runs on the device. From there, Architecture at a Glance and the SysMods reference fill in the bigger picture.
Getting Started
- Quick Start
- Architecture at a Glance
- Writing Your First SysMod
- Adding a Comms Channel
- Adding an I2C Device Type
- PlatformIO / Arduino
Scaffolding & Building
- Raft CLI
- SysTypes
- Top-Level SysType
- Build Process
- WebUI Build Pipeline
- File System
- Partitions & Flash
- Local Dev Libraries
- Library Developer Guide
Architecture
Built-in SysMods
- NetworkManager
- BLEManager
- WebServer
- MQTTManager
- SerialConsole
- CommandSerial
- CommandSocket
- CommandFile
- FileManager
- LogManager
- ESPOTAUpdate
- StatePublisher
- Remote Logging
- Data Source Registration
Comms & Protocols
- Stack Overview
- Comms Channels
- ProtocolExchange
- RICREST Protocol
- Real-Time Streams
- Adding REST Endpoints
- Built-in REST Endpoints
- File Download (OKTO)
- OTA Update Flow
Devices & Buses
- DeviceManager
- Device Manager REST API
- Device Factory & Classes
- Device Type Records
- Adding an I2C Device Type
- Device Data Publishing
- Data Logger
- I2C Bus
- I2C Device Scanning
- I2C ID & Polling
- MotorControl Overview
- MotorControl Config
- MotorControl Commands
Helpers
Reference