FlyghtEdge · Flyght Cloud
Documentation
From installing the library to a device you watch and control from anywhere, step by step.
Board pages · 01
Pages of the board
Every FlyghtEdge board serves its own dashboard: what each page shows and where it is explained.
There is nothing to install: open the board’s address in a browser (http://<name>.local, or its IP) and its dashboard is there. It is the same on a phone and a laptop, in a light or dark theme, in English or Bahasa Indonesia. Every page below is part of the library; a page shows up in the menu only when the sketch creates the module behind it.
The menu
| Group | Page | What it is for | Comes from | Guide |
|---|---|---|---|---|
| Rooms | Control, Monitor, and any page you name | The cards of your sketch: switches, sliders, buttons, readings, charts | dev.page("Control") | Control and Monitor |
| Devices | Motion | Orientation: horizon, compass, 3D box | Bno055 | Devices → IMU |
| Devices | LCD | The real character screen, typed from the phone | LcdI2c | Devices → LCD |
| Devices | Files | Folders and files of the SD card | SdCard | Devices → SD card |
| Devices | Screen | The TFT screen, mirrored, with drawing tools | Tft | Devices → TFT screen |
| Devices | Map | Position, track and satellites | Gps | Devices → GPS |
| Devices | Serial | A console to another microcontroller | McuLink | Devices → External microcontroller |
| Devices | Lights | Colour, brightness and effects of LEDs | Led, RgbLed | Lights and Flows |
| Devices | Flows | Automations from blocks (Pro) | the feature “Visual flows” | Lights and Flows |
| Device | Wi-Fi | The router, saved networks, the board’s own access point, its name | Wifi, Ap, Mdns | Wi-Fi |
| Device | Connect | MQTT and Home Assistant, the HTTP API with tokens, the webhook | Mqtt, Webhook | Connect |
| Device | Settings | The device, module health, Flyght Cloud, access, plan and features, users, logs | System, Cloud, Auth | Settings and System; Sign-in, guests and users |
| Before you sign in | Setup wizard, Sign in | The first start, and the login | Ap, Captive, Auth | First start; Sign-in, guests and users |
There is one menu on every screen size. On a phone it is a drawer that you open with the menu button, and it holds the rooms, the device pages, Wi-Fi, Connect and Settings (there is no bottom bar and no row of page tabs any more).
Who may do what
| Role | Can | Gets it by |
|---|---|---|
| viewer | Look at every page and every value | Guest access, or an account with this role |
| operator | Also change widgets, lights, the LCD, the screen, send to the serial link | A user or an API token with this role |
| admin | Also change settings: Wi-Fi, Connect, layout, pins, files, cloud, users | The owner (the password of the setup wizard) is always admin |
Board pages · 02
First start: the setup wizard
A new board opens its own Wi-Fi and a four-step wizard: password, Wi-Fi, key, done.
How to get there
- Power the board. It starts its own Wi-Fi, named like
smart-lamp-C2D3(the sketch name and four characters of the MAC), open by default. - Join that Wi-Fi with your phone. The wizard opens by itself (the captive portal). If it does not, open
http://192.168.4.1. - Go through the four steps below. Your session is saved, so you do not log in again.
The steps
| Step | What you do | Good to know |
|---|---|---|
| Start | Choose I have a key (paste a license key, then connect to Wi-Fi) or Set up online (connect to Wi-Fi first, then create a key on the Flyght website). | I have a key goes password, key, Wi-Fi; Set up online goes password, Wi-Fi, key. You can skip the key and add it later in Settings. |
| 1. Password | Choose a password and repeat it. Decide whether Allow guest access is on: others may then open the dashboard without a password. | At least 6 characters. Only the owner can change settings. |
| 2. Wi-Fi | Pick a nearby network from the scan (or type its name), enter its password and press Connect. It is optional. | Your phone may drop the board’s Wi-Fi for a moment: rejoin it. The network is saved with priority and the board reconnects by itself. |
| 3. Key | Open the Claim this device link on a device with internet, sign in to Flyght, create a key for this board, and paste it into License key (it starts with fnk_live_). Leave Connect to Flyght Cloud on to link it at once. | Your phone is still on the board’s Wi-Fi and has no internet: switch to your usual Wi-Fi to open the link, then come back. |
| 4. Done | Save the three addresses, then Open dashboard. | Via the device Wi-Fi http://192.168.4.1; on the same network http://<name>.local and the IP. |
Skip the wizard from code
fn::Device dev("smart-lamp");
void setup() {
dev.auth().defaultPassword("rahasia123"); // no password step
dev.auth().allowAnonymous(true, fn::Role::Viewer); // guests may look
dev.wifi().add("Home", "home-password", 50); // up to 8 networks, higher priority first
dev.ap().ssid("{name}-{mac4}").mode(fn::ApMode::Fallback); // the setup Wi-Fi only while the router is down
dev.license(FN_LICENSE_KEY); // the key of step 3
dev.begin();
}| Field | What it does | Default / range |
|---|---|---|
auth().defaultPassword(pw) | Skips the password step (first boot only). | none: the wizard asks |
auth().allowAnonymous(on, role) | Guest access on, with a role. | off |
wifi().add(ssid, pass, priority) | A saved network without the wizard. | priority 50; 8 networks at most |
ap().ssid(tpl), .password(p), .mode(m) | Name, password and mode of the setup access point. A password of 8 characters or more, else it stays open. | {name}-{mac4}, open, Always |
license(key) | The license key (it is also the claim key for the cloud). | none: evaluation mode |
Board pages · 03
Control and Monitor
The cards of your sketch, live, and how to rearrange them.
These are the pages you declare in the sketch with dev.page("Name", "icon"), the first two in the screenshots being “Control” and “Monitor”. Each widget is a card. The greeting says how many switches are on, the green Live dot says the page is connected to the board, and the pills under the greeting jump to every other page.
| Card | How you use it | Code |
|---|---|---|
| Toggle | Tap the card or the switch. “On / Tap to turn off”. | toggle(id, label, cb(bool)) |
| Slider | Drag, or use the − and + buttons for one step. | slider(id, label, min, max, step = 1, cb(float)) |
| Button | Press: runs the callback once. | button(id, label, cb()) |
| Select | Pick one option (Auto, Manual, Away). | select(id, label, options, cb) |
| Text | Type and send with the arrow. | text(id, label, cb) |
| Gauge, value, chart | Read only: pushed from loop() with dev.ui().set(id, value). | gauge, value, chart |
Edit layout
- Press Edit layout (an administrator can). A bar says “Drag cards to reorder. Resize or hide them.”
- Drag a card by its handle (the six dots) to move it. Use the arrows to make it wider or narrower (1 to 3 columns), and the eye to hide it.
- Save keeps it on the board, for everyone. Cancel drops the changes. Reset puts the order of the sketch back.
| Route | Role | Meaning |
|---|---|---|
GET /ui | viewer | The pages and every widget with its type, label, unit and layout. |
GET /state, POST /state | viewer; the widget’s own role | Every value; set several at once with {"id": value}. |
PUT /ui/layout, DELETE /ui/layout | admin | Save or reset the layout of a page. |
All routes are under /fn/api/v1 (see Local API). Theme and language are chosen with the moon and the globe in the top bar and are remembered by the browser.
Board pages · 04
Wi-Fi
The router the board joins, the networks it remembers, its own access point and its name.
| Card | What it shows and does |
|---|---|
| Wi-Fi status | Status, SSID, IP, signal in dBm and gateway of the connection. Reconnect tries again now. |
| Saved networks | Up to 8 (home, office, a hotspot). The board tries them from the top; if one fails it uses the next. Drag to change the order, the key icon changes its password (empty means an open network), the bin removes it. Add network asks for the name, the password and Connect now. |
| Access point | The board’s own Wi-Fi for setup and direct access: its name (SSID), IP, who is connected and the security. Change the SSID and the password, and the Mode: Always, Fallback (only while the home Wi-Fi is down) or Off; and the Channel. Saving disconnects phones that use this access point. |
| Device name & mDNS | The name for http://<name>.local, up to 63 characters. |
- The board connects directly with no background scanning, and waits longer between failed tries (15 seconds growing to 15 minutes), so it stays quiet when the router is gone and comes back by itself.
- While a phone is on the board’s own Wi-Fi, automatic tries wait (joining a router can move the radio channel and drop the phone). Pressing Connect starts a 90 second window.
- An access point password needs 8 characters or more, otherwise the access point stays open.
dev.wifi().add("Home", "home-password", 90) // tried first
.add("Office", "office-password", 50)
.backoff(15, 900); // wait 15 s after a failure, growing to 15 min
dev.ap().mode(fn::ApMode::Fallback).channel(6);
dev.mdns().service("_modbus", "_tcp", 502); // an extra service on the network| Route | Role | Meaning |
|---|---|---|
GET /wifi | viewer | Status, and the saved networks without their passwords. |
PUT /wifi/networks | admin | Replace the saved list (up to 8, priority 0 to 100). |
POST /wifi/connect, POST /wifi/scan | admin | Join a network now; scan. |
GET /ap, PUT /ap | viewer, admin | {ssid, password, mode, channel}. |
GET /mdns, PUT /mdns, POST /mdns/restart | viewer, admin | {"hostname": "x"}, 63 characters at most. |
Board pages · 05
Connect: MQTT, HTTP API and webhook
Three ways to link the board to Home Assistant, Node-RED, n8n or your own backend.
MQTT and Home Assistant
The board is an MQTT client (there is no broker inside it). Every widget is published and can be commanded without any code. With Home Assistant discovery on, every widget also shows up in Home Assistant as an entity.
| Field | What it does | Default / range |
|---|---|---|
| Enabled | Connects to the broker. | off until a broker is set |
| Broker URI | mqtt://host:1883, or mqtts:// for TLS. The page also shows a WebSocket form, ws://host:8083/mqtt. | empty |
| Username, Password | Credentials of the broker, if it asks. | empty |
| Base topic | The start of every topic. {id} is the 12 digit device id, {name} the name, {mac4} four characters of the MAC. | flyght/{id} |
| Retain state | Values are published retained, so a new subscriber gets the last one. | on |
| Home Assistant discovery | Publishes a discovery message for every widget. | off (homeAssistant(true) turns it on) |
dev.mqtt().broker("mqtt://192.168.1.10:1883") // sets the broker and turns MQTT on
.credentials("flyght", "secret")
.baseTopic("home/{name}")
.homeAssistant(true);
// Your own topics, next to the widgets:
dev.mqtt().publish("home/garage/door", "open", /*retain*/ true, /*qos*/ 1);
dev.mqtt().subscribe("home/garage/cmd", [](const String& topic, const String& payload) {
Serial.println(payload);
});| Topic | Direction | Payload |
|---|---|---|
<base>/status | board → | online or offline (retained, last will) |
<base>/info | board → | Device JSON (retained) |
<base>/state/<widget> | board → | ON/OFF, a number or text |
<base>/set/<widget> | → board | The same formats; toggle and PRESS too |
HTTP API and tokens
- The page shows the base address,
http://<ip>/fn/api/v1, with a copy button, and the main routes with their roles. - Press New token, give it a name and a role (viewer, operator or admin). The token, which starts with
fn_, is shown once: copy it now. - Send it as
Authorization: Bearer <token>. The list keeps the name, the start of the token, the role and the date; the bin deletes it. - The Examples tabs show the same call in cURL, JavaScript and Python.
curl -H "Authorization: Bearer $TOKEN" http://192.168.4.1/fn/api/v1/state
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"value": true}' http://192.168.4.1/fn/api/v1/ui/w/lightTokens are a feature of every edition (“API tokens”, on by default) and there are at most 8. The full list of routes is in Local API.
Webhook
The board POSTs JSON to your URL when widget values change (debounced) and/or on a timer. The request runs on its own task, so a slow server never blocks the board.
| Field | What it does | Default / range |
|---|---|---|
| Enabled | Sends the webhook. | off until a URL is set |
| Target URL | Where it POSTs. For https:// give the root certificate with caCert(pem); without it the traffic is encrypted but the server is not verified (the page warns). | empty |
| Secret (optional) | Signs every request in the header X-Flyght-Signature: sha256=<hex>, an HMAC-SHA256 of the body. | empty: not signed |
| Send when values change | Sends the changed values. | on |
| Interval (seconds, 0 = off) | Also sends every value on this timer. | 0 |
dev.webhook().url("https://hooks.example.com/flyght")
.secret("a-long-random-secret")
.interval(60) // plus a full report every minute
.caCert(ROOT_CA_PEM); // verify the server{"event":"change","device":"A4CF12B1C2D3","name":"Smart Lamp","ts":1791747120,"uptime":1234,
"values":{"light":true,"brightness":35,"temp":28.4},"changed":["light"]}| Route | Role | Meaning |
|---|---|---|
GET /mqtt, PUT /mqtt, POST /mqtt/test | admin | {enabled, uri, user, password, baseTemplate, retain, ha}; test connects once. |
GET /webhook, PUT /webhook, POST /webhook/test | admin | {url, enabled, onChange, interval, secret}; test sends a test event. |
GET /auth/tokens, POST /auth/tokens, DELETE /auth/tokens/<id> | admin | List, create (name and role) and delete tokens. |
Board pages · 06
Settings and System
The device, the health of every module, Flyght Cloud, access, plan and features, and the logs.
New in 2.2.0. Settings is in groups: Device & health, Cloud & license, Accounts & security and Maintenance & factory reset. A row at the top jumps to a group, and the groups fold. Users & roles is always there for the admin, with a switch to turn it on (or a note when the edition does not include it).
| Card | What it shows and does |
|---|---|
| Device | Display name, model, firmware (your version and the FlyghtEdge version), chip, the 12 character id, hostname, uptime, why it last restarted, and bars for free memory and flash in use. |
| Module health | Every module reports its own status with one line: web server, authentication, system, access point, captive portal, Wi-Fi, mDNS, dashboard, MQTT, webhook and every device module you created (IMU, LCD, SD, TFT, GPS, MCU link, lights). ok is green; a problem says why. |
| Flyght Cloud | See below. |
| Appearance | Theme (Light, Dark, System) and language (Bahasa Indonesia, English), remembered by the browser. |
| Access | Guest access (view only or can control), the session length in days, change password, sign out everywhere. See Sign-in, guests and users. |
| Plan & features | The edition and a switch for every feature. See below. |
| Logs | The latest log lines of the board, live, with Pause. |
Flyght Cloud
| Field | What it does | Default / range |
|---|---|---|
| Connect to Flyght Cloud | Off by default: the device works the same without the cloud. On, it claims itself with the license key and mirrors the dashboard over MQTT. | off |
| Status | Off, No network, Needs a license key, Claiming, Fetching, Connecting, Online, Retry, Stopped. | read only |
| Server, Registered | The site in use and whether this board is claimed. | the address in the firmware |
| License key | Type a key to replace it; it is never shown again. Remove the saved key deletes it (you type the device name to confirm); the board then uses the key of the sketch, if there is one. | the key of license() |
| Server | Shown, but not a setting: the server names the address in its claim and config answers, and the board follows it. It goes back to the address built into the firmware when that one stops answering. A build of your own points elsewhere with dev.cloud().site(...) or -DFN_CLOUD_SITE=.... | named by the server |
dev.license(FN_LICENSE_KEY); // the key is also the claim key
dev.cloud().enable(); // on at the first start; the switch can change it later
// .site("https://flyght.example") to point to another serverThe evaluation banner
In evaluation mode the banner has Enter license key, and a board whose evaluation ran out shows the same button, so the key no longer needs dev.license() and an upload. The board checks the key, saves it and applies it after a restart (PUT /license, admin); a key set in the sketch with dev.license() takes precedence. Next to it, Setup erases the settings after you type RESET and starts the setup wizard again. While the evaluation is over, sign-in and the key route still answer; every other route answers 402.
Plan & features
| Feature | From edition | What it does | On at first start |
|---|---|---|---|
Guest access (guest) | Free | People can open the dashboard without a password. | off |
API tokens (apiTokens) | Free | Other systems use the HTTP API with a token. | on |
Visual flows (flows) | Pro | Automations from blocks. | off |
Users & roles (rbac) | Pro | Separate accounts with viewer, operator or admin rights. | off |
White label (whitelabel) | Pro | Hides the FlyghtEdge branding. | off |
Flows on RTOS threads (flowsRtos) | Enterprise | A flow on its own FreeRTOS task. | off |
A feature is on only when the edition allows it and it is switched on. The edition comes from the license key only; in evaluation mode (no key) every edition is allowed for 30 minutes after each start. Put a default in the sketch with dev.features().defaultOn("flows").
System calls
dev.system().ntp("pool.ntp.org", "time.google.com") // the clock
.timezone("WIB-7"); // a POSIX time zone, default UTC0| Route | Role | Meaning |
|---|---|---|
GET /sys, GET /sys/health | viewer | Name, model, versions, chip, memory, uptime, IP, MAC; the health of every module. |
GET /sys/logs?since=<seq> | admin | The log lines after a sequence number. |
POST /sys/restart | admin | Restarts the board. |
POST /sys/ota | admin | A .bin as the body (1024 bytes or more): updates the firmware over the air, then restarts. |
POST /sys/factory-reset | admin | Body {"confirm": "RESET"}: forgets every setting. |
GET /features, PUT /features | viewer, admin | The features of the editions and whether each is on. |
GET /cloud, PUT /cloud | admin | {enabled, site, apiKey, confirm}; the answer never holds the key. |
Board pages · 07
Sign-in, guests and users
The login page, guest access, sessions, and separate accounts with roles.
- Owner: the password made in the setup wizard. The owner is always admin. On the sign-in page leave the username empty.
- Keep me signed in keeps the session: it stays valid for the number of days in Settings (30 by default), even if the Wi-Fi drops or the board restarts.
- Continue as guest appears when guest access is on. A guest can look at everything allowed by the role you chose (view only, or can control).
- A wrong password is answered with a friendly message, and repeated failures are slowed down by a rate limiter.
Access in Settings
| Field | What it does | Default / range |
|---|---|---|
| Allow guest access | Anyone on the network may open the dashboard without a password. Choose View only or Can control. | off |
| Session length (days) | How long a signed-in session stays valid. | 30 |
| Change password | The current password and a new one (at least 6 characters). | — |
| Sign out everywhere | Ends every session at once, on every device. | — |
Users and roles (Pro)
- Switch Users & roles on in Plan & features (it needs a Pro license key).
- In Users & roles type a Username and a Password (at least 6 characters), choose the Role (Viewer, Operator or Admin) and save.
- Change a role with the drop-down on the user, the key icon sets a new password, the bin deletes the account. Changes apply at once.
dev.auth().defaultPassword("rahasia123"); // the owner, without the wizard
dev.auth().allowAnonymous(true, fn::Role::Viewer); // guests may look
dev.auth().sessionDays(30); // how long a session lasts| Route | Role | Meaning |
|---|---|---|
GET /auth/state | anyone | Who you are, whether setup is needed, whether guests are allowed. Works even in evaluation timeout. |
POST /auth/login, POST /auth/anonymous, POST /auth/logout | anyone | Sign in ({password, username?, remember?}), continue as guest, sign out. |
POST /auth/logout-all, PUT /auth/password | admin | Sign out everywhere; change the owner’s password. |
GET /auth/config, PUT /auth/config | admin | Guest access and its role, the session length. |
GET /auth/users, POST /auth/users, PUT /auth/users/<id>, DELETE /auth/users/<id> | admin | The accounts of Users & roles. |
Board pages · 08
Lights and Flows
Colour and effects for LEDs, and automations built from blocks.
Lights
Every light you create gets a card: an on switch, brightness, a colour picker with a hex box, the colour order of an addressable LED (a WS2812 is GRB; pick RGB if red and green look swapped), and the effects. The effect runs in the background and does not block loop().
fn::Led status(2); // a plain LED on GPIO 2 (PWM dimming)
fn::RgbLed pixel(RGB_BUILTIN); // the onboard addressable LED
fn::RgbLed strip(5, 6, 7, "desk"); // three PWM pins: R, G, B (common cathode)
void setup() {
dev.use(status).use(pixel);
pixel.color(0x2563eb); // from code, any time
pixel.effect(fn::Fx::Breathe, 3000); // runs in the background, 3 s per breath
dev.begin();
}| Constructor | Meaning |
|---|---|
Led(int pin, const char* id = "led", bool activeHigh = true, bool pwm = true) | A plain LED: digital, or PWM brightness when pwm is true. |
RgbLed(int dataPin, const char* id = "rgb") | One addressable LED (WS2812), also the onboard one. |
RgbLed(int r, int g, int b, const char* id = "rgb", bool commonAnode = false) | Three PWM pins. |
The effects are Solid, Blink, Breathe, Heartbeat, Strobe, Rainbow, Cycle (two colours), Candle, Police, SOS, Sunrise and Alarm; the speed slider sets the period in milliseconds. A light is also on the HTTP API (GET /lights, POST /lights/<id> with {"on", "color", "color2", "brightness", "effect", "period"}), on MQTT (<base>/light/<id>/state and /set) and a block in Flows.
Calibrate colours (2.2.0). If the colours of an addressable LED look wrong, Calibrate colours on its card shows the LED’s colours one at a time. You pick the one you see, and after a last “is this red?” check the colour order is saved.
Flows (Pro)
- Switch Visual flows on in Settings → Plan & features (a Pro key). The Flows page appears.
- Press New flow, or start from an example: Blink every second, Button plays an effect, Traffic light (serial), Webhook alert, Blink a GPIO pin.
- Add blocks from the palette: Triggers (a Run button, on startup, every N seconds, a widget changes, an MQTT message, an HTTP hook, the board’s button), Logic (wait, if, repeat, split, set a value) and Actions (log, a light, a GPIO pin, and the blocks that modules add). Connect them by dragging from one block to the next.
- Select a block to set it in the inspector. Switch Active on, press Run to try it, and Save.








































