Package
Boards and components are npm packages, each described by its manifest.
Everything a workflow runs comes from a package: a plain npm package with a manifest.yaml
that says what it is. There are two kinds.
| Kind | Describes | Has code? |
|---|---|---|
| Board | A target: its pins and what each supports (digital in/out, PWM, ADC…), its serial connection, the MicroPython firmware it runs, and what it offers besides its pins — its capabilities. | No — the runtime is the platform's. |
| Component | A set of actions and triggers about one thing: a sensor, a display, a protocol. | Yes — one MicroPython script per node. |
A workflow has exactly one board and as many components as it needs.
The manifest
The manifest is all the studio reads to know a package: its nodes, their settings and outputs, what it needs and what it offers. The studio draws the nodes and their forms from it; the board runs the scripts it points at.
kind: component
name: DHT
schemaVersion: 1
dependences:
platform: ^1.0.0 # the platform versions it works with
schema:
displayName: DHT
description: A DHT11 or DHT22 temperature and humidity sensor.
actions: [...]
triggers: [...]Every field is in The manifest.
Your library
Packages are installed per account, from the public npm registry or any npm-compatible one (a private Verdaccio, for example). The studio's component store lists the ones in your library and installs new ones by name.
A workflow records the exact version of every package it uses, so it builds the same way until you change it. Nothing is flashed when you add a component: the next time the workflow runs, the driver compiles what it uses and puts it on the board.
Versions and the platform
The platform is the runtime on the board. A package says which platform versions it works with
(dependences.platform, a semver range): the studio only offers the versions of a package that
match the workflow's platform, and checks all of them when you change the platform.
Capabilities — many boards
Henglos IO isn't tied to one board: a board is a package like any other, so any MicroPython board is one manifest away. The ESP32 comes ready.
A board lists what it offers besides its pins — wifi, bluetooth, ethernet, can,
usb-host — and a component lists what it needs (HTTP and WiFi need wifi). A workflow only runs
where both match: on a board without it, the component store won't add the component, its nodes are
marked ⊘, and the hosting refuses to start the workflow.
To move a workflow to another board, pick it in the workflow's Settings in the studio: its components and actions stay, and the pins you picked are checked against the new board.
Where to go next
- The packages Henglos IO ships: Built-in packages.
- Making your own: Creating packages.