JetKVM - Control any computer remotely
kvm
Go to file
Cameron Fleming 5217377175
feat(display.go): Add display brightness settings (#17)
* feat(display.go): impl setDisplayBrightness()

Implements setDisplayBrightness(brightness int) which allows setting the
backlight brightness on JetKVM's hardware.

Needs to be implemented into the RPC, config and frontend.

* feat(config): add backlight control settings

* feat(display): add automatic dimming & switch off to display

WIP, dims the display to 50% of the BacklightMaxBrightness after
BacklightDimAfterMS expires. Turns the display off after
BacklightOffAfterMS

* feat(rpc): add methods to get and set BacklightSettings

* WIP: feat(settings): add Max backlight setting

* chore: use constant for backlight control file

* fix: only attempt to wake the display if it's off

* feat(display): wake on touch

* fix: re-use buffer between reads

* fix: wakeDisplay() on start to fix warm start issue

If the application had turned off the display before exiting, it
wouldn't be brought on when the application restarted without a device
reboot.

* chore: various comment & string updates

* fix: newline on set brightness log

Noticed by @eric
https://github.com/jetkvm/kvm/pull/17#discussion_r1903338705

* fix: set default value for display

Set the DisplayMaxBrightness to the default brightness used
out-of-the-box by JetKVM. Also sets the dim/timeout to 2 minutes and 30
mintes respectively.

* feat(display.go): use tickers to countdown to dim/off

As suggested by tutman in https://github.com/jetkvm/kvm/pull/17, use
tickers set to the duration of dim/off to avoid a loop running every
second. The tickers are reset to the dim/off times whenever
wakeDisplay() is called.

* chore: update config

Changed Dim & Off values to seconds instead of milliseconds, there's no
need for it to be that precise.

* feat(display.go): wakeDisplay() force

Adds the force boolean to wakedisplay() which allows skipping the
backlightState == 0 check, this means you can force a ticker reset, even
if the display is currently in the "full bright" state

* feat(display.go): move tickers into their own method

This allows them to only be started if necessary. If the user has chosen
to keep the display on and not-dimmed all the time, the tickers can't
start as their tick value must be a positive integer.

* feat(display.go): stop tickers when auto-dim/auto-off is disabled

* feat(rpc): implement display backlight control methods

* feat(ui): implement display backlight control

* chore: update variable names

As part of @joshuasing's review on #17, updated variables & constants to
match the Go best practices.

Signed-off-by: Cameron Fleming <cameron@nevexo.space>

* fix(display): move backlightTicker setup into screen setup goroutine

Signed-off-by: Cameron Fleming <cameron@nevexo.space>

* chore: fix some start-up timing issues

* fix(display): Don't attempt to start the tickers if the display is disabled

If max_brightness is zero, then there's no point in trying to dim it (or
turn it off...)

* fix: wakeDisplay() doesn't need to stop the tickers

The tickers only need to be reset, if they're disabled, they won't have
been started.

* fix: Don't wake up the display if it's turned off

---------

