Problems to get hostapd up and running with external wifi adapter

Dear readers,

I have problems to get my hostapd up and running with an external wifi adapter as described below.
Any help to solve the problem is more then welcome.

With many thanks in advance,
wimduk

The problem

  1. I installed and configured hostapd on my Raspberry 3B+ and every thing worked as aspected.
  2. The wifi range was not suitable for me, so I connected a long range wifi adapter Alfa AWUS036NHR, chipset RTL8188RU
  3. Updated hostapd.conf : interface=wlan0 → interface=wlan1 → rebooted the system
  4. hostapd does not work properly
    4.1 selecting wifi network and password : → OK
    4.2 the obtaining IP process : → remain in a loop.
  5. systemctl status hostapd gives wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE (see below)

Actions and commands

sudo lsusb (subset)
Bus 001 Device 004: ID 0bda:817f Realtek Semiconductor Corp. RTL8188RU 802.11n WLAN Adapter : Alfa long range adapter
Bus 001 Device 006: ID 0781:5591 SanDisk Corp. Ultra Flair				    : Dietpi OS + 45GB Data (USB-stick)
Bus 001 Device 005: ID 248a:8367 Maxxter Telink Wireless Receiver 			    : Onboard wifi chip
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
4: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000    link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
ip a show up
wlan1: did NOT show up, I changed /etc/hostapd/hostapd.conf: interface=wlan0 –> wlan1
ip a show up (just wlan)
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:08:69:c4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.1/24 brd 192.168.42.255 scope global wlan0
       valid_lft forever preferred_lft forever
4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2c0:caff:fe6b:1d0b/64 scope link 
       valid_lft forever preferred_lft forever

Remarks wlan1
1. In the wlan1 entry does not contain a IP address, but inet6 fe80::2c0:caff:fe6b:1d0b/64 scope link
2. If I connect to the hotspot the message “obtain IP address” continuously.

systemctl status hostapd
Found in Dietpi database https://dietpi.com/forum/t/wifi-hotspot/3014/13 and executed systemctl status hostapd
● hostapd.service - Access point and authentication server for Wi-Fi and Ethernet
     Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-07-18 09:30:43 CEST; 1min 12s ago
       Docs: man:hostapd(8)
    Process: 682 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
   Main PID: 723 (hostapd)
      Tasks: 1 (limit: 779)
        CPU: 567ms
     CGroup: /system. Slice/hostapd.service
             └─723 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

jul 18 09:30:40 rasp3b systemd[1]: Starting hostapd.service - Access point and authentication server for Wi-Fi and Ethernet...
jul 18 09:30:43 rasp3b hostapd[682]: wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
jul 18 09:30:43 rasp3b systemd[1]: Started hostapd.service - Access point and authentication server for Wi-Fi and Ethernet.

Required Information

 cat /boot/dietpi/.version : G_LIVE_PATCH_STATUS[0]='not applicable'
 echo $G_DISTRO_NAME $G_RASPBIAN : bookworm 0
 uname --all : Linux rasp3b 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
 dpkg --print-architecture : arm64
 echo $G_HW_MODEL_NAME :RPi 3 Model B+ (aarch64)

pls can you reboot your system and share following afterwards

journalctl -u hostapd

I assume you have used our DietPi hotspot configuration? Is that correct? The challenge is that our installation and configuration scripts do not currently support wlan1. A few manual adjustments are required if you really want to use both WiFi adapters at the same time. If not needed, I would disable the internal WiFi interface. This way your external adapter should become wlan0.

BTW: you are sure your external adapter is supporting AP mode?

Thank you very much for your fast reply Joulinar,
Yes I did the installation with the Dietpi-software package
The outcome of journalctl -u hostapd is :

sudo journalctl -u hostapd
[sudo] wachtwoord voor wim: 
jul 18 11:58:23 rasp3b systemd[1]: Starting hostapd.service - Access point and authentication server for Wi-Fi and Ethernet...
jul 18 11:58:26 rasp3b hostapd[678]: wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
jul 18 11:58:26 rasp3b systemd[1]: Started hostapd.service - Access point and authentication server for Wi-Fi and Ethernet.

regards :raising_hand_man: wimduk

can you share following. Could be a long output.

iw list

