WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Network over USB for the Raspberry Pi Zero (2) w in headless mode  (Read 1643 times)

Offline mino45

  • Newbie
  • *
  • Posts: 3
I just bought a Raspberry Pi Zero 2 W. Reading through  the posts, setting up the wireless network in headless mode seems to not be the easiest of tasks. So i thought it might be easier to set up Networking over USB using a fixed IP and go from there. I know it does work with Raspbian. I didnt find any information about doing this with PiCore though..

So my question would be.. is it even possible to do this with PiCore? And if it is, would it not be a good idea to have it as a standard option for the OS? I am thinking it would simplyfy the setup on the Rpi Zeros a lot as they don't have wired networking out of the box.. You would be able to ssh into it and setup whatever else you need.

Any thoughts on this would be greatly appreciated
« Last Edit: November 03, 2021, 09:31:51 PM by mino45 »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14545
Re: Network over USB for the Raspberry Pi Zero (2) w in headless mode
« Reply #1 on: November 04, 2021, 12:29:24 AM »
The piCore/piCore64 images will not boot on an RPi0 W2 at the moment - @bmarkus and @Paul_123 are working on it.

There is a post somewhere in the forums about how to connect an RPi0 W to a wired network via a usb adapter.

As you mention, there are several posts on how to connect an RPi0 W to a wifi network - it's not difficult.

Offline mino45

  • Newbie
  • *
  • Posts: 3
Re: Network over USB for the Raspberry Pi Zero (2) w in headless mode
« Reply #2 on: November 05, 2021, 04:07:20 AM »
Quote
There is a post somewhere in the forums about how to connect an RPi0 W to a wired network via a usb adapter.

I saw that post, but I was thinking about a virtual network driver so that it will work over a standard usb cable not a network adapter.

Quote
As you mention, there are several posts on how to connect an RPi0 W to a wifi network - it's not difficult.

I guess it is possible but it is at least tedious.. I am talking about a headless setup and i will have to be able to change the wifi network easily and regularly so for now my prefered solution would be a virtual usb network and a small webserver on the pi that i can connect to over a standard usb cable so i can change the wifi setup when needed. I think it will be a cost effective solution.

I thought it would be nice to have the virtual network driver available with a standard setup eventually so other people can use it to connect to their zeros via ssh "out of the box"

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14545
Re: Network over USB for the Raspberry Pi Zero (2) w in headless mode
« Reply #3 on: November 05, 2021, 04:22:03 AM »
I am talking about a headless setup
I was also speaking of a headless setup, but if you want to regularly change wifi network it is more complicated.

Ref the virtual usb network, is this what you are speaking of:

https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget

Edit: if you search this forum on "g_ether" there are several hits
« Last Edit: November 05, 2021, 04:30:51 AM by Juanito »

Offline mino45

  • Newbie
  • *
  • Posts: 3
Re: Network over USB for the Raspberry Pi Zero (2) w in headless mode
« Reply #4 on: November 05, 2021, 04:42:36 AM »
Quote
https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget

Edit: if you search this forum on "g_ether" there are several hits

Yes... Thank you..

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14545
Re: Network over USB for the Raspberry Pi Zero (2) w in headless mode
« Reply #5 on: November 05, 2021, 09:49:47 AM »
gadget-5.10.16-piCore uploaded.

following the post here: http://forum.tinycorelinux.net/index.php/topic,20195.msg154612.html#msg154612

edit config.txt:
Code: [Select]
[PI0]
dtoverlay=dwc2

Reboot and:
Code: [Select]
$ tce-load -i gadget-KERNEL
$ sudo modprobe dwc2
$ sudo modprobe g_ether
$ sudo ifconfig usb0 192.168.100.2 up

..and ifconfig shows usb0 is up