Thermal monitoring and safe fan management for Linux laptops.
NeoSense is a modern interface around NBFC (Notebook FanControl). It is written in Rust and keeps fan writes behind a single safety supervisor.
NeoSense is not a replacement for NBFC. NBFC remains responsible for the embedded controller (EC), hardware configurations and vendor critical-temperature handling.
- Version: 2.4.0 development (Rust).
- Release status: 2.3.0 remains an unpublished frozen artifact; 2.4.0 is in development for the profile simulation engine. Neither is publicly released.
- Fan backend: NBFC.
- Platform: Linux.
- TUI: Ratatui/Crossterm, read-only by default;
safe-autocan be applied through the supervisor with confirmation. - Thermal profiles: deterministic preview/simulation engine; real closed-loop fan application remains disabled by hardware-safety policy.
- Manual fan control: implemented but blocked by policy on NBFC < 0.5.4, missing/stale sensors, ambiguous fan mapping and unreliable readback.
| Command | Purpose |
|---|---|
neosense status |
Concise CPU/GPU, backend, fan and safety summary |
neosense status --json |
Versioned JSON summary |
neosense sensors list |
Typed sensor inventory with provenance and trust |
neosense sensors show <id> |
Raw and normalized details for one sensor |
neosense sensors watch |
Read-only periodic refresh |
neosense fan status |
Fan mode, requested/target/EC values and source |
neosense fan auto |
Return to NBFC automatic mode via the supervisor |
neosense fan set |
Manual speed request, subject to safety policy |
neosense fan hold |
Hold current target, subject to safety policy |
neosense fan release |
Explicit firmware/EC release (not implemented without validation) |
neosense profile list/show/apply |
Profile catalogue and compatibility; only safe-auto is applicable |
neosense profile preview <name> |
Calculate reference fan targets locally with no write |
neosense profile select/clear |
Select/clear a 2.4.0 supervisor simulation profile; no fan write |
neosense hardware list/current/validate |
NBFC model configurations and rate-config analysis |
neosense service status |
NBFC and NeoSense supervisor status |
neosense diagnose |
Read-only compatibility and safety diagnostics |
neosense config show/path |
Effective settings and supervisor socket |
neosense tui |
Interactive terminal UI |
neosense completions <shell> |
Generate bash/zsh/fish/elvish/powershell completions |
neosense version |
Version |
Read commands work without the supervisor. All state-changing operations go through neosensed.
NeoSense targets Linux laptops with NBFC, systemd and readable hwmon/thermal
sensors. The current release is built and tested for
x86_64-unknown-linux-gnu; no broad distribution or laptop compatibility claim
is made from the single development machine. The tested environment is Nobara
44 with kernel 7.3 and NBFC 0.5.3. Other distributions may work, but should be
validated read-only first with neosense diagnose --json.
- Linux with systemd and NBFC installed and configured.
- NBFC 0.5.4 or newer recommended for protected manual control (
status --json,reset-ec, systemdExecStopPost). - NBFC 0.5.3 remains usable read-only and for
fan auto/diagnose. - Rust/Cargo only for a source install.
sudofor installing binaries and the systemd unit.- No Python or other runtime dependency from NeoSense itself.
Download neosense-<version>-<target>.tar.gz and SHA256SUMS, verify the
checksum, then install:
sha256sum -c SHA256SUMS
tar -xzf neosense-2.4.0-x86_64-unknown-linux-gnu.tar.gz
cd neosense-2.4.0-x86_64-unknown-linux-gnu
sudo ./install.shThe archive contains prebuilt binaries, so Rust is not required. The installer
uses bin/neosense and bin/neosensed when present.
git clone git@github.com:NeonMC23/NeoSense.git
cd NeoSense
sudo ./install.shA source checkout has no bin/ directory, so the installer builds release
binaries with Cargo. Both paths create the neosense system group if needed and
install:
/usr/local/bin/neosense/usr/local/bin/neosensed/etc/systemd/system/neosensed.service/run/neosense/(root:neosense, mode0750)
It does not start an inactive supervisor. If the supervisor was already
running, the installer restarts and verifies it after a successful upgrade;
--no-restart keeps the old process running and prints the explicit restart
step. A running supervisor's designed shutdown fail-safe may return NBFC to
automatic mode, so this is not described as a zero-write upgrade.
Before replacing files, the installer stages and verifies the built binary, creates a timestamped backup under ${NEOSENSE_STATE_DIR:-/var/lib/neosense}/backups/, and restores the previous binary/unit if installation verification fails. It supports an in-place upgrade and verifies the restarted supervisor's IPC state. If restart verification fails, it restores the previous binaries/unit and attempts to restart the previous supervisor.
Add an authorized user to the neosense group:
sudo usermod -aG neosense "$USER"
# Log out and back in, or run: newgrp neosenseThe IPC socket is created as root:neosense, mode 0660; the runtime directory is root:neosense, mode 0750. A user outside the group receives a clear permission error (exit code 4).
See docs/HOST_INSTALL.md for the root installation,
group-session, service, rollback and uninstall checklist.
sudo systemctl enable --now neosensedThe supervisor is the sole fan-write authority. It sends READY=1 only after the socket is bound, permissioned, and an initial state snapshot is available. It sends WATCHDOG=1 only while its health checks pass, and STOPPING=1 during orderly shutdown.
The service uses Type=notify and WatchdogSec=10s. See docs/SYSTEMD.md.
./packaging/build-release.shThis produces dist/neosense-<version>-<target>.tar.gz containing the binaries, installer, uninstaller, systemd unit, docs, completions, BUILD-INFO and checksums. The archive is generated locally and is not committed. Validate it before publishing:
./packaging/test-release-archive.sh dist/neosense-*.tar.gzThe test checks archive contents and, when user namespaces are available, installs and uninstalls the extracted prebuilt archive in a temporary root.
sudo ./uninstall.shThe script stops the supervisor (triggering automatic recovery), removes NeoSense-owned binaries, unit, runtime/state directories and backups, and removes the neosense group only when it is empty and has no primary users. NBFC configuration is untouched.
neosense status
neosense sensors list
neosense sensors show hwmon:coretemp:...:temp1
neosense fan status
neosense diagnose
neosense hardware list
neosense hardware current
sudo neosense hardware validate "Acer Nitro AN515-57 Custom"hardware validate calls nbfc rate-config, which needs root to read ACPI tables.
Control through the supervisor:
sudo systemctl start neosensed
neosense fan auto
neosense fan set cpu 50 --yesAfter group membership and a new login session, control commands no longer need sudo. fan set exits 8 if the safety policy cannot establish a safe operation. On NBFC 0.5.3 manual control is deliberately refused.
neosense tuiThe header shows the application/version, hardware model, NBFC version and a compact supervisor state. Full IPC failures live in System/Diagnostics. Six views: Dashboard, Sensors, Fans, Profiles, System and Diagnostics.
Tab/arrows: change view;1–6: direct access.r: refresh;?: help;q/Esc: quit.- Profiles: Up/Down select; Enter previews/simulates the selected curve;
yconfirms,ncancels. Closed-loop profiles are simulation-only and never write fan state. a: return to NBFC automatic mode, with confirmation.- Without a supervisor the TUI stays read-only and says so.
- No direct manual-speed path exists in the TUI. See
docs/TUI.mdfor the real-terminal rendering evidence.
neosense diagnose is grouped for scanning:
- overall summary (operational, supervisor, fan control, thermal reliability, critical/warning counts);
- critical blockers;
- backend;
- hardware;
- thermal monitoring;
- fan telemetry;
- control capabilities;
- security and permissions.
neosense diagnose --json exposes the same information with stable groups and a machine-readable summary. See docs/IMPLEMENTATION.md.
- Single writer. Only
neosensedwrites fan state. - No invented values. Missing, invalid, stale or unreadable sensors are
null/unavailable, never0 °C. - Evidence before control. Manual control needs valid, fresh and trusted CPU/GPU data, a known fan mapping, a floor, a ceiling and explicit confirmation.
- No generic GPU sensor. Wi-Fi/NVMe/ACPI channels are never promoted to GPU by keyword.
- No false success.
nbfc setacceptance is not proof of physical fan speed. EC readback is not RPM. - Fail safe. Lease expiry, lost sensors, NBFC critical mode or failed verification trigger automatic recovery or a fail-safe state.
- Profiles are validated.
safe-autois compatible only when NBFC, service and CPU evidence are available. Closed-loop Quiet/Balanced/Performance profiles use deterministic reference curves for preview/simulation; they are not applied to hardware until mapping, feedback, recovery and authorization are validated. - Warnings are explicit. Every warning carries a severity label, cause and next safe action; colour is never the only signal.
- NBFC 0.5.3 lacks
status --jsonandreset-ec: protected manual control is refused. - NBFC's own socket remains
0666. NBFC 0.5.3 and 0.5.4 hardcodechmod 0666inserver.cand offer no supported socket-permission option. Theneosensegroup protects NeoSense only; any local user can call NBFC directly. No unsafe permission override was applied. - Many laptops expose no RPM through hwmon; physical verification is then limited.
- Some NBFC configurations drive the GPU fan from
@CPU;diagnosereports this and GPU manual control is blocked. - Closed-loop Quiet/Balanced/Performance profiles now have deterministic simulation curves but are not applied to hardware. See
docs/PROFILES.md. fan releaseis intentionally unavailable untilreset-ec/firmware return is validated.- No broad laptop compatibility claim is made from a single machine.
neosense (Rust CLI) ── IPC ──┐
neosense tui (Ratatui) ─────┴── Unix JSON ──► neosensed
├── sensor registry / hwmon / thermal / NVIDIA
├── NBFC backend
├── safety policy + verification
└── systemd READY / WATCHDOG / STOPPING
neosense status/sensors/diagnoseread directly and never write.fan/profilewrites and TUI controls use the single supervisor IPC protocol.neosensedowns fan writes and recovery.- Shell is limited to installation, removal and systemd integration.
docs/CLI.mdis the complete CLI reference.docs/CLI_AUDIT.mdrecords the command inventory and validation matrix.docs/HARDWARE.mdrecords current hardware evidence and backend acceptance criteria.docs/PROFILES.mddocuments curves, simulation boundaries and hardware-control prerequisites.docs/ROADMAP.mdtracks feature status, evidence and blockers.docs/RELEASE.mddescribes the release checklist and artifacts.docs/RELEASE_NOTES.mdcontains the frozen 2.3.0 notes.docs/RELEASE_NOTES_2.4.0.mdcontains the 2.4.0 development notes.CHANGELOG.mdrecords user-visible changes.CONTRIBUTING.mdandSECURITY.mdcover contribution and disclosure.
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-features
cargo build --release --locked
shellcheck install.sh uninstall.shTests never write fan state. Unit tests cover NBFC parsing, sensor fixtures, NVIDIA parsing, policy, profiles, IPC, daemon lifecycle and TUI rendering. See docs/IMPLEMENTATION.md.
Hardware-dependent tests are separate. neosense diagnose --json is the read-only entry point. No fan speed, EC reset, firmware or NBFC configuration change should be performed without explicit authorization and a validated recovery plan.
| Item | Status |
|---|---|
| Acer Nitro AN515-57, i5-11400H, RTX 3050, NBFC 0.5.3 | Read-only verified; manual control refused |
| Other laptops | Must be validated individually; no broad claim |
| NBFC 0.5.4+ | Recommended for protected manual control; test on target hardware |
| iGPU / no GPU | No invented GPU temperature; GPU control unavailable |
| No RPM | Verification limited; reported by diagnose |
- Sensor and CLI correctness (done).
- Typed sensor model and read-only diagnostics (done).
- Supervisor, IPC and systemd recovery foundations (done).
- TUI, profile catalogue, deterministic simulation engine and compatibility checks (done).
- Real closed-loop hardware application, full hardware matrix and root-level systemd validation (next).
MIT. See LICENSE.