mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
gpio test configs
This commit is contained in:
parent
6c5a485b48
commit
91557ebbaf
2
Makefile
2
Makefile
@ -3,6 +3,7 @@
|
|||||||
TESTENV_IMAGE ?= kvmd-testenv
|
TESTENV_IMAGE ?= kvmd-testenv
|
||||||
TESTENV_HID ?= /dev/ttyS10
|
TESTENV_HID ?= /dev/ttyS10
|
||||||
TESTENV_VIDEO ?= /dev/video0
|
TESTENV_VIDEO ?= /dev/video0
|
||||||
|
TESTENV_RELAY ?= $(if $(shell ls /dev/hidraw0 2>/dev/null || true),/dev/hidraw0,)
|
||||||
|
|
||||||
USTREAMER_MIN_VERSION ?= $(shell grep -o 'ustreamer>=[^"]\+' PKGBUILD | sed 's/ustreamer>=//g')
|
USTREAMER_MIN_VERSION ?= $(shell grep -o 'ustreamer>=[^"]\+' PKGBUILD | sed 's/ustreamer>=//g')
|
||||||
|
|
||||||
@ -75,6 +76,7 @@ run: testenv
|
|||||||
--volume `pwd`/configs:/usr/share/kvmd/configs.default:ro \
|
--volume `pwd`/configs:/usr/share/kvmd/configs.default:ro \
|
||||||
--volume `pwd`/contrib/keymaps:/usr/share/kvmd/keymaps:ro \
|
--volume `pwd`/contrib/keymaps:/usr/share/kvmd/keymaps:ro \
|
||||||
--device $(TESTENV_VIDEO):$(TESTENV_VIDEO) \
|
--device $(TESTENV_VIDEO):$(TESTENV_VIDEO) \
|
||||||
|
$(if $(TESTENV_RELAY),--device $(TESTENV_RELAY):$(TESTENV_RELAY),) \
|
||||||
--publish 8080:80/tcp \
|
--publish 8080:80/tcp \
|
||||||
-it $(TESTENV_IMAGE) /bin/bash -c " \
|
-it $(TESTENV_IMAGE) /bin/bash -c " \
|
||||||
(socat PTY,link=$(TESTENV_HID) PTY,link=/dev/ttyS11 &) \
|
(socat PTY,link=$(TESTENV_HID) PTY,link=/dev/ttyS11 &) \
|
||||||
|
|||||||
@ -39,79 +39,52 @@ kvmd:
|
|||||||
|
|
||||||
gpio:
|
gpio:
|
||||||
drivers:
|
drivers:
|
||||||
gpio2:
|
relay:
|
||||||
type: gpio
|
type: hidrelay
|
||||||
state_poll: 0.3
|
device: /dev/hidraw0
|
||||||
|
|
||||||
scheme:
|
scheme:
|
||||||
host1: # any name like foo_bar_baz
|
led1:
|
||||||
|
pin: 0
|
||||||
|
mode: input
|
||||||
|
|
||||||
|
led2:
|
||||||
pin: 1
|
pin: 1
|
||||||
mode: input
|
mode: input
|
||||||
host2:
|
|
||||||
pin: 2
|
button1:
|
||||||
mode: input
|
pin: 10
|
||||||
host3:
|
|
||||||
pin: 3
|
|
||||||
mode: input
|
|
||||||
host4:
|
|
||||||
pin: 4
|
|
||||||
mode: input
|
|
||||||
change_host:
|
|
||||||
pin: 5
|
|
||||||
mode: output
|
mode: output
|
||||||
switch: false
|
switch: false
|
||||||
|
|
||||||
host1_pwr:
|
button2:
|
||||||
pin: 11
|
pin: 11
|
||||||
mode: input
|
|
||||||
host2_pwr:
|
|
||||||
pin: 12
|
|
||||||
mode: input
|
|
||||||
host3_pwr:
|
|
||||||
pin: 13
|
|
||||||
mode: input
|
|
||||||
host4_pwr:
|
|
||||||
pin: 14
|
|
||||||
mode: input
|
|
||||||
|
|
||||||
host1_pwr_btn:
|
|
||||||
pin: 21
|
|
||||||
mode: output
|
|
||||||
switch: false
|
|
||||||
host2_pwr_btn:
|
|
||||||
pin: 22
|
|
||||||
mode: output
|
|
||||||
switch: false
|
|
||||||
host3_pwr_btn:
|
|
||||||
pin: 23
|
|
||||||
mode: output
|
|
||||||
switch: false
|
|
||||||
host4_pwr_btn:
|
|
||||||
pin: 24
|
|
||||||
mode: output
|
mode: output
|
||||||
switch: false
|
switch: false
|
||||||
|
|
||||||
lamp:
|
relay1:
|
||||||
pin: 50
|
pin: 0
|
||||||
mode: output
|
mode: output
|
||||||
pulse:
|
initial: null
|
||||||
delay: 0
|
driver: relay
|
||||||
|
|
||||||
|
relay2:
|
||||||
|
pin: 1
|
||||||
|
mode: output
|
||||||
|
initial: null
|
||||||
|
driver: relay
|
||||||
|
|
||||||
view:
|
view:
|
||||||
header:
|
|
||||||
title: Switch
|
|
||||||
table:
|
table:
|
||||||
- ["#Multihost controller"]
|
- ["#Generic GPIO leds"]
|
||||||
- []
|
- []
|
||||||
- ["", "#Current", "#Power"]
|
- ["#Test 1:", led1, button1]
|
||||||
- ["#host1.localdomain:", host1, host1_pwr, "host1_pwr_btn,Pwr"]
|
- ["#Test 2:", led2, button2]
|
||||||
- ["#host2.localdomain:", host2, host2_pwr, "host2_pwr_btn,Pwr"]
|
|
||||||
- ["#host3.localdomain:", host3, host3_pwr, "host3_pwr_btn,Pwr"]
|
|
||||||
- ["#host4.localdomain:", host4, host4_pwr, "host4_pwr_btn,Pwr"]
|
|
||||||
- []
|
- []
|
||||||
- ["change_host,Change host"]
|
- ["#HID Relays /dev/hidraw0"]
|
||||||
- []
|
- []
|
||||||
- ["#Lamp in the rack", lamp]
|
- ["#Relay #1:", relay1]
|
||||||
|
- ["#Relay #2:", relay2]
|
||||||
|
|
||||||
vnc:
|
vnc:
|
||||||
keymap: /usr/share/kvmd/keymaps/ru
|
keymap: /usr/share/kvmd/keymaps/ru
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user