I did some research but couldn’t find an answer. I apologize if this has already been answered. I added an i2c OLED to my DIY PiKVM and enabled it. So far, no problems. However, I need to rotate the screen 180 degrees, and I haven’t figured out how. Thanks in advance for your help.
Hi Ferdi, welcome to our forum.
From the FAQ:
mkdir -p /etc/systemd/system/kvmd-oled.service.d- create
/etc/systemd/system/kvmd-oled.service.d/override.conf:
[Service]
ExecStart=
ExecStart=/usr/bin/kvmd-oled --clear-on-exit --rotate=0
from kvmd-oled --help:
--rotate, -r ROTATION
Rotation factor. Allowed values are: 0, 1, 2, 3 (default: 2)
- restart
kvmd-oledor reboot the device
Hope this helps.
Cheers,
Nick
Hello Nick,
Thanks for help but I did everything you said. Unfortunately, nothing changes. I also tried all the options (0-1-2-3).
Depending on the screen device, you might need to specify other command line parameters, many of which are specific to particular hardware. Sometimes explicitly specifying screen height helps, which is rather counterintuitive.
@ewspikvm: any other ideas?
Are you using the DIY v1 or v2 image?
Hello, I’m using V2 image with Pi4 and 0.91’’ 128X32 SSD1306
Thanks & Regards;
After you created the service file with the changed parameters, did you also enable and restart the service, or restart the PiKVM?
I first tried stopping the service. When that didn’t work, I tried restarting the system completely after each change, but the results remained the same.
Thanks,
If you run kvmd -m through a shell, does it show any configuration sections for the OLED there?
Ferdi,
Could you please edit your post or post it again, and make sure the whole output is formatted correctly? Our forum software interprets what you type/paste as markdown text, hence the resulting mess.
Reference: Discourse Guide: Code Formatting - Meta - Stonehearth Discourse
Thank you.
[root@kvm-pve01 ~]# kvmd -m
ipmi:
auth:
file: /etc/kvmd/ipmipasswd
kvmd:
timeout: 5.0
unix: /run/kvmd/kvmd.sock
server:
host: ''
port: 623
timeout: 10.0
sol:
device: ''
proxy_port: 0
select_timeout: 0.1
speed: 115200
janus:
check:
interval: 10.0
retries: 5
retries_delay: 5.0
cmd:
- /usr/bin/janus
- --disable-colors
- --plugins-folder=/usr/lib/ustreamer/janus
- --configs-folder=/etc/kvmd/janus
- --interface={src_ip}
- '{o_stun_server}'
cmd_append: []
cmd_remove: []
stun:
host: stun.l.google.com
port: 19302
retries: 5
retries_delay: 5.0
timeout: 5.0
kvmd:
atx:
click_delay: 0.1
device: /dev/gpiochip0
hdd_led_debounce: 0.1
hdd_led_inverted: false
hdd_led_pin: 22
long_click_delay: 5.5
power_led_debounce: 0.1
power_led_inverted: false
power_led_pin: 24
power_switch_pin: 23
reset_switch_pin: 27
# type: ''
type: gpio
auth:
enabled: true
expire: 0
external:
type: ''
internal:
file: /etc/kvmd/htpasswd
force_users: []
type: htpasswd
totp:
secret:
file: /etc/kvmd/totp.secret
usc:
groups:
- kvmd-selfauth
users: []
gpio:
drivers:
__gpio__:
device: /dev/gpiochip0
type: gpio
scheme:
state_poll: 0.1
view:
header:
title: GPIO
table: []
hid:
ignore_keys: []
jiggler:
active: false
enabled: true
interval: 60
keyboard:
device: /dev/kvmd-hid-keyboard
queue_timeout: 0.1
select_timeout: 0.1
write_retries: 150
keymap: /usr/share/kvmd/keymaps/en-us
mouse:
absolute: true
absolute_win98_fix: false
device: /dev/kvmd-hid-mouse
horizontal_wheel: true
queue_timeout: 0.1
select_timeout: 0.1
write_retries: 150
mouse_alt:
device: /dev/kvmd-hid-mouse-alt
horizontal_wheel: true
queue_timeout: 0.1
select_timeout: 0.1
write_retries: 150
mouse_x_range:
max: 32767
min: -32768
mouse_y_range:
max: 32767
min: -32768
noop: false
# type: ''
type: otg
info:
extras: /usr/share/kvmd/extras
fan:
daemon: kvmd-fan
state_poll: 5.0
timeout: 5.0
unix: ''
hw:
ignore_past: false
platform: /usr/share/kvmd/platform
state_poll: 5.0
vcgencmd_cmd:
- /usr/bin/vcgencmd
meta: /etc/kvmd/meta.yaml
log_reader:
enabled: true
msd:
initial:
cdrom: false
image: ''
read_chunk_size: 65536
remount_cmd:
- /usr/bin/sudo
- --non-interactive
- /usr/bin/kvmd-helper-otgmsd-remount
- '{mode}'
sync_chunk_size: 4194304
# type: ''
type: otg
write_chunk_size: 65536
ocr:
langs:
- eng
tessdata: /usr/share/tessdata
prometheus:
auth:
enabled: true
server:
access_log_format: '[%P / %{X-Real-IP}i] ''%r'' => %s; size=%b --- referer=''%{Referer}i''; user_agent=''%{User-Agent}i'''
heartbeat: 15.0
unix: /run/kvmd/kvmd.sock
unix_mode: 432
unix_rm: true
snapshot:
idle_interval: 0.0
live_interval: 0.0
online_delay: 5.0
retries: 10
retries_delay: 3.0
wakeup_key: ''
wakeup_move: 0
streamer:
# cmd:
# - /bin/true
cmd:
- /usr/bin/ustreamer
- --device=/dev/kvmd-video
- --persistent
- --dv-timings
- --format=uyvy
- --buffers=6
- --encoder=m2m-image
- --workers=3
- --quality={quality}
- --desired-fps={desired_fps}
- --drop-same-frames=30
- --unix={unix}
- --unix-rm
- --unix-mode=0660
- --exit-on-parent-death
- --process-name-prefix={process_name_prefix}
- --notify-parent
- --no-log-colors
- --jpeg-sink=kvmd::ustreamer::jpeg
- --jpeg-sink-mode=0660
- --h264-sink=kvmd::ustreamer::h264
- --h264-sink-mode=0660
- --h264-bitrate={h264_bitrate}
- --h264-gop={h264_gop}
cmd_append: []
cmd_remove: []
desired_fps:
default: 40
max: 70
min: 0
forever: false
h264_bitrate:
# default: 0
default: 5000
max: 20000
min: 25
h264_gop:
default: 30
max: 60
min: 0
post_stop_cmd:
- /bin/true
- post-stop
post_stop_cmd_append: []
post_stop_cmd_remove: []
pre_start_cmd:
- /bin/true
- pre-start
pre_start_cmd_append: []
pre_start_cmd_remove: []
process_name_prefix: kvmd/streamer
quality: 80
reset_delay: 1.0
resolution:
available: []
default: ''
shutdown_delay: 10.0
snapshot_timeout: 5.0
state_poll: 1.0
timeout: 2.0
unix: /run/kvmd/ustreamer.sock
switch:
default_edid: /etc/kvmd/switch-edid.hex
device: /dev/kvmd-switch
ignore_hpd_on_top: false
localhid:
kvmd:
timeout: 5.0
unix: /run/kvmd/kvmd.sock
# logging: {}
logging:
disable_existing_loggers: false
formatters:
console:
(): logging.Formatter
format: '{name:30.30} {levelname:>7} --- {message}'
style: '{'
handlers:
console:
class: logging.StreamHandler
formatter: console
level: DEBUG
stream: ext://sys.stderr
root:
handlers:
- console
level: INFO
version: 1
media:
memsink:
h264:
drop_same_frames: 0.0
lock_timeout: 1.0
# sink: ''
sink: kvmd::ustreamer::h264
wait_timeout: 1.0
jpeg:
drop_same_frames: 0.0
lock_timeout: 1.0
sink: ''
wait_timeout: 1.0
server:
access_log_format: '[%P / %{X-Real-IP}i] ''%r'' => %s; size=%b --- referer=''%{Referer}i''; user_agent=''%{User-Agent}i'''
heartbeat: 15.0
unix: /run/kvmd/media.sock
unix_mode: 432
unix_rm: true
nginx:
http:
ipv4: 0.0.0.0
ipv6: '::'
port: 80
https:
enabled: true
ipv4: 0.0.0.0
ipv6: '::'
port: 443
otg:
config: ''
device_version: -1
devices:
audio:
enabled: false
start: true
drives:
count: 1
default:
cdrom: false
fua: true
inquiry_string:
cdrom:
product: Optical Drive
revision: '1.00'
vendor: PiKVM
flash:
product: Flash Drive
revision: '1.00'
vendor: PiKVM
removable: true
rw: true
stall: false
enabled: false
start: true
ethernet:
driver: ecm
enabled: false
host_mac: ''
kvm_mac: ''
start: true
hid:
keyboard:
start: true
mouse:
start: true
mouse_alt:
start: true
msd:
default:
cdrom: true
fua: true
inquiry_string:
cdrom:
product: Optical Drive
revision: '1.00'
vendor: PiKVM
flash:
product: Flash Drive
revision: '1.00'
vendor: PiKVM
removable: true
rw: false
stall: false
start: true
serial:
enabled: false
start: true
endpoints: 9
gadget: kvmd
init_delay: 3.0
manufacturer: PiKVM
max_power: 250
meta: /run/kvmd/otg
product: PiKVM Composite Device
product_id: 260
remote_wakeup: true
serial: CAFEBABE
udc: ''
usb_version: 512
user: kvmd
vendor_id: 7531
otgnet:
commands:
ip_cmd:
- /usr/bin/ip
iptables_cmd:
- /usr/sbin/iptables
- --wait=5
post_start_cmd:
- /usr/bin/systemd-run
- --unit=kvmd-otgnet-dnsmasq
- /usr/sbin/dnsmasq
- --conf-file=/dev/null
- --pid-file
- --user=dnsmasq
- --interface={iface}
- --port=0
- --dhcp-range={dhcp_ip_begin},{dhcp_ip_end},24h
- --dhcp-leasefile=/run/kvmd/dnsmasq.lease
- --dhcp-option={dhcp_option_3}
- --dhcp-option=6
- --keep-in-foreground
post_start_cmd_append: []
post_start_cmd_remove: []
post_stop_cmd:
- /bin/true
- post-stop
post_stop_cmd_append: []
post_stop_cmd_remove: []
pre_start_cmd:
- /bin/true
- pre-start
pre_start_cmd_append: []
pre_start_cmd_remove: []
pre_stop_cmd:
- /usr/bin/systemctl
- stop
- kvmd-otgnet-dnsmasq
pre_stop_cmd_append: []
pre_stop_cmd_remove: []
sysctl_cmd:
- /usr/sbin/sysctl
firewall:
allow_icmp: true
allow_tcp: []
allow_udp:
- 67
forward_iface: ''
iface:
net: 172.30.30.0/24
pst:
remount_cmd:
- /usr/bin/sudo
- --non-interactive
- /usr/bin/kvmd-helper-pst-remount
- '{mode}'
ro_cleanup_delay: 3.0
ro_retries_delay: 10.0
server:
access_log_format: '[%P / %{X-Real-IP}i] ''%r'' => %s; size=%b --- referer=''%{Referer}i''; user_agent=''%{User-Agent}i'''
heartbeat: 15.0
unix: /run/kvmd/pst.sock
unix_mode: 432
unix_rm: true
vnc:
auth:
vencrypt:
enabled: true
vncauth:
enabled: false
file: /etc/kvmd/vncpasswd
desired_fps: 30
keymap: /usr/share/kvmd/keymaps/en-us
kvmd:
timeout: 5.0
unix: /run/kvmd/kvmd.sock
memsink:
h264:
drop_same_frames: 0.0
lock_timeout: 1.0
# sink: ''
sink: kvmd::ustreamer::h264
wait_timeout: 1.0
jpeg:
drop_same_frames: 1.0
lock_timeout: 1.0
# sink: ''
sink: kvmd::ustreamer::jpeg
wait_timeout: 1.0
mouse_output: usb
scroll_rate: 4
server:
host: ''
keepalive:
count: 3
enabled: true
idle: 10
interval: 3
max_clients: 10
no_delay: true
port: 5900
tls:
ciphers: ALL:@SECLEVEL=0
timeout: 30.0
x509:
cert: /etc/kvmd/vnc/ssl/server.crt
key: /etc/kvmd/vnc/ssl/server.key
streamer:
timeout: 5.0
unix: /run/kvmd/ustreamer.sock
watchdog:
interval: 30
rtc: 0
timeout: 300
[root@kvm-pve01 ~]#