Creating a bug report/issue
Recently picked up my RPi2B after a while sitting in a drawer so I could have Kodi and download some shows wherever I wanted.
Comes the time I turn on my phone hotspot and try to connect with DietPi, and I get greeted by the wifi hotspot setting in dietpi-config. I was sure the old version I’m using still had a scan functionality before I decided to mess it up, forget about it, and store it in a drawer.
Now I’m not home, have no ethernet, USB tethering doesn’t work, and it seems like the wifi hotspot won.
I tried different stuff like masking hostapd, tried uninstalling it, nothing helped.
Required Information
-
DietPi version | cat /boot/dietpi/.version
dietpi_version_core=6
dietpi_version_sub=31
dietpi_version_rc=2
-
Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
stretch 1
-
Kernel version | uname -a
linux dietpi 4.19.66-v7+ #1253 SMP (incorrect date) armv71 gnu/linux
-
SBC model | echo $G_HW_MODEL_NAME
or (EG: RPi3)
RPi2B
-
Power supply used | (EG: 5V 1A RAVpower)
Redmi 5V 3A
-
SD card used | (EG: SanDisk ultra)
Sandisk Ultra
Additional Information (if applicable)
- Tried
dietpi-software uninstall 60
- Also tried
systemctl mask --now hostapd isc-dhcp-server
Steps to reproduce
- Use dietpi normally
- Try to make a hotspot
- Realise you installed hotspot software for nothing since adapter isn’t compatible
- Forget about it and don’t use it for over 2 years
Expected behaviour
- Go to dietpi-config
- Go to network adapters
- Go to wifi
- Scan
Actual behaviour
- Go to dietpi-config
- Go to network adapters
- Go to wifi
- Get greeted with what looks like hotspot settings. Has a hotspot toggle, ssid, channel, key, country code and 802.11N toggle that throws and error.
Extra details
Welcome to our community.
Did you actually tried to remove the hotspot?
dietpi-software uninstall 60
Hi,
Edited my post but yes I did, didn’t do anything though.
Tried it again just in case I mistyped, but no, here’s the output
DietPi-Software | 60: WiFi Hotspot is not currently installed
DietPi-Software | No changes applied for: WiFi Hotspot
your system is quite old and I#m not sure which steps are done on your version to remove the hotspot. But I could share what is done on the current DietPi version
G_AGP hostapd isc-dhcp-server
rm /etc/dhcp/dhcpd.conf
rm /etc/hostapd/hostapd.conf
rm /etc/default/isc-dhcp-server
rm /etc/default/hostapd
rm /etc/iptables.ipv4.nat
rm /etc/iptables.ipv6.nat
rm /usr/sbin/hostapd
rm /usr/sbin/hostapd_cli
rm /etc/sysctl.d/dietpi-wifihotspot.conf
- Set WiFi interface back to inactive
sed -Ei '/(allow-hotplug|auto)[[:blank:]]+wlan/q0' /etc/network/interfaces
sed -i "/allow-hotplug wlan/c\#allow-hotplug wlan0" /etc/network/interfaces
- Add default WiFi settings to network interfaces config
cat << _EOF_ >> /etc/network/interfaces
iface wlan0 inet dhcp
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 9.9.9.9 149.112.112.112
wireless-power off
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
_EOF_
iptables -F
iptables -t nat -F
ip6tables -F
ip6tables -t nat -F
reboot
Hopefully that’s gonna work somehow
0 files deleted, don’t know if I should be surprised
Although it fixed my issue right away, thanks.
Follow up.
Connecting to my phone’s hotspot worked well, but DHCP doesn’t seem to do its job correctly.
It connects, tries to do something, and disconnects.
I used Termux to know my phone’s wlan0 IP so I could change the default DHCP gateway.
Switched to static on the RPi and kept the IP it was given.
Default gateway was 192.168.1.1 when my phone’s and RPi IPs are 192.168.246.X, isn’t that weird?
Also 127.0.0.1 was the default DNS, which I also tried to change for Cloudflare’s but to no avail.
Am I doing something wrong or am I doomed?
EDIT : Gateway and DNS doesn’t get changed even though they are set to static and changed to something else.
/etc/network/interfaces
have custom gateway and DNS but dietpi-config says otherwise.
can you share content of your interface file
cat /etc/network/interfaces
cat /etc/resolv.conf
ip a; ip r
/etc/network/interfaces
contains exactly what I configured in dietpi-config. Static IP, mask, gateway, DNS, and wpa-conf.
/etc/resolv.conf
however has a single line : nameserver 127.0.0.1
I tried changing it (with and without reboot) but didn’t do anything.
ip a;ip r
doesn’t reveal anything out of the ordinary. It has the correct IP, broadcast IP and gateway.
Quick edit : Nevermind, I had the wrong gateway IP the whole time.
After correcting it and using nano /etc/resolv.conf
to change the DNS to 1.1.1.1, it works.
Now I should find a way to either change the file to be read-only or a cron job to change it at boot.
you can check following as well
dpkg -l resolv*
maybe one more package to be removed.
Or dpkg -l openresolv
. That one somehow insists to set 127.0.0.1
as local resolver when one if found, even when it’s aimed to be used by network clients only, like Pi-hole, AGH, dnsmasq, Unbound and such.
Only had resolvconf
which I uninstalled.
And after swapping back to DHCP, it’s working just fine !
Only downside is that I can’t really change DNS because it points to my phone, but it’s really not that big of a deal.