2

I have been working on a project that uses Pi Zeros as remote cameras. Recently, I have an application that requires them to be hardwired, so I have been experimenting with the Ethernet over USB function on the Zeros. I have it working on OS X and Linux (Ubuntu).

I followed these steps (not including the static ip): https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget

[edit]: Changed to to using the tutorial suggested in the comments, following the Ethernet gadget section. https://www.isticktoit.net/?p=1383

However, I cannot connect the Zeros to a Pi 4 via ethernet over USB. I thought it would be the same process as my Linux computer, but the Pi 4 does not show the usb0 when the Zero is plugged in.

Are there extra steps I need to take to enable the USB interface on the Pi 4? Is there a better tutorial I could be following?

My goal is to plug 4x Zeros in to the Pi 4 via USB and control them through SSH.

Here is the dmesg when I plug the Zero into the Pi4. However the cable was tested on my laptop using the Zero.

[  176.391762] Under-voltage detected! (0x00050005)
[  182.631705] Voltage normalised (0x00000000)
[  189.081934] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?
[  189.991993] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?
[  189.992184] usb 1-1-port2: attempt power cycle
[  191.271930] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?
[  192.182002] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?
[  192.182192] usb 1-1-port2: unable to enumerate USB device

After connecting to the power supply that came with the Pi4. It keeps repeating this block, iterating the device number each time.

[  119.141654] usb 1-1.4: new high-speed USB device number 25 using xhci_hcd
[  119.272720] usb 1-1.4: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 4.19
[  119.272736] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  119.272750] usb 1-1.4: Product: RNDIS/Ethernet Gadget
[  119.272762] usb 1-1.4: Manufacturer: Linux 4.19.75+ with 20980000.usb
[  119.276883] cdc_ether 1-1.4:1.0 usb0: register 'cdc_ether' at usb-0000:01:00.0-1.4, CDC Ethernet Device, e2:9f:07:61:08:9f
[  119.822601] usb 1-1.4: USB disconnect, device number 25

The pi4 power supply is 5.1V at 3.5A. As of right now I have only attempted to connect 1x Pi Zero.

Rusty
  • 152
  • 9
  • On adafruit tutorial i cannot see any libcomposite configuration... maybe try this website for ethernet gadget configuration, it worked for me. Or maybe edit your question with the result of sudo dmesg when you have plug your RPi-Z Ethernet gadget. – Ephemeral Dec 28 '19 at 10:06
  • Here is thesudo dmesg output

    `[ 176.391762] Under-voltage detected! (0x00050005)

    [ 182.631705] Voltage normalised (0x00000000)

    [ 189.081934] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?

    [ 189.991993] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?

    [ 189.992184] usb 1-1-port2: attempt power cycle

    [ 191.271930] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?

    [ 192.182002] usb 1-1-port2: Cannot enable. Maybe the USB cable is bad?

    [ 192.182192] usb 1-1-port2: unable to enumerate USB device`

    I tested the cable and the 0 turns on.

    – Rusty Dec 28 '19 at 15:11
  • @Ephemeral I will take a look at the website you suggested. Did you use that to connect it to a full computer or to another Pi? Mine currently works fine with a full computer. – Rusty Dec 28 '19 at 15:15
  • 1
    @Ephemeral asked you to edit the question to add the output. The reason why you self can see it: the comment is unreadable. There is an edit link beneath your question. Please click on it and insert the output. – Ingo Dec 28 '19 at 23:47
  • @Rusty, Yes for your 1st question : on a 'full computer' not with another RPi or Linux system. – Ephemeral Dec 29 '19 at 04:05
  • @Rusty, what is your POWER supply for your RPi 4 ? (please, again edit your question with this informations) – Ephemeral Dec 29 '19 at 04:12
  • 1
    @Ephemeral Thanks for the help. Updated with the information. I was using a cord plugged into my laptop, but I switched to using the power-supply that came with the Pi4. It appears to work better, but still has issues. – Rusty Dec 30 '19 at 00:26
  • @Rusty, In your case the RPi4 must POWER ON four RPi-Z. Your power used is : the RPi4 needed power + the RPi-Z needed power * 4. Check this link. Let, ~120mA * 4 for RPi-Zs. Check this link : Raspberry Pi 4 spec recommends a 3 A supply (15 W), with a minimum current of 2.5 A if downstream USB peripherals consume less than 500 mA in total. Please edit your question with your power supply specifications – Ephemeral Dec 30 '19 at 03:20
  • @Rusty, These calculations are really approximate but still give an idea. Please specify what is your followed steps (adafruit tutorial or isticktoit tutorial) ? – Ephemeral Dec 30 '19 at 03:38
  • 1
    @Ephemeral Thanks again. This project is definitely challenging my knowledge. Power supply specified above. 3.5A so that should work, although I am only trying to do one Pi Z for now as a trial. Still getting the same error from both tutorials. Currently set up on the one you suggested. Not sure what if any set up the Pi4 should have. I have tried both the a clean raspian lite and setting it up the same as the PiZ. – Rusty Dec 31 '19 at 20:28
  • @Rusty, I have try to connect my RPI-Z gadget to my RPi3B (where raspbian is installed) following itostick tutorial and it's work perfectly for the rndis_host and cdc ether gadget. I have two interfaces when I plug my OTG USB cable : eth1 and eth2. I use sudo ifconfig eth1 10.0.0.2 netmask 255.255.255.0 (rndis_host) and sudo ifconfig eth2 10.0.0.2 netmask 255.255.255.0 (cdc_ether). I can use ping -I eth1/2 10.0.0.1 or ssh pi@10.0.0.1. In your case you got: new high-speed USB device number 25 using xhci_hcd, but in my case I have ...device number X using dwc_otg – Ephemeral Jan 01 '20 at 08:49
  • @Rusty, rndis_wlan,rndis_host and cdc_ether modules are loaded where cdc_ether use rndis_host and rndis_host use rndis_wlan. You have : cdc_ether 1-1.4:1.0 usb0: register 'cdc_ether' at usb-0000:01:00.0-1.4, CDC Ethernet Device , I have this but also the same line for RNDIS device and instance of usb0 I have eth1 and eth2. – Ephemeral Jan 01 '20 at 08:59
  • 1
    @Ephemeral Based on your success, I did some more testing and I figured out what is happening. I set up the RPI4 using the itostick tutorial as well as the RPI-Z. It seems that this disabled the ability to use the RPI4 as a host. I deleted the itostick modifications on the RPI4 and system works. It doesn't share internet in this configuration, but that is OK for my purposes.

    Thank you very much for your help and patience. What is the proper way to close out this topic?

    – Rusty Jan 09 '20 at 01:09
  • It doesn't share internet in this configuration some other conf (mount the proper interface) must be done (try ifconfig -a when your gadget is plugged , after a certain amount of time). To close the topic you can accept simply delete this or put an answer and accept your own answer. – Ephemeral Jan 09 '20 at 06:33

1 Answers1

1

Very late reply, but I have done even more testing and found out more information.

  1. The RPi4 cannot be set up to be an ethernet gadget itself. Originally, I had a chain set up where the RPiZ was plugged into the RPi4, and the RPi4 was plugged into my laptop.

  2. The USB cables must be very good. A cable that successfully creates an ethernet gadget on my laptop and desktop was unable to be used with the RPi4. Changing to a better cable solved this problem.

  3. Working on this now, but the RPi4 appears to only able to handle 1 gadget at a time even though it has multiple USB ports.

Rusty
  • 152
  • 9