🛠 Serveur web léger et partage de fichiers (NAS) sur bus USB partagé

Raspberry Pi Model B+ (2014) — Board Sheet · avance · Schéma : IMG-model-b-plus-avance-3-modelbp-serveur-web-nas.svg — Raspberry Pi Model B+ servant une page web et un partage Samba : un disque USB et le câble Ethernet convergent vers la puce unique LAN9514 branchée sur l'unique bus USB 2.0 de 480 Mbit/s.

Objectives

Leverage the B+ as a discreet server: a static or lightweight web application with lighttpd, and file sharing via Samba, keeping in mind the architectural constraint of the Model B+ — Ethernet and USB ports are connected to the same LAN9514 chip behind a single 480 Mbit/s USB 2.0 bus. It is the web server that frees up the bus for the disk, not the other way around.

Hardware

Full code

# Serveur web ultra-léger (pensé pour 512 Mo de RAM)
sudo apt install -y lighttpd
echo "<h1>Model B+ en ligne</h1>" | sudo tee /var/www/html/index.html
sudo systemctl enable --now lighttpd
# Partage d'un disque USB en Samba
sudo apt install -y samba
printf '[donnees]\n   path = /mnt/usb\n   browseable = yes\n   writable = yes\n' | sudo tee -a /etc/samba/smb.conf
sudo mkdir -p /mnt/usb && sudo mount /dev/sda1 /mnt/usb
sudo smbpasswd -a pi && sudo systemctl restart smbd
# Mesurer la réalité du bus partagé (depuis un autre poste)
iperf3 -c 192.168.1.42      # plafond pratique ~10-15 Mo/s
lsusb -t                    # le LAN9514 porte Ethernet + tous les ports USB

Expected verification

From a browser on the local network, http://192.168.1.42 displays the page; the share \\192.168.1.42\donnees mounts from a PC. iperf3 confirms the realistic ceiling of 10-15 MB/s: it is the bus, not the network. lsusb -t shows the LAN9514 hub above the single USB controller.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials