[Solved] Change to ethernet with sd card edit

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
elece
Posts: 3
Joined: Wed Jan 16, 2019 7:36 pm

[Solved] Change to ethernet with sd card edit

Post by elece »

Hello. My wifi router broke so my rpi cannot connect any longer to the previous 5GHz signal. Apparently, I had HDMI disabled in the pi and ethernet also. So now I am stuck with no SSH capabilities and no way to acces the dietpi-config section. Which file do I need to modify in the SD card to (1) activate HDMI back and (2) activate ethernet. I googled a little bit and found two files with what it seems to be network configuration. I tried to change some of the files information to get ethernet enabled again, with no luck. This is the current state of those files. Any help is appreciated.

/dietpi/.network:

Code: Select all

0
0
eth0
192.168.2.139
ETH_IP=192.168.2.139
WLAN_IP=192.168.2.139
/dietpi/conf/network_interfaces

Code: Select all

#/etc/network/interfaces
#Please use DietPi-Config to modify network settings.

# Local
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4

# Wifi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
wireless-power off
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#dns-nameservers 8.8.8.8 8.8.4.4
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: Change to ethernet with sd card edit

Post by MichaIng »

/dietpi/.network is just a file that contains the values estimated from the real network before, e.g. used by other DietPi scripts to show and deal with correct network info.
/dietpi/conf/network_interfaces is the default interfaces file that is used only on 1st run/preparation and copied to /etc/network/interfaces.

So the last is the one that you need to edit, as you did:

Code: Select all

allow-hotplug eth0
iface eth0 inet dhcp
is the part that enables Ethernet.

Another possibility is to re-enable HDMI by doing the following:
In /dietpi.txt set: CONFIG_HDMI_OUTPUT=1 to re-enable HDMI.
If you set headless mode via dietpi-config, you also need to increase the framebuffer size, otherwise one letter would take the whole screen. For this open config.txt and adjust:

Code: Select all

framebuffer_width=1024
framebuffer_height=768
Or use any other resolution that is supported by your screen.
elece
Posts: 3
Joined: Wed Jan 16, 2019 7:36 pm

Re: Change to ethernet with sd card edit

Post by elece »

Ok, I still can't get it to connect using ethernet after looking at the interface file....I noticed that a file called #/etc/network/interfaces is also in the same folder...shall I do anything with it? any other ideas?
I regain HDMI, but I had KODI as boot option. So I see the system booting in the screen, but after kodi starts, the screen goes black. How do I set console as the start option editing files in the SD card?

Thank you
elece
Posts: 3
Joined: Wed Jan 16, 2019 7:36 pm

Re: Change to ethernet with sd card edit

Post by elece »

Nevermind, figured it out and connectivity fixed. Thanxs.
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: Change to ethernet with sd card edit

Post by MichaIng »

Okay, great you figured it out. Just for reference:
  • It should be somehow possible to exit from Kodi back to console, but not 100% sure, since I don't use it.
  • You can change the startup option via: dietpi/.dietpi-autostart_index
    Value "1" is Kodi, value "0" is default console login.
Post Reply