Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 12/04/2024, à 10:19

petitbouchon

mantic, configuration interface réseau usb0

Bonjour,
Sur le lien usb-C d'un create3 et son rpi on doit configurer une interface réseau usb0.
Aucun pb avec jammy mais je n'y arrive pas sur mantic.
J'ai essayé les deux méthodes :
- création de la configuration dans /etc/netplan
- configuration au boot.
Dans la doc pour la méthode boot:

Step-by-step
Download and install the appropriate version of the Raspberry Pi Imager on your computer.

Open the imager and under operating system, select "Other general-purpose OS" then "Ubuntu" and finally, "Ubuntu Server 22.04 LTS (64-bit)".

Insert your microSD card into your computer and under storage in the Raspberry Pi Imager, select your microSD card.

It's recommended to customize advanced options for the image before flashing it. To do it, either click on the gear icon, if visible, or press "ctrl + shift + x" keyboard shortcut ("command + shift + x" on MacOS). Advanced options include enabling SSH, setting a unique username and password, and configuring a wireless LAN. It is recommended to uncheck the "Eject media when finished" box in advanced options so you can edit the necessary files in the following steps without re-inserting the SD card.

Once all options have been selected, click the "WRITE" (or "NEXT") button to write the image to your SD card.

In the system-boot partition, edit config.txt and add dtoverlay=dwc2,dr_mode=peripheral at the end of the file.

In the system-boot partition, edit cmdline.txt to add modules-load=dwc2,g_ether after rootwait.

In the system-boot partition, edit the network-config executable to optionally add information about your Wi-Fi connection, and also add the following under ethernets

        usb0:
            dhcp4: false
            optional: true
            addresses: [192.168.186.3/24]
moi@moi-desktop:~$ cat /boot/firmware/cmdline.txt 
zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=zstd multipath=off dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait modules-load=dwc2.g_ether fixrtc quiet splash
moi@moi-desktop:~$ cat /boot/firmware/config.txt 
[all]
kernel=vmlinuz
cmdline=cmdline.txt
initramfs initrd.img followkernel

[pi4]
max_framebuffers=2
arm_boost=1

[all]
# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these
# parameters related to the base device-tree they must appear *before* any
# other dtoverlay= specification
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=spi=on

# Comment out the following line if the edges of the desktop appear outside
# the edges of your display
disable_overscan=1

# If you have issues with audio, you may try uncommenting the following line
# which forces the HDMI output into HDMI mode instead of DVI (which doesn't
# support audio output)
#hdmi_drive=2

[cm4]
# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into
# such a board)
dtoverlay=dwc2,dr_mode=host

[all]

# Enable the KMS ("full" KMS) graphics overlay, leaving GPU memory as the
# default (the kernel is in control of graphics memory with full KMS)
dtoverlay=vc4-kms-v3d

# Autoload overlays for any recognized cameras or displays that are attached
# to the CSI/DSI ports. Please note this is for libcamera support, *not* for
# the legacy camera stack
camera_auto_detect=1
display_auto_detect=1

# Config settings specific to arm64
arm_64bit=1
dtoverlay=dwc2

dtoverlay=dwc2,dr_mode=peripheral
moi@moi-desktop:~$ cat /boot/network-config
        usb0:
            dhcp4: false
            optional: true
            addresses: [192.168.186.3/24]
moi@moi-desktop:~$

Avec config netplan :

moi@moi-desktop:~$ sudo cat /etc/netplan/50-ethernets.yaml 
[sudo] password for moi: 
network:
    version: 2
    ethernets:
      usb0:
        dhcp4: false
        addresses:
          - 192.168.186.3/24
        optional: true
moi@moi-desktop:~$ 
moi@moi-desktop:~$ sudo netplan generate
moi@moi-desktop:~$ sudo netplan apply
moi@moi-desktop:~$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether d8:3a:dd:23:e8:0a brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d8:3a:dd:23:e8:0b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.86/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
       valid_lft 43190sec preferred_lft 43190sec
    inet6 2a01:e0a:413:f7f0:5322:5ce7:296f:dffa/64 scope global temporary dynamic 
       valid_lft 86394sec preferred_lft 85962sec
    inet6 2a01:e0a:413:f7f0:e0f9:2ddc:2617:92e5/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 86394sec preferred_lft 86394sec
    inet6 fe80::fbd9:6738:d13f:96d9/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:be:cc:ee:22 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
moi@moi-desktop:~$ 

Aucune interface usb0 avec "ip address"

Hors ligne