HOME INDEX

What is Mobile Wi-Fi NAS?





This device is



After inserting the USB memory (you can insert it later),



When you plug in the power cable (also USB), it will start up (it takes about 20 seconds),



This device itself becomes a local Wi-Fi spot and starts broadcasting radio waves, so you can connect to it from your computer,

WPA2-PSK
SSID=yaspberry
PASS=1qazxsw2



If you access the following in your browser,USBYou can read and write directly to the memory.
http://yaspberry.nas/

(If the USB memory has a volume label written on it, the volume label will be displayed, but if not, just "Volume" will be displayed.
USB memory and USB-SSDs will work fine when powered by a PC's USB port, but USB-HDDs may not be recognized due to insufficient power unless they are powered by a smartphone charger or similar.
The image below is a screenshot of when a USB memory stick with the volume label "USBMEM" is inserted.


admin
tamosan2007pe






In other words, you can access it via Wi-Fi without inserting the USB memory into a USB port.
Anyone having trouble with Skysea?

Once you have finished reading and writing, remove the USB memory.


Automatic shutdown will begin after 5 seconds, and will be complete when the light goes out.


This is "Mobile Wi-Fi NAS".






What you need


Total cost: 4,840 yen


・RaspberryPi Zero 2 W
¥3,400
Main unit
1 unit


・Micro SD card (16GB or more, Class 10 or higher)
¥700
OS installation media
SanDiskketc.


・microSD card reader
¥100
For OS installation work
1 piece


・micro USB cable
¥100
For power supply (connected to laptop PC)
1 piece







・USB-OTG cable (USB-A female ←→ micro USB male)
¥240
For connecting storage/keyboard/mouse
1 piece







・Mini HDMI to HDMI conversion adapter
¥300
For connecting a monitor
1 piece





・USB memory or USB-SSD
Storage
Any capacity
exFAT recommended



・Monitor + HDMI cable
・USB keyboard
・USB mouse
・Notebook PC (Windows 11)
For setup
1 unit
・Internet environment (Wi-Fi)
For download installation
SSID: ipadtest, PASS: 1qazxsw2



How to make it


1. Burn Raspberry PiOS to an SD card (on a PC)


1.Install RaspberryPiImager
https://www.raspberrypi.com/software/ Download from
imager_1.9.6.exe

2.Insert the SD card into your PC

3.Start Imager

4.OS selection
device: Raspberry Pi Zero 2 W
OS: Raspberry Pi OS(32-bit)
※If you choose anything other than this, you will get addicted.













5.Write to SD card
Hostname: raspberrypi SSHEnable: Enabled (password authentication)
Username: pi
password: raspberry
Work Wi-Fi: SSID=ipadtest
PASS=1qazxsw2
country: JP











Start writing





②Start RaspberryPiZero2W for the first time


1. Insert the SD card into the Raspberry Pi Zero 2W.
2. The RaspberryPiZero2W will start up when you plug in the power supply cable.
It will automatically connect to the work Wi-Fi, obtain an IP address via DHCP, and be able to use the Internet.
*If the power supply is weak, the Wi-Fi connection becomes unstable/SSH is disconnected due to heavy processing There are various weak points, so until it is complete, you should power it from a high-capacity charger and connect a monitor, keyboard, and mouse to complete the setup.





③ Install basic updates and tools

sudo apt update
sudo apt upgrade -y
sudo apt install -y git
sudo apt install -y unzip
sudo apt install -y curl
sudo apt install -y wget
sudo apt install -y net-tools
sudo apt install -y dnsmasq
sudo apt install -y hostapd
sudo apt install -y samba

④ Automatic mount/unmount control for USB storage

*In GUI OS, it is automatically mounted to /media/pi/xxx, so we decided to use that function as is.

Insert the USB memory once (this is the first time the /media/pi folder is created)
sudo chmod 755 /media/pi

⑤ Install "File Browser" which functions as a web filer.

curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash

sudo mkdir -p /etc/filebrowser
sudo filebrowser -d /etc/filebrowser/filebrowser.db config init
sudo filebrowser -d /etc/filebrowser/filebrowser.db users add admin tamosan2007pe --perm.admin
sudo filebrowser -d /etc/filebrowser/filebrowser.db config set --root /media/pi
sudo filebrowser -d /etc/filebrowser/filebrowser.db config set --address 0.0.0.0
sudo filebrowser -d /etc/filebrowser/filebrowser.db config set --port 80

sudo vi /etc/systemd/system/filebrowser.service
[Unit]
Description=File Browser
After=network.target

[Service]
ExecStart=/usr/local/bin/filebrowser -d /etc/filebrowser/filebrowser.db
Restart=always

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reexec
sudo systemctl enable --now filebrowser
sudo systemctl status filebrowser
*At this point, open a browser on your PC and confirm that you can access http://IP assigned by your work Wi-Fi (look up how to find out)/admin/tamosan2007pe.

⑥ Turn your Raspberry Pi Zero 2 W into a local Wi-Fi spot

This Wi-Fi spot will have a fixed address of 192.168.4.1, but connecting PCs will be automatically assigned an IP address between 192.168.4.10 and 192.168.4.50 via DHCP, and will also have DNS functionality so that PCs can access it via the FQDN yaspberry.nas instead of the IP address, i.e., http://yaspberry.nas/.

*After this, you will not be able to connect to the Internet, so if you realize you forgot to enter it, start over from the beginning.
1.Static IP Settings
sudo vi /usr/local/bin/wlan0_ap_setup.sh
#!/bin/bash
ip addr add 192.168.4.1/24 dev wlan0
ip link set wlan0 up

sudo chmod +x /usr/local/bin/wlan0_ap_setup.sh

sudo vi /etc/systemd/system/wlan0_ap.service
[Unit]
Description=Set static IP and bring up wlan0 as AP mode
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/wlan0_ap_setup.sh

[Install]
WantedBy=multi-user.target


sudo systemctl daemon-reload
sudo systemctl enable --now wlan0_ap.service
sudo systemctl status wlan0_ap.service



2.hostapdsetting
sudo vi /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=yaspberry
hw_mode=g
channel=6
wmm_enabled=0
auth_algs=1
wpa=2
wpa_passphrase=1qazxsw2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

sudo vi /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"

sudo systemctl unmask hostapd
sudo systemctl enable --now hostapd dnsmasq

sudo vi /lib/systemd/system/hostapd.service
[Unit]
After=wlan0_ap.service
Wants=wlan0_ap.service



3.dnsmasqsetting
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.org
sudo vi /etc/dnsmasq.conf
interface=wlan0
dhcp-range=192.168.4.10, 192.168.4.50, 255.255.255.0, 24h
dhcp-option=6, 192.168.4.1
address=/yaspberry.nas/192.168.4.1

sudo vi /lib/systemd/system/dnsmasq.service
[Unit]
After=hostapd.service
Wants=hostapd.service


⑦ Create a mechanism to automatically shut down when the USB memory is removed

sudo vi /usr/local/bin/usb-remove-shutdown.sh
#!/bin/bash
logger "USB device removed. Shutting down in 5 seconds..."
sleep 5
/sbin/shutdown -h now

sudo chmod +x /usr/local/bin/usb-remove-shutdown.sh

sudo vi /etc/udev/rules.d/99-usb-remove-shutdown.rules
ACTION=="remove", SUBSYSTEM=="block", ENV{ID_USB_DRIVER}=="usb-storage", ENV{ID_TYPE}=="disk", RUN+="/usr/local/bin/usb-remove-shutdown.sh"

sudo udevadm control --reload-rules

(insert USB memory)sudo reboot

⑧ Operation check (connect to Wi-Fi from a Windows notebook and access the File Browser)


1.Wifi (SSID=yaspberry PASS=1qazxsw2)

2.Open the following in your browser:
http://yaspberry.nas/

3.Log in below
admin
tamosan2007pe

4.Read and write access to USB memory.

[Note 1] When connecting via SSH with Teraterm, use the physical IP address.	
	IP        : 192.168.4.1
	port    : 22
	Username  : pi
	password: raspberry
	
[Note 2] We recommend using exFAT USB memory, which can be hot swapped even on Linux.	
	 Even with NTFS, data is not corrupted, but the control flag is set to false every time it is accessed, and in many cases the disk needs to be checked.


End




























HOME INDEX FC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンターFC2無料カウンター inserted by FC2 system