-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Configuring the Raspberry Pi
The latest versions of electron use an extreme amount of CPU power when no Open GL driver is loaded. This will result in an overheating Raspberry Pi. To solve this issue, use the experimental desktop Open GL driver by adding the following line to /boot/config.txt:
EDIT: this no longer seems necessary since Raspbian Buster, lines are already included
sudo nano /boot/config.txt
Add the following line:
dtoverlay=vc4-kms-v3d
ℹ️ Activating the Open GL drive can also be accomplished by using the raspi-config tool by running sudo raspi-config. Go to the Advanced Options menu and select A7 GL Driver. Next, select the G3 GL (Full KMS) OpenGL desktop driver with full KMS. Note that this option will be selected in the menu even when the GL drive is not yet configured.
Unfortunately, as a result, the display_rotate=1 (see below) won't have any effect on the display. If you want to rotate the display when the Open GL driver is in use, we need to use the xrandr tool which allows us to rotate the display when in desktop mode. To do so, edit the autostart file: (autostart file has been moved in the latest version of Raspbian Stretch, Version: April 2019, Release Date: 2019-04-08 Kernel: 4.14 to /etc/xdg/lxsession/LXDE-pi/autostart ):
nano ~/.config/lxsession/LXDE-pi/autostart
And add the following line:
@xrandr --output HDMI-1 --rotate right
If the above doesn't work after a reboot, run raspi-config. Under Advanced Options go to Wayland and change to X11 and reboot.
ℹ️ As was mentioned in the forums you can also use the fake kms driver instead.
EDIT 03JAN20: fkms + screen rotation using display_rotate no longer seems to work, but kms method still does
And add the following line to /boot/config.txt:
dtoverlay=vc4-fkms-v3d
With the fake KMS you can rotate the display from /boot/config.txt (see below)
ℹ️ If you want to rotate the display the other direction, please use: @xrandr --output HDMI-1 --rotate left
After the desktop has finished booting, the display will rotate.
edit /boot/config.txt:
sudo nano /boot/config.txt
Add the following line:
display_rotate=1
avoid_warnings=1
#display_rotate=0 Normal
#display_rotate=1 90 degrees
#display_rotate=2 180 degrees
#NOTE: You can rotate both the image and touch interface 180º by entering lcd_rotate=2 instead`
#display_rotate=3 270 degrees
Then reboot the pi:
sudo reboot
Install unclutter:
sudo apt-get install unclutter
You can create an .xinitrc script to run the tool.
See https://wiki.archlinux.org/index.php/Unclutter
But a simpler option is to add a line to the end of the file:
$ nano ~/.config/lxsession/LXDE-pi/autostart
...
@unclutter -display :0 -idle 3 -root -noeventsThis will add a 3 second delay, before the pointer disappears from the screen when not using it.
version 1 only
(Please note, you will need the x11-xserver-utils package installed.)
edit /etc/xdg/lxsession/LXDE-pi/autostart:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add the following lines:
@xset s noblank
@xset s off
@xset -dpms
Edit /etc/lightdm/lightdm.conf:
sudo nano /etc/lightdm/lightdm.conf
Add the following line below [SeatDefaults] (Please note, you may need to add the [SeatDefaults] section.)
xserver-command=X -s 0 -dpms
Edit /etc/modprobe.d/8192cu.conf
sudo nano /etc/modprobe.d/8192cu.confAdd the following lines
# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1For Raspberry Pi OS 12 & newer
ie. for OS versions released after Oct. 2023, based on Debain 12 'Bookworm' and newer, and other systems using NetworkManager.
Create /etc/NetworkManager/conf.d/powersave.conf
sudo nano /etc/NetworkManager/conf.d/powersave.confAdd the following lines
[connection]
wifi.powersave=2
Reboot your PI
sudo rebootFor Raspberry Pi 3 (Jesse and below)
Edit /etc/network/interfaces
sudo nano /etc/network/interfacesAdd the following line under the wlan0 section
wireless-power offReboot your PI
sudo rebootFor RPi 3 (Raspbian Stretch)
We no longer have any default entries in /etc/network/interfaces, instead we make a plugin to the (service) startup script. Copy paste the following into your terminal:
cat << EOF | sudo tee /etc/network/if-up.d/off-power-manager
#!/bin/sh
# off-power-manager - Disable the internal power manager of the (built-in) wlan0 device
# Added by MagicMirrorSetup
iw dev wlan0 set power_save off
EOFThen set the permissions and reload the network daemon.
sudo chmod 755 /etc/network/if-up.d/off-power-manager
sudo /etc/init.d/networking restartYou don't need to reboot for this to take effect, but do it anyway to make sure it works. After reboot and your wifi is back up, test with:
iw dev wlan0 get power_saveInstall Netatalk:
sudo apt-get install netatalk
Install x11vnc:
sudo apt-get install x11vnc
Set VNC password:
x11vnc -storepasswd
Create an auto-start file:
cd ~/.config
mkdir autostart
cd autostart
nano x11vnc.desktop
Add the following lines:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false