Skip to content

1. How to Install?

Taichi FURUHASHI edited this page Oct 9, 2024 · 37 revisions

0. Installing RaspberryPi OS

Hardware

Software

  • RaspberryPi OS LITE(64-bit) for RaspberryPI 4
  • RaspberryPi OS LITE(64-bit) for RaspberryPI 5

0-1. Get RaspberryPi OS Imager

You can download RaspberryPi OS Imager from here.

https://www.raspberrypi.com/software/

0-2. Insert your SDCard on your PC

We recommend, over 128GB storage size.

0-3. Run your RaspberryPi OS Imager

When you run a RaspberryPi OS Imager, Please select your type of device(RaspberryPi 4 or RaspberryPi 5). OS Type is "RaspberryPi OS LITE(64-bit)". and storage means your SDcard drive.

  • Raspberry Pi Device: "RASPBERRY PI 4" or "RASPBERRY PI 4"
  • Operating System: "RASPBERRY PI OS LITE(64-bit)"
  • Storage: << Choose your SDcard drive >>

Then, click NEXT button.

スクリーンショット 2024-10-09 2 34 13

0-4. Run your RaspberryPi OS Imager

Click EDIT SETTINGS button.

スクリーンショット 2024-10-09 2 21 38

0-5. Setting for your Wi-Fi environment

  • Host name: unvtportable .local If there are multiple devices, prefix the host name with the two-digit aircraft ID. Example: unvtportable01
  • User name: unvt
  • Password: unvt or you can modify any password
  • Wi-Fi Settings: depends on your environment
  • Locale Settings: depends on your remote PC and Language

Then, click SAVE button.

スクリーンショット 2024-10-09 2 34 13

0-6. Installing RaspberryPi OS

Click YES button.

スクリーンショット 2024-10-09 2 21 38

Click YES button again.

185190149-0dc074e1-b667-4ddc-a38c-1d1366421743

Please wait a moment...

スクリーンショット 2024-10-09 3 20 53

You can remove SDcard. After that, you should insert it into the RaspberryPi device.

raspberry-pi-imager-write-done

0-7. Turn on your RaspberryPi device

Connect USB-C cable for Power, Automatically your RaspberryPi device will start.

スクリーンショット 2024-10-09 3 20 53

1. SSH Login

ssh unvt@raspberrypi.local

If you cannot log in with ssh, delete the old host key and set the host key again.

ssh-keygen -R unvtportable.local

2. Installing nginx

apt update

sudo apt update -y
sudo apt install nginx
sudo systemctl status nginx

nginx Star/Stop/Restart

  • Start: sudo systemctl start nginx
  • Stop: sudo systemctl stop nginx
  • ReStart: sudo systemctl restart nginx
hostname -I

unvt@unvtportable:~ $ hostname -I 10.0.4.10

unvt@unvtportable:~ $ hostname -I 192.168.137.48

Access IP addresshttp://x.x.x.x/ with a web browser to check operation

スクリーンショット 2024-10-03 14 46 11

3. Wi-Fi Access Point Setting with NetworkManager

Modify the NetworkManager.conf file using the nano editor to allow NetworkManager to manage the Wi-Fi interface. It is important to set managed=true.

sudo nano /etc/NetworkManager/NetworkManager.conf
スクリーンショット 2024-10-03 14 52 48

Delete the [main][ifupdown] part by pressing Ctrl + k key, paste the following, and overwrite the file (press Ctrl + s to save, Ctrl + x to exit).

[main]
plugins=ifupdown,keyfile
dhcp=internal

[ifupdown]
managed=true
スクリーンショット 2024-10-03 14 53 54

Reboot Raspberry Pi to reflect settings

sudo reboot

<<< Please wait a few minutes for a Wi-Fi connection >>>

Login to the Raspberry Pi again via ssh

ssh unvt@unvtportable.local

Create a new access point profile

  • Default SSID: UNVTportable
  • Default Password: UNVTportable

When testing with multiple units, add a suffix as follows

  • SSID: UNVTportable0x
  • Default Password: UNVTportable
sudo nmcli dev wifi hotspot ifname wlan0 ssid UNVTportable band bg password UNVTportable
sudo nmcli dev wifi hotspot ifname wlan0 ssid UNVTportable0x band bg password UNVTportable

After a while, the RaspberryPi automatically switches Wi-Fi access point and the ssh connection is interrupted. 2-3 minutes of coffee time.

Connect to "UNVTportable" to a new Wi-Fi access point

When UNVTportable appears at the Wi-Fi access point, connect using the password UNVTportable.

スクリーンショット 2024-10-03 15 09 41

ssh connection again

ssh unvt@unvtportable.local

Reconfirm IP address

hostname -I

unvt@unvtportable:~ $ hostname -I 10.42.0.1

IP address was 10.0.4.10 earlier changed to 10.42.0.1. Access http://10.42.0.1/ with a web browser to check the operation.

スクリーンショット 2024-10-03 15 22 00

Access point auto-activation settings

sudo nmcli connection modify Hotspot autoconnect yes

4. Change access permissions for file transfers

Check current /var/www/html access permissions

The owner is root account.

ls -ld /var/www/html

unvt@unvtportable:~ $ ls -ld /var/www/html drwxr-xr-x 2 root root 4096 Oct 3 14:41 /var/www/html

Change access privileges to unvt account and unvt group -R option makes owner privileges recursively unvt even under html files.

sudo chown -R unvt:unvt /var/www/html

unvt@unvtportable:~ $ ls -ld /var/www/html drwxr-xr-x 2 unvt unvt 4096 Oct 3 14:41 /var/www/html

Confirm that access rights have been properly changed from root to the unvt account.

5. Data transfer by scp command

Data for transfer can be downloaded here.

https://github.com/mapconcierge/unvtportable2024dataset4test

Prepare a set of MapLibre-related files/folders on your local machine

  • index.html
  • main.js
  • maplibre-gl.css
  • maplibre-gl.js
  • pmtiles.js
  • style.css
  • data/
  • zxy/

Thank you for template files by @asahina820

Update this conceptual diagram for data placement rules https://github.com/unvt/portable/wiki/2.-How-to-use

image

Data transfer from local machine side by scp command

In the local machine's terminal, move the current directory to the path of the MapLibre-related files.

cd [dataset's path]

スクリーンショット 2024-10-03 16 19 07

Don't forget to include the -r option for the scp command and upload

scp -r . unvt@unvtportable.local:/var/www/html/
taichi@MacBookProM1Pro2021 html % scp -r . unvt@unvtportable.local:/var/www/html/
unvt@unvtportable.local's password: 
maplibre-gl.js                                                                                  100% 1142KB   2.9MB/s   00:00    
._maplibre-gl.js                                                                                100% 4096   283.5KB/s   00:00    
._index.html                                                                                    100% 4096   683.6KB/s   00:00    
style.json                                                                                      100%   79KB   1.6MB/s   00:00

Thus, data transfer at once. Time for a cup of coffee.

Map display after data transfer is complete.

If you access http://10.42.0.1/ in a web browser, you should see a MapLibre GL map.

image