rock64 -> wifi-hotspot -> Unable to locate package hostapt-realtek

Trying to install WIFI Hotspot. Always getting the error message:

Unable to locate package hostapt-realtek


Tried it a couple of times within the last five days. Always the same error message.

Hi,

many thanks for your message. Looks like the apt package hostapt-realtek is not available or even exist. It’s specifically added for Realtek RTL8188C* device.

MichaIng
Pls can you have a look.

I found out there is a package aviable by the name hostapd-realtek, but not hostapt-realtek aviable like the script tries to install. I guess a typo in the filename or in the installation script?

could be. Once you hit by the error you get an error handle screen. There you have a possibility to change command. Can you try to change to hostapd-realtek and see if it is working??

Indeed a typo, many thanks for reporting it! I wonder how this could have survived so long as it’s there for a few version already. Probably because of the rare combination with RTL8188C* WiFi chips and Armbian-based images (user counts) :roll_eyes:.
Fixed for v6.35: https://github.com/MichaIng/DietPi/commit/57326c7d98ee3c56fd22cc5ab2de82c6b84699d7
Changelog: https://github.com/MichaIng/DietPi/commit/364c32248d603010b4c70ad9e2c6e94b545d87f5

Quick fix:

sed -i 's/hostapt-realtek/hostapd-realtek/' /boot/dietpi/dietpi-software

This worked so far. WIFI Hotspot installs and is aviable in config after reboot. Now there is an other problem when I try to start the hotspot.

hi can you try to typ on command line systemctl status host and than use TAB to autocomplete the line. Probably it will give something.

Interesting, the package does not contain any service file. Please do the following (can be done from sub shell from the error prompt as well):

cat << '_EOF_' > /etc/systemd/system/hostapd.service
[Unit]
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
After=network.target

[Service]
Type=forking
PIDFile=/run/hostapd.pid
Restart=on-failure
RestartSec=2
Environment=DAEMON_CONF=/etc/hostapd/hostapd.conf
EnvironmentFile=-/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

[Install]
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload

MichaIng
Means we would need to check for the availability of a service file and if not present, create our own one

Yes, at least when this package is installed. Although I recognised that the regular hostapd package from Armbian repo as well does not contain a systemd unit (like the Debian package) but an init.d service at least. To assure that we have the same service file in all cases, probably we should install it in every case if /lib/systemd/system/hostapd.service is not present at the end of WiFi Hotspot install step.

Did it, produced a new error:

  • Error log: │
    │ Job for hostapd.service failed because the control process exited with error code. │
    │ See “systemctl status hostapd.service” and “journalctl -xe” for details.

if I do so, system responds:

root@DietPi:~# systemctl status hostapd.service
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/etc/systemd/system/hostapd.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2021-01-15 14:50:11 GMT; 1s ago
Process: 1743 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, sta
tus=1/FAILURE)

and

– The unit hostapd.service has entered the ‘failed’ state with result ‘exit-code’.
Jan 15 14:50:56 DietPi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2
/EAP Authenticator.
– Subject: A start job for unit hostapd.service has failed

:sunglasses:

pls can you post journalctl -u hostapd

Additionally, try to execute the binary manually from console and see what it tells: hostapd

Probably we should remove the usage of that package completely. The version anyway starts to become ancient (v2.5 compared to v2.7 on Buster and 2.9 on Bullseye) and it is not possible to build a newer version for RTL8188C* chips, at least with the method I know.

… ah nope, v2.6 would work at least: https://github.com/pritambaral/hostapd-rtl871xdrv

But the issue remains that this always only works for a specific hostapd version until someone patches a never version. If Realtek does not manage or want to implement their driver with full support for hostapd into mainline kernel, we probably need to simply warn users who try to install it on those chips (aside of RPi onboard WiFi). There are a few other cases/chips which simply do not support hostapd, so there never was a guarantee.