Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$os_meta is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$os_previous_publish_date is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$os_notification_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Come configurare Raspberry Pi senza rete: SSH over USB e rpi-usb-gadget

Come configurare Raspberry Pi senza rete: SSH over USB e rpi-usb-gadget

Raspberry Pi OS introduce SSH over USB, una soluzione che semplifica l’accesso headless eliminando i problemi della configurazione WiFi iniziale. Grazie a rpi-usb-gadget, il primo accesso diventa immediato e più affidabile anche in ambienti professionali.

Parlando di sistemi embedded, il termine headless indica un dispositivo che funziona senza periferiche di input o output direttamente collegate, quindi senza monitor, tastiera o mouse. Una scheda Raspberry Pi headless è amministrata da remoto, tipicamente tramite rete, utilizzando protocolli come SSH o servizi Web. Un nuovo componente software, da poco integrato in Raspberry Pi OS, permette finalmente di modificare il comportamento predefinito: usando la connessione USB, il single-board computer non appare più come un host USB ma come periferica collegata al computer.

Il primo accesso: il vero punto critico della configurazione di Raspberry Pi in modalità headless

Configurare una Raspberry Pi in modalità headless dovrebbe essere un’operazione rapida: si prepara la microSD, si impostano WiFi e SSH, si accende il dispositivo e ci si collega. Nella pratica, però, il processo è sorprendentemente fragile.

La fase di primo accesso alla Raspberry Pi è cruciale: se qualcosa va storto nella configurazione iniziale, il dispositivo può diventare di fatto irraggiungibile, costringendo l’utente a collegare temporaneamente monitor e tastiera, vanificando il senso stesso dell’approccio headless.

Le difficoltà aumentano sensibilmente in ambienti aziendali o accademici, dove le reti sono spesso protette da meccanismi avanzati come Protected EAP. In questi casi il Raspberry Pi può avviarsi correttamente ma non riuscire ad autenticarsi, rimanendo invisibile sulla rete. L’utente si trova così bloccato, costretto a ricorrere a soluzioni alternative come l’accesso SSH via Bluetooth, funzionale ma poco intuitivo e tutt’altro che immediato.

SSH over USB: un’alternativa alla configurazione di rete tradizionale

Per superare definitivamente i limiti descritti in precedenza, Paul Oberosler ha sviluppato rpi-usb-gadget, oggi incluso nelle versioni più recenti di Raspberry Pi OS. La soluzione sfrutta la modalità USB gadget di Raspberry Pi, permettendo al dispositivo di comportarsi non come host USB, ma come periferica collegata al computer.

Collegando Raspberry Pi a un computer tramite un semplice cavo USB, il sistema host lo riconosce come una scheda di rete. Il Raspberry Pi, a sua volta, appare come un nodo di rete accessibile direttamente dal computer, senza passare da WiFi, Ethernet o infrastrutture esterne. L’accesso via SSH diventa così immediato e indipendente dall’ambiente di rete.

L’innovazione introdotta con il progetto rpi-usb-gadget elimina alla radice uno dei problemi più comuni della configurazione headless: la necessità di una rete funzionante prima ancora di poter accedere al dispositivo.

USB Gadget Mode Raspberry Pi

Condivisione della connessione e accesso a Internet

Uno degli aspetti più interessanti della modalità SSH over USB è la possibilità di utilizzare la funzione di Internet Connection Sharing del computer host. In questo modo, Raspberry Pi può accedere a Internet sfruttando la connessione del PC a cui è collegato via USB. Dal punto di vista operativo, il cavo USB diventa un canale multifunzione: fornisce alimentazione, connettività di rete e accesso remoto nello stesso tempo.

La configurazione risulta quindi particolarmente utile nelle prime fasi di configurazione, quando è necessario aggiornare il sistema operativo, installare pacchetti o configurare servizi senza dover dipendere da una rete WiFi già funzionante.

Attivazione e limiti della modalità gadget (SSH over USB)

La modalità gadget USB può essere abilitata direttamente attraverso il programma Raspberry Pi Imager durante la preparazione della microSD, senza interventi manuali sui file di configurazione. In questo modo l’adozione del single-board computer Raspberry diventa molto più accessibile anche a chi non vuole modificare a mano il boot del sistema.

Va però considerato che il meccanismo di Internet Connection Sharing non è ugualmente immediato su tutti i sistemi operativi. In particolare su Windows può essere necessario installare driver aggiuntivi e configurare manualmente la condivisione della connessione, rendendo l’esperienza meno fluida rispetto a macOS o Linux.

In Windows, in generale si procede premendo Windows+R, digitando ncpa.cpl cliccando con il tasto destro sulla connessione di rete in uso, su Proprietà, sulla scheda Condivisione e infine sulla casella Consenti ad altri utenti in rete di collegarsi tramite la connessione Internet di questo computer.

Su Linux, si può usare ad esempio NetworkManager lato desktop, disponibile nelle distribuzioni più diffuse come Ubuntu, Debian desktop, Fedora. Dopo aver collegato Raspberry Pi via USB, si accede alle impostazioni di rete, si individua l’interfaccia USB (i.e. usb0 o enx) e nelle Impostazioni IPv4 si sceglie Condiviso con altri computer per poi salvare e riattivare la connessione.

Su sistemi Linux senza interfaccia grafica è necessario procedere manualmente abilitando il forwarding IP, configurando il NAT e infine assegnando un indirizzo IP alla Raspberry Pi.

Infine, esiste una limitazione strutturale: la porta USB configurata in modalità gadget non può funzionare come host per altre periferiche. In pratica, quella porta è dedicata esclusivamente ad alimentazione e rete, un dettaglio da tenere in considerazione nella progettazione di sistemi embedded più complessi.

Un passo avanti per l’uso professionale del Raspberry Pi

L’inclusione ufficiale del supporto a SSH over USB in Raspberry Pi OS rappresenta un’evoluzione significativa nella gestione dei sistemi headless.

Non è solo una comodità per maker o appassionati, ma un miglioramento concreto per scenari professionali, dove affidabilità, rapidità di provisioning e ripetibilità della configurazione sono fondamentali.

Grazie al progetto rpi-usb-gadget, Raspberry Pi si avvicina finalmente al comportamento atteso da un dispositivo embedded moderno: lo colleghi, lo accendi e sei immediatamente operativo, senza dipendere da infrastrutture esterne o configurazioni preliminari fragili.

Ti consigliamo anche

Link copiato negli appunti