SlideShare a Scribd company logo
Raspberry Zero to USB at Linux
s
p
ri
n
SD card formating and flashing
Preparing SD with Etcher
Preparing SD with Etcher
https://desertbot.io/blog/ssh-into-pi-zero-over-usb
Changes in boot folder files of SD card
Step 4. Edit config.txt
In the root folder of the SD card, open config.txt(/Volumes/boot/config.txt) in a text editor
Append this line to the bottom of it:dtoverlay=dwc2
Save the file
Step 5. Edit cmdline.txt
In the root folder of the SD card, open cmdline.txt(/Volumes/boot/cmdline.txt) in a text editor
After rootwait, append this text leaving only one space between rootwait and the new text (otherwise
it might not be parsed correctly):modules-load=dwc2,g_ether
If there was any text after the new text make sure that there is only one space between that
text and the new text
Save the file
On a fresh image that has never been booted, you may see extra text after rootwait. But if you boot
the pi from the disk at least once, that extra text may go away. That is why you must put the new
text directly after rootwait - so it doesn't get accidentally deleted.
Setting for USB _Ethernet
Settings for ssh file in Boot folder of SD
Card
#In your SD card Boot folder
sudo chmod 755 ssh
Connecting to Raspberry Zero
sudo ssh pi@raspberrypi.local
Using vcnserver at
raspberry terminal
Setting in Pi for changing it’s IP
#Reffrence: https://cdn-learn.adafruit.com/downloads/pdf/turning-your-raspberry-pi-zero-into-a-usb-gadget.pdf
sudo nano /etc/network/interfaces
#AND in Opend file add this texts at the end of file:
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug usb0
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
broadcast 192.168.7.255
gateway 192.168.7.1
USB Ethernet setting in Linux PC
New Connecting to PI
sudo ssh pi@192.168.7.2
Enablig internet to PI With USB Ethernet
Restart Raspberry Pi and In Raspberry consol do this:
sudo ifconfig usb0 192.168.7.2
sudo route add default gw 192.168.7.1
Enablig internet to PI With USB Ethernet
In Your Linux PC console do this:
#wlp2s0 is my internet facing interface, enp0s20f0u2 is the Raspberry USB
connection
sudo ifconfig enp0s20f0u2 192.168.7.1
sudo iptables --table nat --append POSTROUTING --out-interface wlp2s0 -j
MASQUERADE
sudo iptables --append FORWARD --in-interface enp0s20f0u2 -j ACCEPT
sudo echo 1 > /proc/sys/net/ipv4/ip_forward
Troubleshuting internet to PI With USB
Ethernet
If you can’t conect to Pi with this comand:
sudo ssh pi@192.168.7.2
So do this cammand ant again try:
sudo ip link set br0 down
Installing LCD 5 Inch but not working!!!
pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-input-evdev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
xserver-xorg-input-evdev
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 117 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Err:1 http://raspbian.mirror.net.in/raspbian/raspbian stretch/main armhf xserver-xorg-input-evdev armhf 1:2.10.5-1
503 Service Unavailable
E: Failed to fetch http://raspbian.mirror.net.in/raspbian/raspbian/pool/main/x/xserver-xorg-input-evdev/xserver-xorg-input-evdev_2.10.5-1_armhf.deb 503 Service Unavailable
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
pi@raspberrypi:~ $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Get:4 http://archive.raspberrypi.org/debian stretch/main armhf Packages [221 kB]
Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [45.0 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian stretch/non-free armhf Packages [95.5 kB]
Fetched 12.1 MB in 1min 17s (157 kB/s)
Reading package lists... Done
pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-input-evdev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
xserver-xorg-input-evdev
1 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.
1 not fully installed or removed.
Need to get 117 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Get:1 http://raspbian.mirror.net.in/raspbian/raspbian stretch/main armhf xserver-xorg-input-evdev armhf 1:2.10.5-1 [117 kB]
Fetched 117 kB in 4s (25.2 kB/s)
Reading changelogs... Done
(Reading database ... 80898 files and directories currently installed.)
Preparing to unpack .../xserver-xorg-input-evdev_1%3a2.10.5-1_armhf.deb ...
Unpacking xserver-xorg-input-evdev (1:2.10.5-1) over (1:2.10.3-1) ...
Setting up xserver-xorg-input-evdev (1:2.10.5-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-input-evdev
Reading package lists... Done
Building dependency tree
Reading state information... Done
xserver-xorg-input-evdev is already the newest version (1:2.10.5-1).
0 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.

More Related Content

PDF
linux-commandline-magic-Joomla-World-Conference-2014
Peter Martin
 
PPTX
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman
 
PPT
Rakesh Kaushik
itplant
 
PPTX
SquirrelMail for webmail
Aryman Gautam
 
PPT
Dns
muh kemal
 
PDF
Linux Commands - Cheat Sheet
Isham Rashik
 
PPTX
RPM (LINUX)
Raghu nath
 
PDF
Linux Network commands
Hanan Nmr
 
linux-commandline-magic-Joomla-World-Conference-2014
Peter Martin
 
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman
 
Rakesh Kaushik
itplant
 
SquirrelMail for webmail
Aryman Gautam
 
Linux Commands - Cheat Sheet
Isham Rashik
 
RPM (LINUX)
Raghu nath
 
Linux Network commands
Hanan Nmr
 

What's hot (19)

PPTX
Linux Presentation
kuldeepakgautam
 
PPT
Divya
diva23
 
PPT
Divya
diva23
 
PDF
Samba
Md Shihab
 
PPT
Rhel3
Yash Gulati
 
PDF
Linux network configuration
Mario Tabuada Mussio
 
RTF
Useful linux-commands
Himani Singh
 
PPT
Slim Server Practical
Gaurav Paliwal
 
PPTX
Cocoaheads - Streaming on iOS devices
Nirbhay Kundan
 
PPT
Fedora Linux
Gaurav Paliwal
 
DOCX
Lab manual
BNilavara
 
PDF
Scale13
Dru Lavigne
 
DOCX
BASIC COMMANDS OF LINUX
Mr.AKHILESH KUMAR {Computer Lab Technician}
 
PPTX
Software management in linux
nejadmand
 
PPTX
Compression
aswathyu
 
PPT
香港六合彩
csukxnr
 
PPT
Rhel1
Yash Gulati
 
PDF
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Sammy Fung
 
PPT
Apache1.ppt
webhostingguy
 
Linux Presentation
kuldeepakgautam
 
Divya
diva23
 
Divya
diva23
 
Samba
Md Shihab
 
Linux network configuration
Mario Tabuada Mussio
 
Useful linux-commands
Himani Singh
 
Slim Server Practical
Gaurav Paliwal
 
Cocoaheads - Streaming on iOS devices
Nirbhay Kundan
 
Fedora Linux
Gaurav Paliwal
 
Lab manual
BNilavara
 
Scale13
Dru Lavigne
 
Software management in linux
nejadmand
 
Compression
aswathyu
 
香港六合彩
csukxnr
 
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Sammy Fung
 
Apache1.ppt
webhostingguy
 
Ad

Similar to Raspberry zero usb in linux (20)

PDF
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
PDF
Raspi_TOR_Access_Point_BenMoore
Benjamin Moore
 
PPTX
Up and running with Raspberry Pi
Shahed Mehbub
 
PDF
Firefox OS + Raspberry Pi
EnsekiTT
 
PPTX
Workshop Raspberry Pi NAS with Windows Share
Michael Plate
 
PDF
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
TE4P
 
PDF
Exploring Raspberry Pi
Lentin Joseph
 
PPTX
Raspberry Pi ppt.pptx
ushabharathisb1
 
PPTX
Raspberry Pi ppt.pptx
ushabharathisb1
 
DOCX
Ex.no1
Vairavel C
 
PPTX
introduction to Raspberry pi
Mohamed Ali May
 
PPTX
RaspberryPi + IoT - Lab to switch on and off a light bulb
Jeff Prestes
 
PDF
Raspberry pi Board Hardware & Software Setup
RANAALIMAJEEDRAJPUT
 
PPTX
Raspberry pi : how to get started
동호 손
 
PDF
Introduction to the rapid prototyping with python and linux for embedded systems
Naohiko Shimizu
 
PDF
Raspberry Pi Hacks
Imad Rhali
 
PPTX
Capstone_Project.ppt
Dhruvkumar Panchal
 
PDF
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
Ian Kluft
 
PDF
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Ruthvik Vaila
 
PPTX
Introduction to Raspberry Pi
ehrenbrav
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
Raspi_TOR_Access_Point_BenMoore
Benjamin Moore
 
Up and running with Raspberry Pi
Shahed Mehbub
 
Firefox OS + Raspberry Pi
EnsekiTT
 
Workshop Raspberry Pi NAS with Windows Share
Michael Plate
 
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
TE4P
 
Exploring Raspberry Pi
Lentin Joseph
 
Raspberry Pi ppt.pptx
ushabharathisb1
 
Raspberry Pi ppt.pptx
ushabharathisb1
 
Ex.no1
Vairavel C
 
introduction to Raspberry pi
Mohamed Ali May
 
RaspberryPi + IoT - Lab to switch on and off a light bulb
Jeff Prestes
 
Raspberry pi Board Hardware & Software Setup
RANAALIMAJEEDRAJPUT
 
Raspberry pi : how to get started
동호 손
 
Introduction to the rapid prototyping with python and linux for embedded systems
Naohiko Shimizu
 
Raspberry Pi Hacks
Imad Rhali
 
Capstone_Project.ppt
Dhruvkumar Panchal
 
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
Ian Kluft
 
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Ruthvik Vaila
 
Introduction to Raspberry Pi
ehrenbrav
 
Ad

Recently uploaded (20)

PPTX
Azure-DevOps-Training presentation downloadable
NamanGoyal428595
 
PPTX
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
PDF
ETO & MEO Certificate of Competency Questions and Answers
Mahmoud Moghtaderi
 
PPTX
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PPTX
anatomy of limbus and anterior chamber .pptx
ZePowe
 
PPTX
Production of bioplastic from fruit peels.pptx
alwingeorgealwingeor
 
PDF
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
PPT
High Data Link Control Protocol in Data Link Layer
shailajacse
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PPTX
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
shravanidabhane8
 
PPTX
Module_II_Data_Science_Project_Management.pptx
anshitanarain
 
Azure-DevOps-Training presentation downloadable
NamanGoyal428595
 
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
ETO & MEO Certificate of Competency Questions and Answers
Mahmoud Moghtaderi
 
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
anatomy of limbus and anterior chamber .pptx
ZePowe
 
Production of bioplastic from fruit peels.pptx
alwingeorgealwingeor
 
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
High Data Link Control Protocol in Data Link Layer
shailajacse
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Ppt for engineering students application on field effect
lakshmi.ec
 
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
shravanidabhane8
 
Module_II_Data_Science_Project_Management.pptx
anshitanarain
 

Raspberry zero usb in linux

  • 1. Raspberry Zero to USB at Linux s p ri n
  • 2. SD card formating and flashing
  • 6. Changes in boot folder files of SD card Step 4. Edit config.txt In the root folder of the SD card, open config.txt(/Volumes/boot/config.txt) in a text editor Append this line to the bottom of it:dtoverlay=dwc2 Save the file Step 5. Edit cmdline.txt In the root folder of the SD card, open cmdline.txt(/Volumes/boot/cmdline.txt) in a text editor After rootwait, append this text leaving only one space between rootwait and the new text (otherwise it might not be parsed correctly):modules-load=dwc2,g_ether If there was any text after the new text make sure that there is only one space between that text and the new text Save the file On a fresh image that has never been booted, you may see extra text after rootwait. But if you boot the pi from the disk at least once, that extra text may go away. That is why you must put the new text directly after rootwait - so it doesn't get accidentally deleted.
  • 7. Setting for USB _Ethernet
  • 8. Settings for ssh file in Boot folder of SD Card #In your SD card Boot folder sudo chmod 755 ssh
  • 11. Setting in Pi for changing it’s IP #Reffrence: https://cdn-learn.adafruit.com/downloads/pdf/turning-your-raspberry-pi-zero-into-a-usb-gadget.pdf sudo nano /etc/network/interfaces #AND in Opend file add this texts at the end of file: allow-hotplug wlan1 iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf allow-hotplug usb0 iface usb0 inet static address 192.168.7.2 netmask 255.255.255.0 network 192.168.7.0 broadcast 192.168.7.255 gateway 192.168.7.1
  • 12. USB Ethernet setting in Linux PC
  • 14. Enablig internet to PI With USB Ethernet Restart Raspberry Pi and In Raspberry consol do this: sudo ifconfig usb0 192.168.7.2 sudo route add default gw 192.168.7.1
  • 15. Enablig internet to PI With USB Ethernet In Your Linux PC console do this: #wlp2s0 is my internet facing interface, enp0s20f0u2 is the Raspberry USB connection sudo ifconfig enp0s20f0u2 192.168.7.1 sudo iptables --table nat --append POSTROUTING --out-interface wlp2s0 -j MASQUERADE sudo iptables --append FORWARD --in-interface enp0s20f0u2 -j ACCEPT sudo echo 1 > /proc/sys/net/ipv4/ip_forward
  • 16. Troubleshuting internet to PI With USB Ethernet If you can’t conect to Pi with this comand: sudo ssh [email protected] So do this cammand ant again try: sudo ip link set br0 down
  • 17. Installing LCD 5 Inch but not working!!! pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-input-evdev Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: xserver-xorg-input-evdev 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 117 kB of archives. After this operation, 1,024 B of additional disk space will be used. Err:1 http://raspbian.mirror.net.in/raspbian/raspbian stretch/main armhf xserver-xorg-input-evdev armhf 1:2.10.5-1 503 Service Unavailable E: Failed to fetch http://raspbian.mirror.net.in/raspbian/raspbian/pool/main/x/xserver-xorg-input-evdev/xserver-xorg-input-evdev_2.10.5-1_armhf.deb 503 Service Unavailable E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? pi@raspberrypi:~ $ sudo apt-get update Get:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB] Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB] Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB] Get:4 http://archive.raspberrypi.org/debian stretch/main armhf Packages [221 kB] Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [45.0 kB] Get:6 http://raspbian.raspberrypi.org/raspbian stretch/non-free armhf Packages [95.5 kB] Fetched 12.1 MB in 1min 17s (157 kB/s) Reading package lists... Done pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-input-evdev Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: xserver-xorg-input-evdev 1 upgraded, 0 newly installed, 0 to remove and 52 not upgraded. 1 not fully installed or removed. Need to get 117 kB of archives. After this operation, 1,024 B of additional disk space will be used. Get:1 http://raspbian.mirror.net.in/raspbian/raspbian stretch/main armhf xserver-xorg-input-evdev armhf 1:2.10.5-1 [117 kB] Fetched 117 kB in 4s (25.2 kB/s) Reading changelogs... Done (Reading database ... 80898 files and directories currently installed.) Preparing to unpack .../xserver-xorg-input-evdev_1%3a2.10.5-1_armhf.deb ... Unpacking xserver-xorg-input-evdev (1:2.10.5-1) over (1:2.10.3-1) ... Setting up xserver-xorg-input-evdev (1:2.10.5-1) ... Processing triggers for man-db (2.7.6.1-2) ... pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-input-evdev Reading package lists... Done Building dependency tree Reading state information... Done xserver-xorg-input-evdev is already the newest version (1:2.10.5-1). 0 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.