MoodleBox一開始就是設定在Raspberry Pi 3上執行運作,讓使用者可以隨身帶著一個Raspberry Pi 3及行動電源就可以使用Moodle教學平台,MoodleBox官網有做動的img檔可供使用者下載,然後燒錄到Raspberry Pi 3,或者可以透過手動建置的方式,在剛開始官方所提供的是一步一步的指令去修改設定,接著又轉換成使用script自動安裝(github中切換到),現在則改用Ansbile自動化組態管理把Moodle安裝到Raspberry Pi 3中。
在官方的Github中有以下10點的安裝步驟
To build a MoodleBox from scratch with this script, you need a Raspberri Pi 3 (Wi-Fi!) and follow these instructions.
Clone Rasbpian Stretch Lite on your microSD card.
Create asshfile on thebootpartition, e.g. usingtouch ssh
Insert the microSD card into your Raspberry
Connect your Raspberry to your Ethernet network and boot it.
on your computer.
to your local drive.
Create akeysdirectory in the repository folder and copy your public key into it, under the nameid_rsa.pub.
Get the IP address of your RaspberryPi and change it in thehosts.ymlfile. Do not change anything else, unless you know what you're doing. You're on your own.
Runansible-playbook moodlebox.ymlfrom the repository folder.
Wait 30–50 minutes, depending on your SD card and Internet bandwidth. You're done.
因為目前是要使用MoodleBox安裝在BananaPi M64上,而官方是預設安裝於Raspberry Pi 3上所部分安裝內容會不同,以下我們依順說明
1. Clone Rasbpian Stretch Lite on your microSD card.
2. Create a ssh file on thebootpartition, e.g. using touch ssh
3. Insert the microSD card into your Raspberry
IMG檔燒錄完成後,接著就是把microSD卡插入設備的microSD插槽,Raspberry Pi 3和Banana Pi M64這兩台設備的使用方式有點不用,Raspberry Pi 3直接把microSD卡推到最底就可以,取出的方式是直接拔出microSD,而Banana Pi M64的插槽有自動彈回的功能,所以在microSD卡推到最底時,還要再用力按壓一下,會自動卡住,而取出的時後,也是要再按壓一下後會自動彈回,再拔出microSD卡即可。
4. Connect your Raspberry to your Ethernet network and boot it
Raspberry Pi 3及Banana Pi M64都內建RJ-45網路介面,這個步驟只要把網路線線上,及插上電源,會自動開機。
allen-mba:~ allen$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/allen/.ssh/id_rsa):
Created directory '/Users/allen/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/allen/.ssh/id_rsa.
Your public key has been saved in /Users/allen/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:nCpzaCPq6waI3KTpm0sq+Yfoxku/ENVcL2gKX2ZLJrE allen@allen-mba.local
The key's randomart image is:
+---[RSA 2048]----+
| . . |
| = o . |
| . E @ . . |
| +.X .... |
|+.=o . S |
|++.. . . |
|+*..* o |
|B*=o.= |
|X@*+. |
+----[SHA256]-----+
allen-mba:~ allen$ cp ~/.ssh/id_rsa.pub ~/github/moodlebox-bpi/keys/
allen-mba:~ allen$ ls ~/github/moodlebox-bpi/keys/
id_rsa.pub
8. Get the IP address of your RaspberryPi and change it in thehosts.ymlfile. Do not change anything else, unless you know what you're doing. You're on your own.
allen-mba:~ allen$ ssh pi@raspberrypi.local
The authenticity of host 'raspberrypi.local (fe80::5f74:cb72:5324:c40b%en0)' can't be established.
ECDSA key fingerprint is SHA256:rvM07WHr9gcI+KOY1sr7+m3IpvakmgMRnpGt6tP2i8w.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'raspberrypi.local,fe80::5f74:cb72:5324:c40b%en0' (ECDSA) to the list of known hosts.
pi@raspberrypi.local's password:
Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Mar 7 09:23:27 2018
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
allen-mba:~ allen$ ssh pi@bpi-iot-ros-ai.local
The authenticity of host 'bpi-iot-ros-ai.local (fe80::84e0:eaff:fef2:36e2%en0)' can't be established.
ECDSA key fingerprint is SHA256:5sZdACIsvP5cxP3bob+z563JmKelc5liBZfAz89eGHM.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bpi-iot-ros-ai.local,fe80::84e0:eaff:fef2:36e2%en0' (ECDSA) to the list of known hosts.
pi@bpi-iot-ros-ai.local's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 3.10.105-BPI-M64-Kernel aarch64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
116 packages can be updated.
0 updates are security updates.
*** System restart required ***
Last login: Sat Oct 21 16:21:23 2017 from 192.168.88.162
如果要ssh到安裝好的MoodleBox時,連線的網址會不同,被修改成moodlebox開頭,另外在未連MoodleBox的wifi時,都要用[「moodlebox.local」,連wifi後的網址後面原本在Raspberry Pi 3原本是用「.home」而Banana PI M64修改成「.bpi」,連線網址及帳號密碼,請參照下方的對照表
連線網址對照表
設備連線網址
官方預設值
安裝MoodleBox
連moodlebox wifi後
Raspberry Pi 3
raspberrypi.local
moodlebox.local
moodlebox.home
Banana Pi M64
bpi-iot-ros-ai.local
moodlebox.local
moodlebox.bpi
連線的帳號密碼對照表
設備連線帳號 / 密碼
官方預設值
安裝MoodleBox
Raspberry Pi 3
pi / raspberry
moodlebox / Moodlebox4$
Banana Pi M64
pi / bananapi
moodlebox / Moodlebox4$
連線後的畫面會多一個樹梅派的logo,正常連線後會看到如下圖的畫面
在Raspberry Pi 3的話就是直接到官方網站下載(),這邊要改用Banana Pi M64所以要到BananaPi官方網站下載(),目前測試使用ubuntu作業系統,如下圖官網上列出最新的為「BPI-M64 new image:2017-08-14-ubuntu-16.04-mate-......」開頭的檔案,但使用後會有些問題,最後在Gitbook中找到,有新的版本「」,2018-01-05這個版本在燒錄好開機後就有ssh可以連線,下載完後Mac作業系統可以使用軟體燒錄到sd卡中,Windows作業系統可以使用燒錄。
此動作在Raspberry Pi 3,燒到sd卡後,要先執行指令「touch ssh」產生ssh檔案開機後會啟動ssh服務,而在BananaPi M64燒錄「」此版本,開機就有啟動ssh服務,所以可以跳過此步驟。
5. on your computer.
目前Ansible測試於Mac系統,請參考 的安裝步驟
6. to your local drive.
在本機電腦中安裝好Ansible後,接著就是從GitHub上Clone Repository(復製儲存庫),moodlebox官方的github網址「」,git的網址「」,如果安裝於Raspberry Pi 3請直接clone官方的設定檔即可,要注意的就是記得使用,因為Ansible自動化配置文件是依raspbian作業系統所撰寫的,要直接安裝於Banana Pi M64是不能使用的,所以這邊有另外依Banana Pi M64上的「」作業系統客製一個版本,目前也是放在github上,所以執行的方式是相同的,只是git網址要修改成「」