RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
565 stars 206 forks source link

Use wayvnc system service, take two #230

Closed any1 closed 8 months ago

any1 commented 8 months ago

This re-applies #226 and adds a version check.

The wayvnc-control package is no longer needed. Everything has been merged into the wayvnc package. I have tested that this works with the wayvnc debian package built from my pios branch: https://github.com/any1/wayvnc/tree/pios

I do not recommend merging this until you have tested and released the v0.8-rc0 wayvnc package.

lgeitner commented 8 months ago

I would like to test your configuration to run wayvnc as a service and the control scripts you have created on my Raspberry PI 5. What would be the best way to test your changes on a fresh install of Raspberry PI 64 Bit OS on the Raspberry PI 5?

Thanks.

any1 commented 8 months ago

I would like to test your configuration to run wayvnc as a service and the control scripts you have created on my Raspberry PI 5. What would be the best way to test your changes on a fresh install of Raspberry PI 64 Bit OS on the Raspberry PI 5?

Well, if you're keen, you can build the packages using dpkg-buildpackage. and install using dpkg --install. For building you might need to install build dependencies first. That can be achieved using apt build-dep wayvnc

lgeitner commented 8 months ago

Here are the steps I took to Test Running Way VNC as a service for the bookworm release.

  1. Using raspberry pi imager install the file 2023-12-05-raspios-bookworm-arm64.img.xz onto a microsd card
  2. Boot Raspberry PI 5
  3. sudo apt update
  4. sudo apt upgrade -y
  5. sudo reboot ; probably not neccessary
  6. sudo apt install libjansson-dev ;recieved an error message without this installed
  7. sudo nano /etc/apt/sources.list uncomment last three lines save file
  8. sudo apt update
  9. sudo apt build-dep wayvnc 10.git clone -b pios https://github.com/any1/wayvnc.git 11.cd wayvnc 12.dpkg-buildpackage
  10. cd ..
  11. sudo dpkg --install wayvnc_0.8.0-rc0-1_arm64.deb
  12. sudo reboot
  13. sudo raspi-config select item 3 select VNC select Yes
  14. sudo reboot

I am initally able to connect to the computer using realvnc. However when I logout of the pi and try to reconnect to realvnc I recieve the below error:

RealVNC Viewer

"The connection was refused by the computer"

When I reboot the pi I can reconnect to the pi through vnc viewer.

Also, I have a 4 port KVM that I have the Raspberry pi 5 connected to. When I switch to another computer on the KVM and then try to use realvnc to connect to the computer I recieve the below error:

RealVNC Viewer

"The connection was refused by the computer"

It seems that perhaps wayvnc is not running as a service?

I did recieve some warnings while running the dbkg-buildpackage

dpkg-buildpackage: info: source package wayvnc dpkg-buildpackage: info: source version 0.8.0-rc0-1 dpkg-buildpackage: info: source distribution bookworm dpkg-buildpackage: info: source changed by Andri Yngvason andri@yngvason.is dpkg-buildpackage: info: host architecture arm64 dpkg-source --before-build . debian/rules clean dh clean dh_clean dpkg-source -b . dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1) dpkg-source: info: using source format '1.0' dpkg-source: warning: native package version may not have a revision dpkg-source: warning: source directory 'wayvnc' is not - 'wayvnc-0.8.0-rc0' dpkg-source: info: building wayvnc in wayvnc_0.8.0-rc0-1.tar.gz dpkg-source: info: building wayvnc in wayvnc_0.8.0-rc0-1.dsc debian/rules binary dh binary dh_update_autotools_config dh_autoreconf dh_auto_configure cd obj-aarch64-linux-gnu && LC_ALL=C.UTF-8 meson setup .. --wrap-mode=nodownload --buildtype=plain --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=lib/aarch64-linux-gnu The Meson build system Version: 1.0.1 Source dir: /home/pi/wayvnc Build dir: /home/pi/wayvnc/obj-aarch64-linux-gnu Build type: native build Project name: wayvnc Project version: 0.8-rc0 C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0") C linker for the host machine: cc ld.bfd 2.40 Host machine cpu family: aarch64 Host machine cpu: aarch64 Program git found: YES (/usr/bin/git) WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 Library m found: YES Library rt found: YES

...

../src/output-management.c:98:16: warning: unused variable ‘scale’ [-Wunused-variable] 98 | double scale = wl_fixed_to_double(scale_f); | ^~~~~

...

spl237 commented 8 months ago

Merged - many thanks

natehsu commented 8 months ago

Hello, I have updated to the latest raspi-config via apt and also encountered the error message with realvnc mentioned by lgeitner: "The connection was refused by the computer". My condition for reproducing this issue is by switching the monitor input from PC to raspberry pi 5. Additionally, when I use the command 'netstat -tlpn' to check, I no longer see the wayvnc 5900 port."

many thanks!

lgeitner commented 8 months ago

I have also updated to the latest raspi-config with the following commands:

sudo apt update sudo apt full-upgrade -y sudo reboot

I then ran Raspi-Config

sudo raspi-config

I disabled VNC server exited raspi-config then

sudo reboot

I then ran Raspi-Config again.

sudo raspi-config

I re-enabled VNC Server exited raspi-config then

sudo reboot

When I switch to a different Raspberry PI on my KVM and then switch back wayvnc is no longer running. Also, when I signout of the raspberry pi through realvnc on my desktop computer and then try to sign back into the raspberry pi, wayvnc is no longer running.

wayvnc does not seem to be running as a service.

I still receive "The connection was refused by the computer"

lgeitner commented 7 months ago

natehsu,

I found the following post https://forums.raspberrypi.com/viewtopic.php?p=2146832&hilit=waggle+hotplug#p2146832

which says to add one of the following lines to /boot/firmware/cmdline.txt (on an existing line)

"vc4.force_hotplug=1" if using HDMI0 "vc4.force_hotplug=2" if using HDMI1 "vc4.force_hotplug=3" if using HDMI 0 and 1 to cmdline.txt (on existing line) will stop the kernel from seeing this hotplug waggle and might avoid the issue.

In my case, I am only using HDMI0 so I added vc4.force_hotplug=1 to the end of my existing line in cmdline.txt. then sudo reboot

I have tested switching back and forth between my four different Pis on my KVM and the wayvnc process is still running. I am able to VNC into either of my two Raspberry PI 5 on my KVM.
Also, If I turn off the montior on the KVM and then back on the wayvnc process is still running on both Raspberry PI 5.

I did not test if this would also resolve the issue where you log out of the Raspberry PI 5 and then try to connect back to the Raspberry PI 5 through VNC to sign in as a different user.

This seems to be a good temporary fix with the wayvnc issue (at least with a KVM) until the raspi-config utility correctly configures wayvnc to run as a service.

Lance