Skip to content

標籤: Raspberry Pi

使用UxPlay來讓你的樹莓派 Raspberry Pi變成AirPlay伺服器

自從家裡添置了一台自組的Synology NAS之後,由於是7×24小時的開啟,而且又支援Docker,所以把所有的服務都往裡面丟,包括Web server、pi hole、home assistant之類等等。

想起以前購買下來的Raspberry Pi都沒在使用,好像有點浪費。早前把手上算力最低的Raspberry Pi 2B安裝了Openwrt作DHCP服務器使用。這陣子又找到了可以讓積塵已久的Raspberry Pi們發光發亮的用處,就是AirPlay Server!

由於解碼影片和音效需要一定的CPU算力,所以使用手上算力最高的Raspberry Pi 4B (64 bit)。因為要顯示畫面,所以這次就使用了官方的Raspberry Pi OS的Desktop版本。那燒錄OS的部分這邊就不再重覆了,網絡上有很多相關的文章或影片。

來說說今天使用的軟件,UxPlay 是一款適用於 Linux、macOS 和 BSD 的開源 AirPlay 2 鏡像伺服器,最初由 antimof 開發,支援從 iOS、iPadOS 和 macOS 設備進行螢幕鏡像和音頻串流至主機顯示器,並使用 GStreamer 進行渲染。接下來簡單說明一下安裝方法…

把VNC設置成開機服務(Jessie)

此文章用於把VNC設置成開機服務。

1. Install Tight VNC server:

sudo apt-get install tightvncserver

2. Start it manually and enter new VNC password.

vncserver :1

3. Create a new file /etc/systemd/system/vncserver@.service

4. (Optional) Replace the parameters in the unit file, if you want to.

5. Run

sudo systemctl daemon-reload && sudo systemctl enable vncserver@1.service

6. Reboot.

以下是/etc/systemd/system/vncserver@.service的內容:

開機自動運行VNC程式(Jessie)

此文章用於把VNC設置成開機啟動,如此方法不行,則可以參考另一篇設置成開機服務的文章。

  1. Install the VNC server.
    sudo apt-get install tightvncserver
  2. Launch vncserver for the first time to set up a password.
    vncserver :1
  3. Create a file as /etc/init.d/vncserver (be sure to modify the USER, GEOMETRY, NAME, etc.)
  4. sudo chmod +x /etc/init.d/vncserver
  5. sudo update-rc.d vncserver defaults

以下是/etc/init.d/vncserver的內容:

讓Raspberry Pi成為你的電腦開關伺服器

Note: This post and the accompanying software packages have been updated several times since this was originally posted. The most up-to-date releases and instructions can always be found in the GitHub Repo.

I have a very power hungry desktop computer that I use for video editing and large file storage. When I’m travelling with my laptop, I obviously can’t carry all my files and data with me, so I occasionally use “remote desktop” to access my desktop from the road. I also use a Plex Media Server to stream content from my desktop computer. However, the computer has to be on for me to be able to do this. This means I need to leave the computer on all the time, just in case I need to access it. This wastes power, costs me money, and harms the environment. My Raspberry Pi, on the other hand, consumes a minuscule amount of power, and is always on anyways, serving other purposes. In this tutorial, I’ll show you how to run a simple mobile-friendly website from your Raspberry Pi that will allow you to remotely wake up your power-hungry computer, so you can remotely access it. When you’re done, just put it back to sleep from within the remote desktop service (or use the mobile app plus a small background server running on your desktop to put it back to sleep – this is described in the instructions). The app pings the computer from the Raspberry Pi to inform you of when the computer has woken up and established network connectivity. Follow along after the break…