Repository navigation
v0.22.0
Controllers that answer only who they should, real-time safety, and deploying from naut
Highlights:
- A nautilus controller now answers a request only when it is addressed to
localhost, an IP address or a name you allow, or when the request carries its token. This closes DNS rebinding and cross-site reading and writing. Read Upgrading below before you update a controller you reach by name. - A real-time task can no longer take a box down.
- Retained values survive a power cut.
naut deployinstalls, updates and rolls back a controller over SSH.- nautilus can be a PROFINET IO device. Not yet proven on hardware: tested on simulated segments only.
naut siemens serveputs a running S7-1500 on the nautilus API. Not yet proven on hardware: tested against a fake CPU only.naut runbuilds and serves your operator screens itself.
Upgrading from 0.21
- Upgrade: before 0.22.0, any web page open in a browser that can reach a controller could read its tags, alarms, history and program source (wildcard CORS, with or without a token). On a token-less controller it could also write, force and push programs, through DNS rebinding. There is no configuration-only fix for the reads.
- Anything that reaches a controller by a DNS name must have that name in
NAUTILUS_ALLOWED_HOSTS, or send the token. (#812, #818, #826, #846, #849)- The rule. A controller now answers a request only when its Host is
localhost, an IP address or a name inNAUTILUS_ALLOWED_HOSTS, or when the request carries the controller's token (NAUTILUS_TOKEN, sent asAuthorization: BearerorX-Nautilus-Token). This covers reads, the live stream, the dashboard and the HMI screens, as well as writes. A request by any other name gets 403. - What it affects. Kubernetes Services, historians, dashboards, mDNS names (
epic1.local), and reverse proxies that keep the browser's Host (tailscale serve, nginxHost $host). - Browser pages. A dashboard or HMI screen opened in a browser can't send the token, so its name must be listed even on a controller with a token.
- Deployments from
naut new --deploylist their Service names automatically. - The historian.
naut historian,naut pull --host,naut snmp serve --fromandnaut redfish serve --fromsendNAUTILUS_TOKENfrom their environment.naut historian's own API follows the same rule: withserver.historian: http://historian:9100, setNAUTILUS_ALLOWED_HOSTS=historianon the historian. The controller's/api/historyproxy no longer forwards the token to the historian. - Cross-origin access. The tag API no longer sends
Access-Control-Allow-Origin: *. A page on another host gets CORS only if its name is allowed or it sends the token. - Logix facade.
naut logix serve --listendefaults tolocalhost:8080, and refuses a non-loopback address withoutNAUTILUS_TOKEN. - The VS Code extension sends
nautilus.tokenon every request from 0.21.2 (below), and only tonautilus.runtimeUrl. A token from your user settings goes to aruntimeUrlthat a workspace chose only after you answer Send it to … once for that address. In a remote window (dev container, SSH, WSL), anyruntimeUrlbut the default needs that approval. In an untrusted workspace, its ownruntimeUrlandtokenare ignored. - Unchanged: reaching a controller by IP address or on localhost works as before.
- The rule. A controller now answers a request only when its Host is
- An implicit narrowing conversion is refused, and integer stores wrap at the declared width. (#800)
- A program that narrows a value without saying so no longer compiles. That covers wider integers into narrower ones (
DINTintoINT, a computedd + 1into anINT, a literal the type can't hold), and bit strings. It also coversLREALintoREALandDINTintoREAL. - The refusal applies at every store: assignments, function block inputs,
=>output bindings,FORbounds and initial values. - The error names the conversion to write, for example
cannot assign DINT to INT implicitly; write DINT_TO_INT(…). - Integer arithmetic now stores what a PLC stores:
INT + INT = 60000stores-5536, and shifts and rotates act on the operand's declared width.
- A program that narrows a value without saying so no longer compiles. That covers wider integers into narrower ones (
- Ladder rungs run top to bottom, each its own network. (#784) A rung above the rung that calls a block now reads that block's output from the last scan, as on a PLC and as the same program does in ST. Before, it read the value from later in the same scan.
- A typed
role: outputtag with noinit:starts at its type's zero, as setpoint and state tags already did. It's held from the driver until its first write. (#698) naut checkfails on screen errors. It now checks every screen, including pipe ends, equipment ids, tags, and components that won't compile or would throw on mount. A project that passednaut checkon 0.21 can fail it, and so fail CI. (#671, #675)- naut builds a missing HMI app itself. When
server.hminames a build output that isn't there, naut now builds the app from its closed package set: Svelte, the HMI kit, the 3D kit, three and Threlte. An import from outside that set failsnaut build, where 0.21 warned and fell back. (#668) - The dashboard moves to
/_nautilus/when the project has screens. With*.mimic.jsonfiles and noserver.hmi,naut runnow serves the operator screens at/. (#668) - The naut binary grows from about 41 MB to 61 MB, because it now carries the packages it builds screens with. So does every controller
naut buildmakes. Building from source needs Go 1.25. (#668) - Real time: a task with
priority:now runs under anRLIMIT_RTTIMEbound, and naut refuses some unsafe pinnings at start. See Real-time safety below. If a task now starts at normal priority, check itsscan.schedand naut's banner for the reason. (#839, #847, #851) - A PLCnext project with a
redundancy:section is refused at load and bynaut check, until redundancy is designed for PLCnext: a standby would drive the outputs. (#832) - Under
redundancy:, a standby's scan-fed tags now read Stale, not Good. A standby doesn't scan, but its frozen values showed Good in/api, the live stream, OPC UA and screens. Now driver-bound inputs, every global a program writes, and the measured-dt tags read Stale on a standby, and on a new leader until its first input read is back. A driver's own non-Good verdict still stands. A setpoint the logic only reads keeps the operator's value and quality. A screen shows the quality badge on a driverless standby too. (#925, #924) - groov EPIC / OptoMMP: without
redundancy:, a hung or starved scan now lets the I/O unit's communication watchdog act. (#886, #865)- With
watchdog:set, once no scan has completed for 4 s (about 5–8 s into the hang), the driver holds no session, the unit trips, and outputs with a watchdog value go to it. Withoutwatchdog:it keeps reading and writes nothing. - When the scans resume, it reconnects, counts the trip in
__WatchdogTripsand commands every output again. Before, the driver's polls kept the watchdog fed, and outputs held their last command through the hang. - While the gate is held, the EPIC keeps the configuration the driver set on it (custom area, stream, watchdog time): with no session, nothing restores it until the scans resume or
naut runstops cleanly. Withoutwatchdog:the driver sends no output writes while held, but a reconnect still writes its configuration.
- With
- PLCnext gets a write gate: a hung or starved scan stops all of the driver's writes. (#866, #863)
- shm with its watchdog: the shim zeroes the outputs (not counted in
__WatchdogTrips). - gRPC, or shm with
output-watchdog: 0: the outputs hold, with an error log,Health.GateHoldsand an "outputs held" status row. - The BusConductor handshake checks the gate before each request; a deferred handshake finishes once the gate opens. When the gate reopens, nothing is written until the program's next push.
- shm with its watchdog: the shim zeroes the outputs (not counted in
- groov EPIC: a writable Scratch Pad element that another client has overwritten now reads Bad until it holds the program's command again, as digital outputs already did. (#761)
- Screens:
tools/deploy/naut-release.shis retired. Usenaut deploy. (#764)
Added
Real-time safety (#836): a runaway real-time task is stopped before it can starve the box.
- The bound. Before a task takes
SCHED_FIFO, naut setsRLIMIT_RTTIME(200 ms soft, 500 ms hard;NAUTILUS_RT_LIMIT_MSchanges it). A task that hits the limit is demoted to normal priority. If the bound can't be set, the priority is refused rather than taken without it. (#839) - A priority watchdog demotes a task after 50 scans in a row over its period, or one scan running longer than 20 periods. Set it per task with
priority-guard: {overruns, scan-multiple}. (#847) - Pre-flight refuses pinning a task beside another program's higher-priority real-time thread on the same CPU. You'll see an error and
REAL-TIME REFUSEDon the banner;share-cpu: trueoverrides it. It also warns when a kernel network thread on that CPU runs below the task. (#851, #853) naut-launchand the PLCnext shim set the same bound before they take priority. (#852, #854)- Liveness. A loop starved between scans now counts as stuck for the redundancy elector, the systemd watchdog and the local gate. (#859)
tools/jitterstops a run the box can't keep up with and marks the reportINVALID. (#857)priority-guard: {rt-limit}sets the bound per task, from 10 ms to 200 ms. It can only tighten the 200 ms default, never loosen it: a larger value is refused, and so is one on a task withoutpriority:(NAUTILUS_RT_LIMIT_MSstill replaces the default). The kernel keeps one limit per process, so the strictest in force wins, and each task'ssched.guard.rtLimitMsshows it. (#918, #907)- GOMAXPROCS on small boxes. With 4 or fewer cores (or a cgroup CPU limit of 4 or less), a task at
priority:and noGOMAXPROCSin the environment,naut runraises GOMAXPROCS to cores + (tasks at a priority) + 1, capped at 2 × cores + 2. A task at a SCHED_FIFO priority still needs a free Go P, and on two cores a long scan plus the GC could hold both for Go's ~10 ms preemption. SetGOMAXPROCSto keep your own value. (#871, #830)
Runtime status tags (#923, #850): a type: runtime driver binds input tags to the runtime's own health, so alarms, the historian and screens can see it. Each binding names a task: and a status:: demoted and faulting (BOOL), logic-errors, late and overruns (UDINT). It polls every scan-rate (default 1 s), and every binding reads false / 0 until the first poll. Under Sparkplug it is a device like any driver with inputs, born with the node. A standby doesn't scan, so these tags move only on the replica that leads.
Retained values survive a power cut. retain.json and the Sparkplug bdSeq file are synced before and after the rename, so a power cut leaves the old file or the new one, never an empty one. Retained values also load before the tag API answers, so an early write is no longer overwritten. (#845, #690)
Deploying with naut:
naut deployinstall | update | rollback | status | backup | restore | uninstall <ssh-target> [project-dir]installs, updates and rolls back a controller over SSH. A start that fails or hangs is rolled back automatically. It fetches the naut release for the box's architecture. (#764)-supervisor croncovers a box without systemd or root, such as PLCnext. (#808)naut deploy helpersets up a user with sudo for one command. (#835)naut new --deploy-sshwrites a CD workflow that deploys each tag. (#834)naut build -runtime <naut>builds a controller for another architecture (for example linux/arm64) from any machine. (#731)- Under systemd,
naut runreports READY after its first scan, and sends the watchdog heartbeat only while scans are live. (#733)
PROFINET device:
- The new
profinet-devicedriver makes nautilus a PROFINET IO device, with a quality and a write gate per point, andnaut profinet gsdml | tags. It needsCAP_NET_RAW. (#738) - Refused under
redundancy:, like the PLCnext driver, until a takeover can move the station's floating IP address to the new leader (#787). (#790) - Not yet proven on hardware: tested on simulated segments only, not yet against a real PLC.
Siemens online:
naut siemens serveputs a running S7-1500 on the nautilus runtime API over its PLC Web API. (#809, #860)- Not yet proven on hardware: tested against a fake CPU, not yet against the bench CPU.
- TIME tags, arrays, and anything nested deeper than 4 levels are listed as skipped, with the reason.
- The building blocks for the Siemens target: a PLC Web API client with certificate pinning (#795), nautilus programs to SCL (#801), a TIA Openness agent client (#792), and
target: siemensin the manifest (#799).
Virtual devices (#729, #739, #742, #744):
- A device profile format, and
naut devices/naut devices upto run them. naut testagainst virtual devices in virtual time.- ABB drive, IO-Link master (over OPC UA) and FDC MCT4 temperature controller profiles.
Operator screens built by naut (#668 and the screen PRs before it):
naut runbuilds the project's Svelte screen with nothing else installed, andnaut buildembeds it.naut hmi buildbuilds it on its own.naut checkchecks every screen: tags, components and pipe ends. It renders each page in Chrome/Chromium/Edge when one is installed, and reports throws, blank pages, unreadable contrast, text under the size floor, crossings and text drawn over text. (#671, #675, #679, #683, #685, #689)- New in the kit: operable controls, a
/componentspage, repeatedunits, auto-routed pipes ("routing": "auto"), crossings drawn as crossings, and screens that fit the window. (#664, #676, #677, #678, #680, #681, #736)
Other additions:
READ/WRITE(IEC 61131-5) on manifestchannels:, the first kind beingcip(a Logix controller over EtherNet/IP). LogixMSGinstructions import as them and write back asMSG. (#699, #701, #702)- OPC UA client:
read-mode: subscribe. A refused subscription fails the session loudly. (#740) - groov EPIC: read-only Scratch Pad inputs (
naut optommp import --scratch-*-in), and a 250 ms to 1 s redial when the processor is local. (#761, #788) - PLCnext:
naut-launchkeeps real-time priority across releases. (#770)
Fixed
Logix import:
- A preset the logic computes now runs the block. (#737)
- An array tag starts at the export's values. (#779)
- A data box's narrowing store imports as the IEC conversion. (#781)
- A timer or counter on a later branch leg runs after the earlier legs. (#785)
- A timer's ACC/PRE in arithmetic is its milliseconds. (#802)
COP/CPScome across like for like. (#695)- A rung naming a module-defined AOI parameter is refused with a reason. (#780)
Import and tag files: names, roles and types that YAML would misread are quoted, so imported projects load. (#693)
Ladder view: a FUNCTION_BLOCK's rungs read live values from its instance. (#694)
Sparkplug host: a demoted leader stops reporting its session as connected before its STATE death goes out. (#813)
Sparkplug edge: a groov EPIC (OptoMMP) or PLCnext device now sends DDEATH when its link is lost, and DBIRTH when it's back. Before, those devices counted as always healthy, so a lost processor never sent DDEATH. A PLCnext device counts as online only while its inputs are Good (session up, bus running, a fresh frame). (#864)
Redundancy: a queued READ/WRITE channel write is sent only by the leader that posted it. A replica that stepped down, or regained the lease, no longer sends writes queued under its earlier leadership; they finish as CommLost (STATUS -6). Reads are not gated. (#797, #796)
EtherNet/IP (Logix): a tag read that fails while the session stays up now reads Bad, holding the last good value, until a read succeeds. Before, it kept reading Good. A failed member makes its whole struct Bad. A dropped session is unchanged: delivered tags read Stale, never-delivered ones NotConnected. (#862)
PLCnext: run-port: none is honoured. Before, it was silently ignored and the driver read the default RUN port. With no RUN port and the handshake held by the gate, the bus reads as stopped: inputs Bad, "not started yet: the write gate is closed". (#875, #874)
Real time: a data race between arming the real-time guard and a loop ending (its thread table was written without its lock). (#872, #870)
naut check / naut hmi: the headless browser that renders screens now gets 120 s to start (was 20 s); NAUT_BROWSER_START_TIMEOUT (a duration such as 5m) changes it on a slow machine, and the timeout error names it. (#922, #921)
OPC UA client: a new certificate gets a subject of its own and an Authority Key Identifier. An existing certificate is kept. (#773)
Screens:
- A screen no longer blanks on an app with no layout, a pipe with no points, or a broken component. (#667, #672)
- Component ports now reach the built screen. (#674)
- The dashboard fits a phone. (#673)
Goes with
Published with this release, to npm and the extension's pre-release channel:
- VS Code extension 0.21.2 (pre-release). Its schema knows 0.22.0's new manifest keys, and Enter indents after
IF … THENagain. It sends the token on every request, which a 0.22.0 controller reached by name needs, and only tonautilus.runtimeUrl. A workspace-chosenruntimeUrlgets your user token only after a one-time Send it to … approval. Remote windows need that approval for any non-defaultruntimeUrl, and untrusted workspaces ignore their ownruntimeUrlandtoken. @joyautomation/nautilus-hmi0.10.0.@joyautomation/nautilus-hmi-3d0.4.0.
The extension's stable channel stays at 0.20.0.