Signed-off-by: Cameron Fleming <cameron@nevexo.space>
2025-02-17 11:00:28 +01:00
.devcontainer Add devcontainer support (#8) 2025-01-02 20:00:44 +01:00
bin Release 202412292127 2024-12-29 21:27:42 +01:00
cmd Release 202412292127 2024-12-29 21:27:42 +01:00
resource Release 202412292127 2024-12-29 21:27:42 +01:00
ui feat(display.go): Add display brightness settings (#17) 2025-02-17 11:00:28 +01:00
.gitignore Release 202412292127 2024-12-29 21:27:42 +01:00
CODE_OF_CONDUCT.md Release 202412292127 2024-12-29 21:27:42 +01:00
LICENSE Release 202412292127 2024-12-29 21:27:42 +01:00
Makefile Add devcontainer support (#8) 2025-01-02 20:00:44 +01:00
README.md Release 202412292127 2024-12-29 21:27:42 +01:00
block_device.go Release 202412292127 2024-12-29 21:27:42 +01:00
cloud.go feat: add ICE servers and local IP address returned by the API to fix connectivity issues behind NAT (#146) 2025-02-11 15:45:14 +01:00
config.go feat(display.go): Add display brightness settings (#17) 2025-02-17 11:00:28 +01:00
dev_deploy.sh Add devcontainer support (#8) 2025-01-02 20:00:44 +01:00
display.go feat(display.go): Add display brightness settings (#17) 2025-02-17 11:00:28 +01:00
fuse.go Release 202412292127 2024-12-29 21:27:42 +01:00
go.mod chore: use github.com/coder/websocket instead of nhooyr.io/websocket (#14) 2025-01-02 23:51:29 +01:00
go.sum chore: use github.com/coder/websocket instead of nhooyr.io/websocket (#14) 2025-01-02 23:51:29 +01:00
hw.go Release 202412292127 2024-12-29 21:27:42 +01:00
jiggler.go Release 202412292127 2024-12-29 21:27:42 +01:00
jsonrpc.go feat(display.go): Add display brightness settings (#17) 2025-02-17 11:00:28 +01:00
log.go Release 202412292127 2024-12-29 21:27:42 +01:00
main.go fix(cloud): only start WS Client if config.CloudToken is set (#27) 2025-02-11 14:51:18 +01:00
native.go feat: restore EDID on reboot (#34) 2025-02-13 14:42:07 +01:00
network.go Restart mDNS every time the connection information changes (#155) 2025-02-13 18:10:47 +01:00
ntp.go Release 202412292127 2024-12-29 21:27:42 +01:00
ota.go Release 202412292127 2024-12-29 21:27:42 +01:00
publish_source.sh Release 202412292127 2024-12-29 21:27:42 +01:00
remote_mount.go Release 202412292127 2024-12-29 21:27:42 +01:00
terminal.go Release 202412292127 2024-12-29 21:27:42 +01:00
usb.go Enable "Boot Interface Subclass" for keyboard and mouse. (#113) 2025-02-12 15:08:03 +01:00
usb_mass_storage.go Release 202412292127 2024-12-29 21:27:42 +01:00
video.go Release 202412292127 2024-12-29 21:27:42 +01:00
web.go feat: add ICE servers and local IP address returned by the API to fix connectivity issues behind NAT (#146) 2025-02-11 15:45:14 +01:00
webrtc.go feat: add ICE servers and local IP address returned by the API to fix connectivity issues behind NAT (#146) 2025-02-11 15:45:14 +01:00
wol.go Release 202412292127 2024-12-29 21:27:42 +01:00

README.md

JetKVM is a high-performance, open-source KVM over IP (Keyboard, Video, Mouse) solution designed for efficient remote management of computers, servers, and workstations. Whether you're dealing with boot failures, installing a new operating system, adjusting BIOS settings, or simply taking control of a machine from afar, JetKVM provides the tools to get it done effectively.

Features

  • Ultra-low Latency - 1080p@60FPS video with 30-60ms latency using H.264 encoding. Smooth mouse and keyboard interaction for responsive remote control.
  • Free & Optional Remote Access - Remote management via JetKVM Cloud using WebRTC.
  • Open-source software - Written in Golang on Linux. Easily customizable through SSH access to the JetKVM device.

Contributing

We welcome contributions from the community! Whether it's improving the firmware, adding new features, or enhancing documentation, your input is valuable. We also have some rules and taboos here, so please read this page and our Code of Conduct carefully.

I need help

The best place to search for answers is our Documentation. If you can't find the answer there, check our Discord Server.

I want to report an issue

If you've found an issue and want to report it, please check our Issues page. Make sure the description contains information about the firmware version you're using, your platform, and a clear explanation of the steps to reproduce the issue.

Development

JetKVM is written in Go & TypeScript. with some bits and pieces written in C. An intermediate level of Go & TypeScript knowledge is recommended for comfortable programming.

The project contains two main parts, the backend software that runs on the KVM device and the frontend software that is served by the KVM device, and also the cloud.

For most of local device development, all you need is to use the ./dev_deploy.sh script. It will build the frontend and backend and deploy them to the local KVM device. Run ./dev_deploy.sh --help for more information.

Backend

The backend is written in Go and is responsible for the KVM device management, the cloud API and the cloud web.

Frontend

The frontend is written in React and TypeScript and is served by the KVM device. It has three build targets: device, development and production. Development is used for development of the cloud version on your local machine, device is used for building the frontend for the KVM device and production is used for building the frontend for the cloud.