As well, do you need both WiFi adapter (intern + extern) online same time?

and one more to check

journalctl -u isc-dhcp-server.service

No,I just need a cable and a wifi connection with a long range.
The internal wifi is too weak for my reguirements because we live in a big house (former B&B). So if the external wifi works I do not use the internal wifi anymore.
Requested outcomes.

sudo iw list
[sudo] wachtwoord voor wim: 
Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 4
	max scan IEs length: 2257 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	RTS threshold: 2347
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports RSN-IBSS.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP-128 (00-0f-ac:4)
		* CCMP-256 (00-0f-ac:10)
		* GCMP-128 (00-0f-ac:8)
		* GCMP-256 (00-0f-ac:9)
		* CMAC (00-0f-ac:6)
		* CMAC-256 (00-0f-ac:13)
		* GMAC-128 (00-0f-ac:11)
		* GMAC-256 (00-0f-ac:12)
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
		 * P2P-client
		 * P2P-GO
	Band 1:
		Capabilities: 0x186e
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			No RX STBC
			Max AMSDU length: 7935 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 16 usec (0x07)
		HT Max RX data rate: 150 Mbps
		HT TX/RX MCS rate indexes supported: 0-7, 32
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps
			* 5.5 Mbps
			* 11.0 Mbps
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 2412 MHz [1] (20.0 dBm)
			* 2417 MHz [2] (20.0 dBm)
			* 2422 MHz [3] (20.0 dBm)
			* 2427 MHz [4] (20.0 dBm)
			* 2432 MHz [5] (20.0 dBm)
			* 2437 MHz [6] (20.0 dBm)
			* 2442 MHz [7] (20.0 dBm)
			* 2447 MHz [8] (20.0 dBm)
			* 2452 MHz [9] (20.0 dBm)
			* 2457 MHz [10] (20.0 dBm)
			* 2462 MHz [11] (20.0 dBm)
			* 2467 MHz [12] (20.0 dBm)
			* 2472 MHz [13] (20.0 dBm)
			* 2484 MHz [14] (disabled)
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * new_station
		 * new_mpath
		 * set_mesh_config
		 * set_bss
		 * authenticate
		 * associate
		 * deauthenticate
		 * disassociate
		 * join_ibss
		 * join_mesh
		 * remain_on_channel
		 * set_tx_bitrate_mask
		 * frame
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * probe_client
		 * set_noack_map
		 * register_beacons
		 * start_p2p_device
		 * set_mcast_rate
		 * connect
		 * disconnect
		 * set_qos_map
		 * set_multicast_to_unicast
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
	interface combinations are not supported
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Device supports TX status socket option.
	Device supports HT-IBSS.
	Device supports SAE with AUTHENTICATE command
	Device supports low priority scan.
	Device supports scan flush.
	Device supports AP scan.
	Device supports per-vif TX power setting
	Driver supports full state transitions for AP/GO clients
	Driver supports a userspace MPM
	Device supports configuring vdev MAC-addr on create.
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0x40 0xb0 0xc0 0xd0
		 * managed: 0x40 0xb0 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * mesh point: 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-device: 0x40 0xd0
	Supported extended features:
		* [ RRM ]: RRM
		* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
		* [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
		* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
		* [ DEL_IBSS_STA ]: deletion of IBSS station support
		* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
		* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
Wiphy phy1
	wiphy index: 1
	max # scan SSIDs: 10
	max scan IEs length: 2048 bytes
	max # sched scan SSIDs: 16
	max # match sets: 16
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports roaming.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP-128 (00-0f-ac:4)
		* CMAC (00-0f-ac:6)
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * P2P-client
		 * P2P-GO
		 * P2P-device
	Band 1:
		Capabilities: 0x1062
			HT20/HT40
			Static SM Power Save
			RX HT20 SGI
			RX HT40 SGI
			No RX STBC
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 16 usec (0x07)
		HT TX/RX MCS rate indexes supported: 0-7
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps (short preamble supported)
			* 5.5 Mbps (short preamble supported)
			* 11.0 Mbps (short preamble supported)
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 2412 MHz [1] (20.0 dBm)
			* 2417 MHz [2] (20.0 dBm)
			* 2422 MHz [3] (20.0 dBm)
			* 2427 MHz [4] (20.0 dBm)
			* 2432 MHz [5] (20.0 dBm)
			* 2437 MHz [6] (20.0 dBm)
			* 2442 MHz [7] (20.0 dBm)
			* 2447 MHz [8] (20.0 dBm)
			* 2452 MHz [9] (20.0 dBm)
			* 2457 MHz [10] (20.0 dBm)
			* 2462 MHz [11] (20.0 dBm)
			* 2467 MHz [12] (20.0 dBm)
			* 2472 MHz [13] (20.0 dBm)
			* 2484 MHz [14] (disabled)
	Band 2:
		Capabilities: 0x1062
			HT20/HT40
			Static SM Power Save
			RX HT20 SGI
			RX HT40 SGI
			No RX STBC
			Max AMSDU length: 3839 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 16 usec (0x07)
		HT TX/RX MCS rate indexes supported: 0-7
		VHT Capabilities (0x00001020):
			Max MPDU length: 3895
			Supported Channel Width: neither 160 nor 80+80
			short GI (80 MHz)
			SU Beamformee
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: not supported
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT RX highest supported: 0 Mbps
		VHT TX MCS set:
			1 streams: MCS 0-9
			2 streams: not supported
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT TX highest supported: 0 Mbps
		VHT extended NSS: not supported
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5170 MHz [34] (disabled)
			* 5180 MHz [36] (20.0 dBm)
			* 5190 MHz [38] (disabled)
			* 5200 MHz [40] (20.0 dBm)
			* 5210 MHz [42] (disabled)
			* 5220 MHz [44] (20.0 dBm)
			* 5230 MHz [46] (disabled)
			* 5240 MHz [48] (20.0 dBm)
			* 5260 MHz [52] (20.0 dBm) (no IR, radar detection)
			* 5280 MHz [56] (20.0 dBm) (no IR, radar detection)
			* 5300 MHz [60] (20.0 dBm) (no IR, radar detection)
			* 5320 MHz [64] (20.0 dBm) (no IR, radar detection)
			* 5500 MHz [100] (20.0 dBm) (no IR, radar detection)
			* 5520 MHz [104] (20.0 dBm) (no IR, radar detection)
			* 5540 MHz [108] (20.0 dBm) (no IR, radar detection)
			* 5560 MHz [112] (20.0 dBm) (no IR, radar detection)
			* 5580 MHz [116] (20.0 dBm) (no IR, radar detection)
			* 5600 MHz [120] (20.0 dBm) (no IR, radar detection)
			* 5620 MHz [124] (20.0 dBm) (no IR, radar detection)
			* 5640 MHz [128] (20.0 dBm) (no IR, radar detection)
			* 5660 MHz [132] (20.0 dBm) (no IR, radar detection)
			* 5680 MHz [136] (20.0 dBm) (no IR, radar detection)
			* 5700 MHz [140] (20.0 dBm) (no IR, radar detection)
			* 5720 MHz [144] (disabled)
			* 5745 MHz [149] (disabled)
			* 5765 MHz [153] (disabled)
			* 5785 MHz [157] (disabled)
			* 5805 MHz [161] (disabled)
			* 5825 MHz [165] (disabled)
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * join_ibss
		 * set_pmksa
		 * del_pmksa
		 * flush_pmksa
		 * remain_on_channel
		 * frame
		 * set_wiphy_netns
		 * set_channel
		 * start_sched_scan
		 * start_p2p_device
		 * connect
		 * disconnect
		 * crit_protocol_start
		 * crit_protocol_stop
		 * update_connect_params
	software interface modes (can always be added):
	valid interface combinations:
		 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
		   total <= 3, #channels <= 2
		 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
		   total <= 4, #channels <= 1
	Device supports scan flush.
	Device supports randomizing MAC-addr in sched scans.
	max # scan plans: 1
	max scan plan interval: 508
	max scan plan iterations: 0
	Supported TX frame types:
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * managed: 0x40 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-device: 0x40 0xd0
	Supported extended features:
		* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
		* [ 4WAY_HANDSHAKE_STA_PSK ]: 4-way handshake with PSK in station mode
		* [ 4WAY_HANDSHAKE_STA_1X ]: 4-way handshake with 802.1X in station mode
		* [ DFS_OFFLOAD ]: DFS offload
		* [ SAE_OFFLOAD ]: SAE offload support
		* [ 4WAY_HANDSHAKE_AP_PSK ]: AP mode PSK offload support
		* [ SAE_OFFLOAD_AP ]: AP mode SAE authentication offload support
sudo journalctl -u isc-dhcp-server.service
jul 18 11:58:23 rasp3b systemd[1]: Starting isc-dhcp-server.service - LSB: DHCP server...
jul 18 11:58:23 rasp3b isc-dhcp-server[679]: Launching IPv4 server only.
jul 18 11:58:24 rasp3b dhcpd[706]: Wrote 2 leases to leases file.
jul 18 11:58:26 rasp3b dhcpd[706]: Server starting service.
jul 18 11:58:28 rasp3b isc-dhcp-server[679]: Starting ISC DHCPv4 server: dhcpd.
jul 18 11:58:28 rasp3b systemd[1]: Started isc-dhcp-server.service - LSB: DHCP server.

ok AP mode seems to be supported by the external adapter. That’s good.

pls revert all changes you have done to /etc/hostapd/hostapd.conf. Once finished we should disable the internal adapter to avoid conflicts. It’s a RPi3 correct?

Yes it is a RPi3, and hereafter the hostapd.conf

interface=wlan0
driver=nl80211
ssid=DietPi-HotSpot
country_code=DE
hw_mode=g
channel=3
ieee80211n=0
ieee80211ac=0
ieee80211ax=0
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

ok let’s disable internal adapter and reboot

/boot/dietpi/func/dietpi-set_hardware wifimodules disable
reboot

and check some services once system is online again

ip a
journalctl _SYSTEMD_UNIT=hostapd.service + _SYSTEMD_UNIT=isc-dhcp-server.service

Joulinar herewith the results

wim@rasp3b:~$ sudo /boot/dietpi/func/dietpi-set_hardware wifimodules disable
[sudo] wachtwoord voor wim: 

 DietPi-Set_hardware
─────────────────────────────────────────────────────
 Mode: wifimodules (disable)

[  OK  ] DietPi-Set_hardware | Added setting dtoverlay=disable-wifi to end of file /boot/config.txt
[  OK  ] DietPi-Set_hardware | eval echo 'blacklist brcmutil' >> /etc/modprobe.d/dietpi-disable_wifi.conf
[  OK  ] DietPi-Set_hardware | modprobe -rf brcmutil
[  OK  ] DietPi-Set_hardware | eval echo 'blacklist brcmfmac' >> /etc/modprobe.d/dietpi-disable_wifi.conf
[  OK  ] DietPi-Set_hardware | modprobe -rf brcmfmac
[  OK  ] DietPi-Set_hardware | eval echo 'blacklist cfg80211' >> /etc/modprobe.d/dietpi-disable_wifi.conf
[  OK  ] DietPi-Set_hardware | modprobe -rf cfg80211
[  OK  ] wifimodules disable | Completed
wim@rasp3b:~$ 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
    inet6 ::1/128 scope host noprefixroute 
       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:5d:3c:91 brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.62/24 brd 192.168.188.255 scope global dynamic eth0
       valid_lft 859601sec preferred_lft 859601sec
    inet6 fe80::ba27:ebff:fe5d:3c91/64 scope link 
       valid_lft forever preferred_lft forever
4: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
wim@rasp3b:~$ sudo journalctl _SYSTEMD_UNIT=hostapd.service + _SYSTEMD_UNIT=isc-dhcp-server.service
jul 18 15:53:00 rasp3b isc-dhcp-server[644]: Launching IPv4 server only.
jul 18 15:53:00 rasp3b hostapd[643]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
jul 18 15:53:00 rasp3b dhcpd[673]: Wrote 2 leases to leases file.
jul 18 15:53:00 rasp3b dhcpd[673]: Server starting service.
jul 18 15:53:02 rasp3b isc-dhcp-server[644]: Starting ISC DHCPv4 server: dhcpd.
jul 18 16:08:34 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c IEEE 802.11: associated
jul 18 16:08:34 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c RADIUS: starting accounting session 2FB99D36F8D54C5D
jul 18 16:08:34 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c WPA: pairwise key handshake completed (RSN)
jul 18 16:08:34 rasp3b dhcpd[673]: DHCPDISCOVER from 04:b1:67:2d:f8:7c via wlan0
jul 18 16:08:35 rasp3b dhcpd[673]: DHCPOFFER on 192.168.42.10 to 04:b1:67:2d:f8:7c via wlan0
jul 18 16:08:35 rasp3b dhcpd[673]: DHCPREQUEST for 192.168.42.10 (192.168.42.1) from 04:b1:67:2d:f8:7c via wlan0
jul 18 16:08:35 rasp3b dhcpd[673]: DHCPACK on 192.168.42.10 to 04:b1:67:2d:f8:7c via wlan0
jul 18 16:33:07 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c IEEE 802.11: disassociated
jul 18 16:33:07 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c IEEE 802.11: disassociated
jul 18 16:34:02 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c IEEE 802.11: associated
jul 18 16:34:02 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c RADIUS: starting accounting session 190C2CA19C879A31
jul 18 16:34:02 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c WPA: pairwise key handshake completed (RSN)
jul 18 16:34:03 rasp3b dhcpd[673]: reuse_lease: lease age 1528 (secs) under 25% threshold, reply with unaltered, existing lease for 192.168.42.10
jul 18 16:34:03 rasp3b dhcpd[673]: DHCPDISCOVER from 04:b1:67:2d:f8:7c via wlan0
jul 18 16:34:03 rasp3b dhcpd[673]: DHCPOFFER on 192.168.42.10 to 04:b1:67:2d:f8:7c via wlan0
jul 18 16:34:03 rasp3b dhcpd[673]: reuse_lease: lease age 1528 (secs) under 25% threshold, reply with unaltered, existing lease for 192.168.42.10
jul 18 16:34:03 rasp3b dhcpd[673]: DHCPREQUEST for 192.168.42.10 (192.168.42.1) from 04:b1:67:2d:f8:7c via wlan0
jul 18 16:34:03 rasp3b dhcpd[673]: DHCPACK on 192.168.42.10 to 04:b1:67:2d:f8:7c via wlan0
jul 18 17:00:36 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c IEEE 802.11: disassociated
jul 18 17:00:36 rasp3b hostapd[669]: wlan0: STA 04:b1:67:2d:f8:7c IEEE 802.11: disassociated
jul 18 17:05:10 rasp3b dhcpd[673]: receive_packet failed on wlan0: Network is down
wim@rasp3b:~$

you did a reboot in between? Because it looks like not.

after reboot

wim@rasp3b:~$ 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
    inet6 ::1/128 scope host noprefixroute 
       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:5d:3c:91 brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.62/24 brd 192.168.188.255 scope global dynamic eth0
       valid_lft 863935sec preferred_lft 863935sec
    inet6 fe80::ba27:ebff:fe5d:3c91/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2c0:caff:fe6b:1d0b/64 scope link 
       valid_lft forever preferred_lft forever
wim@rasp3b:~$ sudo journalctl _SYSTEMD_UNIT=hostapd.service + _SYSTEMD_UNIT=isc-dhcp-server.service
[sudo] wachtwoord voor wim: 
jul 18 17:30:28 rasp3b isc-dhcp-server[628]: Launching IPv4 server only.
jul 18 17:30:29 rasp3b dhcpd[655]: Wrote 2 leases to leases file.
jul 18 17:30:31 rasp3b hostapd[627]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
jul 18 17:30:31 rasp3b dhcpd[655]: 
jul 18 17:30:31 rasp3b dhcpd[655]: No subnet declaration for wlan0 (no IPv4 addresses).
jul 18 17:30:31 rasp3b dhcpd[655]: ** Ignoring requests on wlan0.  If this is not what
jul 18 17:30:31 rasp3b dhcpd[655]:    you want, please write a subnet declaration
jul 18 17:30:31 rasp3b dhcpd[655]:    in your dhcpd.conf file for the network segment
jul 18 17:30:31 rasp3b dhcpd[655]:    to which interface wlan0 is attached. **
jul 18 17:30:31 rasp3b dhcpd[655]: 
jul 18 17:30:31 rasp3b dhcpd[655]: 
jul 18 17:30:31 rasp3b dhcpd[655]: Not configured to listen on any interfaces!
jul 18 17:30:31 rasp3b dhcpd[655]: 
jul 18 17:30:31 rasp3b dhcpd[655]: If you think you have received this message due to a bug rather
jul 18 17:30:31 rasp3b dhcpd[655]: than a configuration issue please read the section on submitting
jul 18 17:30:31 rasp3b dhcpd[655]: bugs on either our web page at www.isc.org or in the README file
jul 18 17:30:31 rasp3b dhcpd[655]: before submitting a bug.  These pages explain the proper
jul 18 17:30:31 rasp3b dhcpd[655]: process and the information we find helpful for debugging.
jul 18 17:30:31 rasp3b dhcpd[655]: 
jul 18 17:30:31 rasp3b dhcpd[655]: exiting.
jul 18 17:30:33 rasp3b isc-dhcp-server[628]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
jul 18 17:30:33 rasp3b isc-dhcp-server[628]:  failed!

hmm there is an IPv4 address missing on wlan0 now.

Can you check following

cat /etc/network/interfaces
cat /etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# 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 192.168.5.1

# WiFi
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
#gateway 192.168.0.1
#dns-nameservers 9.9.9.9 149.112.112.112
pre-up iw dev wlan0 set power_save off
post-down iw dev "wlan0 set power_save on

# iptables NAT rules
up iptables-restore < /etc/iptables.ipv4.nat
up ip6tables-restore < /etc/iptables.ipv6.nat

Just for the record, I did NOT uppdate the hoastapd.conf file so it still remains interface=wlan0

that’s ok, problem seems to be with wifi adapter as it doesn’t seems to be up correctly

can you check following

journalctl -u ifup@wlan0

and try manually running

ifdown wlan0
ifup wlan0
ip a

There might be a syntax error showing up. Just ignore it.

wim@rasp3b:~$ sudo journalctl -u ifup@wlan0
[sudo] wachtwoord voor wim: 
jul 18 17:30:02 rasp3b systemd[1]: Starting ifup@wlan0.service - ifup for wlan0...
jul 18 17:30:02 rasp3b ifup[521]: command failed: Operation not supported (-95)
jul 18 17:30:02 rasp3b ifup[513]: ifup: failed to bring up wlan0
jul 18 17:30:02 rasp3b systemd[1]: ifup@wlan0.service: Main process exited, code=exited, status=1/FAILURE
jul 18 17:30:02 rasp3b systemd[1]: ifup@wlan0.service: Failed with result 'exit-code'.
jul 18 17:30:02 rasp3b systemd[1]: Failed to start ifup@wlan0.service - ifup for wlan0.
wim@rasp3b:~$ sudo ifdown wlan0
ifdown: interface wlan0 not configured
wim@rasp3b:~$ ifup wlan0
-bash: ifup: opdracht niet gevonden
wim@rasp3b:~$ sudo ifup wlan0
command failed: Operation not supported (-95)
ifup: failed to bring up wlan0
wim@rasp3b:~$ 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
    inet6 ::1/128 scope host noprefixroute 
       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:5d:3c:91 brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.62/24 brd 192.168.188.255 scope global dynamic eth0
       valid_lft 859930sec preferred_lft 859930sec
    inet6 fe80::ba27:ebff:fe5d:3c91/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::2c0:caff:fe6b:1d0b/64 scope link 
       valid_lft forever preferred_lft forever

that’s the main issue to get the external interface up. @MichaIng any ideas why the external adapter is not working and giving Operation not supported (-95)

Does it work when you disable the hotsport service?

systemctl disable --now hostapd isc-dhcp-server
reboot
journalctl -u ifup@wlan0

If that works, can you try the follwing:

systemctl enable hostapd isc-dhcp-server
reboot

Now it should fail. But then try:

iw dev wlan0 set 4addr off
ifup --force wlan0

Good morning gents,

First of all:
I would like to thank you both for the great support you are giving me. That gives confidence!
For my understanding: are you trying to disable the onboard wifi chip and assign the external adapter as wlan0?
Today I am very busy so I will respond by the late afternoon.

Have a nice day and greets, wimduk

This we already did yesterday. However the external adapter has some challenges to get up correctly.