TheNightWatch
Posts: 2
Joined: Sun Sep 08, 2019 10:46 am

USB Ethernet into Pi Zero W AP?

Sun Sep 08, 2019 10:51 am

I decided to turn my Pi 0 W into a standalone AP so I can SSH into my devices on the go, by following the official tutorial: https://www.raspberrypi.org/documentati ... s-point.md

However, I also want to be able to ethernet into my RasPi AP, preferrably over USB.

Is there any way to do this?

Thanks in advance :D
Last edited by TheNightWatch on Sun Sep 08, 2019 12:57 pm, edited 3 times in total.

User avatar
B.Goode
Posts: 8507
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: USB Ethernet into Pi Zero W AP?

Sun Sep 08, 2019 12:44 pm

Welcome to the Raspberry Pi forums.
TheNightWatch wrote:
Sun Sep 08, 2019 10:51 am
I decided to turnmy Pi 0 W into a stanalone AP so I can SSH into my devices on the go, by followeing the official tutorial: https://www.raspberrypi.org/documentati ... s-point.md

However, I also want to be able to ethernet into my RasPi AP, preferrably over USB type A.

Is there any way to do this?

Thanks in advance :D

There are many guides and tutorials, but most are based on this from the person who first documented it. (The document refers to the twice-obsoleted Raspbian Jessie Operating System, but I believe it should be applicable to Raspbian Buster.)
https://gist.github.com/gbaman/975e2db1 ... e45e8fd40a

Of course, RPiZero boards do not have Type A usb connectors...

TheNightWatch
Posts: 2
Joined: Sun Sep 08, 2019 10:46 am

Re: USB Ethernet into Pi Zero W AP?

Sun Sep 08, 2019 12:53 pm

B.Goode wrote:
Sun Sep 08, 2019 12:44 pm
Welcome to the Raspberry Pi forums.
TheNightWatch wrote:
Sun Sep 08, 2019 10:51 am
I decided to turnmy Pi 0 W into a stanalone AP so I can SSH into my devices on the go, by followeing the official tutorial: https://www.raspberrypi.org/documentati ... s-point.md

However, I also want to be able to ethernet into my RasPi AP, preferrably over USB type A.

Is there any way to do this?

Thanks in advance :D

There are many guides and tutorials, but most are based on this from the person who first documented it. (The document refers to the twice-obsoleted Raspbian Jessie Operating System, but I believe it should be applicable to Raspbian Buster.)
https://gist.github.com/gbaman/975e2db1 ... e45e8fd40a

Of course, RPiZero boards do not have Type A usb connectors...
Thanks for the quick response!

I understand the article, but could it be used to connect a pi 1 to the pi 0 ap?

User avatar
B.Goode
Posts: 8507
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: USB Ethernet into Pi Zero W AP?

Sun Sep 08, 2019 1:13 pm

TheNightWatch wrote:
Sun Sep 08, 2019 12:53 pm
B.Goode wrote:
Sun Sep 08, 2019 12:44 pm
Welcome to the Raspberry Pi forums.
TheNightWatch wrote:
Sun Sep 08, 2019 10:51 am
I decided to turnmy Pi 0 W into a stanalone AP so I can SSH into my devices on the go, by followeing the official tutorial: https://www.raspberrypi.org/documentati ... s-point.md

However, I also want to be able to ethernet into my RasPi AP, preferrably over USB type A.

Is there any way to do this?

Thanks in advance :D

There are many guides and tutorials, but most are based on this from the person who first documented it. (The document refers to the twice-obsoleted Raspbian Jessie Operating System, but I believe it should be applicable to Raspbian Buster.)
https://gist.github.com/gbaman/975e2db1 ... e45e8fd40a

Of course, RPiZero boards do not have Type A usb connectors...
Thanks for the quick response!

I understand the article, but could it be used to connect a pi 1 to the pi 0 ap?


No.

'Ethernet gadget' mode via the usb connector requires a usb cable. It will not give a path to the Access Point function on the RPiZero.

To access the WiFi access point on your RPiZero you will need a device with a wlan/WiFi interface, either built-in or via an external usb dongle. (I don't recall whether there is any version of the Raspberry Pi Model 1 that has built-in WiFi.)

drgeoff
Posts: 9803
Joined: Wed Jan 25, 2012 6:39 pm

Re: USB Ethernet into Pi Zero W AP?

Sun Sep 08, 2019 3:05 pm

B.Goode wrote:
Sun Sep 08, 2019 1:13 pm
(I don't recall whether there is any version of the Raspberry Pi Model 1 that has built-in WiFi.)
No version of B had onboard Wi-Fi.

The 3B was the first of the B size boards to have onboard wireless.

User avatar
thagrol
Posts: 1834
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: USB Ethernet into Pi Zero W AP?

Sun Sep 08, 2019 3:34 pm

B.Goode wrote:
Sun Sep 08, 2019 1:13 pm
TheNightWatch wrote:
Sun Sep 08, 2019 12:53 pm
B.Goode wrote:
Sun Sep 08, 2019 12:44 pm
I understand the article, but could it be used to connect a pi 1 to the pi 0 ap?


No.

'Ethernet gadget' mode via the usb connector requires a usb cable. It will not give a path to the Access Point function on the RPiZero.

To access the WiFi access point on your RPiZero you will need a device with a wlan/WiFi interface, either built-in or via an external usb dongle. (I don't recall whether there is any version of the Raspberry Pi Model 1 that has built-in WiFi.)
I have to disagree here though this is partly theoretical and not step by step instructions.

An ethernet over USB link between a "standard" Pi and a zeroW requires the zeroW to be run as a USB slave device running the g_ether module.

Once setup what the OS on each end actually sees is a network interface, usually called usb0 (unless you have more than one). These can be used the same as any other network interfaces. It doesn't matter which is the USB host and which is the USB device. Yes, I've tested this, though not with running an AP.

So, try this:
  1. Set up USB gadget and g_ether on the zeroW.
  2. Install bridgeutils and create a network bridge containging only the USB interface. Any static IP configurqation previously done to the WiFi interface needs to be moved to the bridge.
  3. Configure your AP software to bridge using the bridge interface created above.
  4. Connect to the other Pi. It should "just work" and its usb0 interface should get its config from your AP's dhcp server.
The zeroW's usb0 interface will be present as long as the g_ether module is loaded regardless of whether anything is connected to the other end of the USB port/cable.

MAC addresses will be randomly generated (and different) for each end of the USB link. This is likely to only be a problem if your dhcp server assigns fixed IP addressed according to the client's MAC address.
This space unintentionally left blank.

Return to “Networking and servers”