On my RPi zero w I have both the wlan and micro-USB to rj45 adapter active, but since my router reports it as wlan device, I think the eth adapter is not working (maybe I’ve to enable it in DietPI the driver is not on by default?). So if I turn off the Wi-Fi on the RPi, and the adapter isn’t working, how can I reconnect to the RPi?
I already tried in the network options of DietPI-config and is listed only the Wi-Fi (Ethernet not present), but maybe it shows as USB device?
I don’t know how these USB OTG devices work in DietPI and if they’re already enabled or is not compatible.
root@Homebridge:~# lsusb; lsmod; ip link; ip addr
Bus 001 Device 002: ID 0b95:772b ASIX Electronics Corp. AX88772B
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Module Size Used by
ax88796b 16384 1
asix 36864 0
brcmfmac 307200 0
brcmutil 20480 1 brcmfmac
sha256_generic 16384 0
libsha256 16384 1 sha256_generic
cfg80211 778240 1 brcmfmac
rfkill 32768 4 cfg80211
raspberrypi_hwmon 16384 0
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
fixed 16384 0
fuse 126976 1
ip_tables 28672 0
x_tables 36864 1 ip_tables
ipv6 491520 20
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether b8:27:eb:8a:52:21 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:0e:c6:8e:d5:ea brd ff:ff:ff:ff:ff:ff
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
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:8a:52:21 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.5/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:0e:c6:8e:d5:ea brd ff:ff:ff:ff:ff:ff
eth0: state DOWN
At least now it’s available from the network tool (dietpi-config), I tried to put it ON, assigned an IP, rebooted but now I can’t ssh in to the rpi. If I disconnet the network adapter, reboot, it’s discoverable and I can use ssh via wlan.
Maybe I have to turn the wifi OFF, but if -after the reboot- it doesn’t come up, how I can reconnect to it? if I put out the sd card, is there an option to switch back to wifi and disable the eth inside the /boot config.txt or somewhere in the sd card? or a way to set the priority to ethernet and if it fails switch to wlan?
even if not ideal but it should be possible to have both Ethernet as well as WiFi available same time (with different IP address). At least it is working on my RPi3B+ with the 2 onboard adaptor.
root@DietPi3:~# ip a
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:d6:61:4a brd ff:ff:ff:ff:ff:ff
inet 192.168.0.12/24 brd 192.168.0.255 scope global dynamic eth0
valid_lft 86281sec preferred_lft 86281sec
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:83:34:1f brd ff:ff:ff:ff:ff:ff
inet 192.168.0.70/24 brd 192.168.0.255 scope global dynamic wlan0
valid_lft 86296sec preferred_lft 86296sec
root@DietPi3:~#
Then why if I reboot using wlan (192.168.5) and eth (192.168.6)… I can’t reach the rpi? To be honest, on my lan I found the rpi with the wlan IP (.5), but I can’t ssh in to it, I don’t know how to reach it. Only way it’s detach the usb-eth adapter and reboot.
usually there is no need to do anything in /etc/network/interfaces as this file is managed by dietpi-config. Custom configurations should go to the configuration file directory /etc/network/interfaces.d
IDK if this is the correct gateway in the post-up and post-down statements? Earlier it’s 192.168.1.2.
What is the purpose of using the post-up and post-down commands? It just means to add a gateway with a metric after the interface is up. But what is the advantage of doing it this way?
And when I look into the manpage it should be:
As the other my posts, -I don’t know why- again this was not my fault but a fault (or not compatible) usb-rj45 adapter
I bought (well, ordered from amazon) another adpter and this one works perfectly at the first reboot! And as Joulinar said: the rpi could be used with both wlan and eth enabled (with two ip), now I can safely disable the wifi (what a luck that I didn’t do it before with the incompatible adpter !! I’d still be here freaking out how to connect to my rpi zero )
jappish thanks for the reply, I’ve just found the solution as you probably already noticed I don’t know if your solution would have worked with the faulty adapter