What are Edge Apps?
Applies to CoCoCo platform v1.0.0-rc.31. Checked against the Edge Apps pages and the edge app runtime definition of that version.
In one sentence
Section titled “In one sentence”An Edge App is a small Lua program that you define once for your whole instance and then install on one or more Controllers, so that it runs on site, next to your machines.
Why run code on a Controller?
Section titled “Why run code on a Controller?”A Controller sits in your own network. Code that runs there can reach things the cloud cannot reach directly, for example a local MQTT broker, an OPC UA server, SNMP or Modbus devices, files on a local disk, or a command-line tool on that computer.
What an Edge App can react to
Section titled “What an Edge App can react to”In the Edge App editor you assemble an app from building blocks:
| Building block | What it does |
|---|---|
| Schedule | Run Lua on a cron schedule. |
| File tail | Run Lua per appended line of a log file. |
| File appears / File disappears | Run Lua when a file is created in or removed from a directory. |
| MQTT broker / MQTT subscription | Connect to a broker, subscribe to topics and run Lua per message. |
| OPC UA endpoint | Connect to an OPC UA server and run Lua per NodeId update. |
| SNMP device | Poll OIDs (v2c or v3) and run Lua per response. |
| Modbus port | Poll holding/input/coil registers via TCP or RTU. |
| Exec command | Declare a command-line program that Lua may call. |
| HTTP route | Serve an HTTP endpoint on the Controller. |
| RPC handler | Expose a function that can be called from the cloud. |
| Variable | Declare a setting that can differ per Controller. |
| Shared code / Library | Reusable Lua code for the app’s handlers. |
From its Lua code, an Edge App can send events and GraphQL mutations to the platform, write to its configured MQTT brokers and OPC UA endpoints, keep small values in its own storage, and write log lines.
Versions: Draft, Published, Deprecated
Section titled “Versions: Draft, Published, Deprecated”Every Edge App has a version number and a lifecycle status:
- Draft: the working copy. Only a draft can be edited and saved. A draft is not sent to any Controller.
- Published: frozen. Clicking Publish on a draft asks for confirmation, freezes that version and marks the previously published version as deprecated. The page then shows “Read-only — this version is frozen.” To change a published app, click Create new draft.
- Deprecated: an older frozen version. It is hidden from the Edge Apps list by default (use the Lifecycle filter to show it). Installations that use it keep working until they are upgraded.
Installations
Section titled “Installations”An Edge App Installation puts one published version of an Edge App onto one Controller. Each installation has its own values for the app’s variables, and it can be active or inactive. When a newer version is published, installations are not moved automatically; each one stays on its version until it is upgraded.
Where to find it
Section titled “Where to find it”Sidebar → IoT → Edge Apps. The page also offers Import and a Test Console. Installations are listed under Edge App Installations.