Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | WiFi HotSpot not working on RPi B (armv6l) - #2531

Closed
marcobrianza opened this issue Feb 10, 2019 · 40 comments
Closed

DietPi-Software | WiFi HotSpot not working on RPi B (armv6l) - #2531

marcobrianza opened this issue Feb 10, 2019 · 40 comments
Assignees
Labels
ARMv6 External bug 🐞 For bugs which are not caused by DietPi. Raspberry Pi Solution available 🥂 Definite solution has been done
Milestone

Comments

@marcobrianza
Copy link

Creating a bug report/issue

Required Information

  • DietPi version | cat /DietPi/dietpi/.version
    G_DIETPI_VERSION_CORE=6
    G_DIETPI_VERSION_SUB=21
    G_DIETPI_VERSION_RC=1
    G_GITBRANCH=master
    G_GITOWNER=Fourdee

  • Distro version | echo $G_DISTRO_NAME or cat /etc/debian_version
    9.6

  • Kernel version | uname -a
    Linux DietPi 4.14.79+ Letsencrypt supports Free Noip.com Dynamic DNS #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/Linux

  • SBC device | echo $G_HW_MODEL_DESCRIPTION or (EG: RPi3)
    RPi B (armv6l)

  • Power supply used | (EG: 5V 1A RAVpower)
    original Raspberry power supply

  • SDcard used | (EG: SanDisk ultra)
    Sandisk Extreme 16GB

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
    WiFi Hotspot

  • Was the software title installed freshly or updated/migrated?
    freshly installed

  • Can this issue be replicated on a fresh installation of DietPi?
    yes.

  • dietpi-bugreport ID | sed -n 5p /DietPi/dietpi/.hw_model

Steps to reproduce

hostapd service does not start

running : hostapd -d /etc/hostapd/hostapd.conf
I get:
Illegal instruction

Expected behaviour

the service should run

Actual behaviour

  • ...

Extra details

it look like the hostapd binary is for the armv7

@MichaIng
Copy link
Owner

MichaIng commented Feb 11, 2019

@marcobrianza
Thanks for your report.

Indeed we replace the hostapd binary from Raspbian APT repo by an own compiled one that obviously has/had better WiFi device support. But we use ARMv6 binaries in case: https://github.com/Fourdee/DietPi/blob/master/dietpi/dietpi-software#L5006-L5027
Just checked, ours is a newer version than provided by Debian/Raspbian Stretch (v2,5 vs v2.4): https://packages.debian.org/stretch/hostapd
However perhaps those need to be redone/rechecked on RPi 1. Also v2.7 is available now.

Meanwhile you could try it with the APT repo binary. I am just afraid that it might overwrite some of our custom configs.. although should not: apt install --reinstall hostapd

@Fourdee
Do you have a chance to replicate on RPi 1 (B)?

@Fourdee Fourdee added this to the v6.22 milestone Feb 11, 2019
@MichaIng MichaIng changed the title WiFi HotSpot not working on RPi B (armv6l) - DietPi-Software | WiFi HotSpot not working on RPi B (armv6l) - Mar 2, 2019
@MichaIng MichaIng modified the milestones: v6.22, v6.23 Mar 9, 2019
@dashingdon
Copy link

dashingdon commented Mar 22, 2019

I have exact same issue. if need be , I can open another issue but here are my details

Fresh dietpi install
`

Details:

  • Date | Thu 21 Mar 19:55:46 PDT 2019
  • Bug report | N/A
  • DietPi version | v6.21.1 (MichaIng/master)
  • Img creator | DietPi Core Team
  • Pre-image | Raspbian Lite
  • SBC device | RPi B (armv6l) (index=1)
  • Kernel version | Request | RT Kernel option #1200 Tue Feb 12 20:11:02 GMT 2019
  • Distro | stretch (index=4)
  • Command | systemctl start hostapd
  • Exit code | 1
  • Software title | DietPi-Config

Additional logs:

Log file contents:
Job for hostapd.service failed because a fatal signal was delivered to the control process.
See "systemctl status hostapd.service" and "journalctl -xe" for details.

[FAILED] DietPi-Config | Unable to continue, DietPi-Config will now terminate.

root@DietPi:/etc/hostapd# systemctl status hostapd.service
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/hostapd.service.d
   Active: activating (auto-restart) (Result: signal) since Thu 2019-03-21 19:56:00 PDT; 5s ago
  Process: 2672 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=kill
ed, signal=ILL)
      CPU: 21ms

Mar 21 19:56:00 DietPi systemd[1]: hostapd.service: Control process exited, code=killed status=4
Mar 21 19:56:00 DietPi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Mar 21 19:56:00 DietPi systemd[1]: hostapd.service: Unit entered failed state.
Mar 21 19:56:00 DietPi systemd[1]: hostapd.service: Failed with result 'signal'.

[Edit] Using USB Wifi. Output of lsusb

Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

@MichaIng
Copy link
Owner

@dashingdon
Did you try to use the binary from the Debian repo?
apt install --reinstall hostapd

@dashingdon
Copy link

Yes. I did. No success.

@MichaIng
Copy link
Owner

@dashingdon
Okay, we need to to some research then. Either some kernel/system setting is missing or we simply need to update the hostapd binary to support a wider range of WiFi devices. Not sure currently if sort of AP drivers are included or such.

@dashingdon
Copy link

dashingdon commented Mar 22, 2019

Thanks @MichaIng Seems like something to do with Realtek RTL8188CUS driver. I found few articles where people have provided recompiled drivers. I tried but still not luck.

Just for your reference on what all I tried

jenssegers Version

daveconroy version

PlantDaddy version - I have no idea how to use this Instructions

raspberry-at-home.com - Script in the last section is useful

This has become a royal pain and I thought it would be a walk in the park 😄

Great job on dietpi otherwise. simply loving it. ❇️

@MichaIng
Copy link
Owner

MichaIng commented Mar 22, 2019

@dashingdon

PlantDaddy version - I have no idea how to use this

There are pre-compiled armhf binaries that you can simply use to overwrite the existing ones:

wget https://github.com/PlantDaddy/hostapd-rtl8188/raw/master/hostapd/hostapd -O $(which hostapd)
wget https://github.com/PlantDaddy/hostapd-rtl8188/raw/master/hostapd/hostapd_cli -O $(which hostapd_cli)

@MichaIng MichaIng added External bug 🐞 For bugs which are not caused by DietPi. and removed Waiting for user reply ⏳ Testing/testers required 🔽 labels Mar 22, 2019
@dashingdon
Copy link

No Luck. Same result as My original post

Happy to help test if needed.

@whatsupskip
Copy link

I have hit the same problem with RPi Zero W using the built in WiFi adapter.

@MichaIng
Copy link
Owner

MichaIng commented Apr 6, 2019

@whatsupskip
Does the original Debian package work in your case?
apt install --reinstall hostapd

@whatsupskip
Copy link

@MichaIng Yes, apt install --reinstall hostapd fixed it. Thank you!

I had previously tried uninstalling it and reinstalling it, but I think that changed some of the settings that shouldn't have been changed.

@MichaIng
Copy link
Owner

MichaIng commented Apr 7, 2019

@whatsupskip
Thanks for testing and reporting back. DietPi-Software installs currently on RPi indeed an older version of hostapd which seems to not (yet) support the WiFi card.

Background:

So at least on Raspberry Pi's we need to revert to APT repo package.

@MichaIng
Copy link
Owner

MichaIng commented Apr 7, 2019

@dashingdon
Btw. we also ship a fixed version for RTL8188C* chips that do not work with native hostapd: https://github.com/MichaIng/DietPi/blob/master/dietpi/dietpi-software#L5010-L5015
And ours is with v2.5 newer than the ones you linked.

https://github.com/PlantDaddy/hostapd-rtl8188 => v2.4
https://docs.google.com/document/d/16hJS7fnPyKUwbvR33_nMku_b6XcYaBJXVpeCIMoJzcQ/pub => v2.0
https://daveconroy.com/how-to/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/ => Download link not functional but since from 2013 it should be the oldest version.

Can you please uninstall and reinstall WiFi Hotspot via dietpi-software and then run and paste output of: hostapd -d /etc/hostapd/hostapd.conf

@dashingdon
Copy link

dashingdon commented Apr 7, 2019

Output of hostapd -d /etc/hostapd/hostapd.conf

root@DietPi:~# hostapd -d /etc/hostapd/hostapd.conf
Illegal instruction

Error Log :

`
FAILED] DietPi-Config | systemctl start hostapd



Details:

  • Date | Sat 6 Apr 20:51:36 PDT 2019
  • Bug report | N/A
  • DietPi version | v6.22.3 (MichaIng/master)
  • Img creator | DietPi Core Team
  • Pre-image | Raspbian Lite
  • SBC device | RPi B (armv6l) (index=1)
  • Kernel version | Request | RT Kernel option #1200 Tue Feb 12 20:11:02 GMT 2019
  • Distro | stretch (index=4)
  • Command | systemctl start hostapd
  • Exit code | 1
  • Software title | DietPi-Config

Additional logs:

Log file contents:
Job for hostapd.service failed because a fatal signal was delivered to the control process.
See "systemctl status hostapd.service" and "journalctl -xe" for details.

[FAILED] DietPi-Config | Unable to continue, DietPi-Config will now terminate.

`

Output of systemctl status hostapd.service

root@DietPi:~# systemctl status hostapd.service
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: signal) since Sat 2019-04-06 20:55:50 PDT; 633ms ago
Process: 2608 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=kill
ed, signal=ILL)

Apr 06 20:55:50 DietPi systemd[1]: hostapd.service: Control process exited, code=killed status=4
Apr 06 20:55:50 DietPi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP A
uthenticator.
Apr 06 20:55:50 DietPi systemd[1]: hostapd.service: Unit entered failed state.
Apr 06 20:55:50 DietPi systemd[1]: hostapd.service: Failed with result 'signal'.

`
Output of journalctl -xe

Logs begin at Thu 2016-11-03 10:16:44 PDT, end at Sat 2019-04-06 20:58:48 PDT. --
Apr 06 20:53:28 DietPi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Subject: Unit hostapd.service has finished shutting down
Defined-By: systemd
Support: https://www.debian.org/support

--

Unit hostapd.service has finished shutting down.
Apr 06 20:53:28 DietPi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Subject: Unit hostapd.service has begun start-up
Defined-By: systemd
Support: https://www.debian.org/support

--
Unit hostapd.service has begun starting up.
Apr 06 20:53:28 DietPi systemd[1]: hostapd.service: Control process exited, code=killed status=4
Apr 06 20:53:28 DietPi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Subject: Unit hostapd.service has failed
Defined-By: systemd
Support: https://www.debian.org/support

Unit hostapd.service has failed.

-- The result is failed.

Apr 06 20:53:28 DietPi systemd[1]: hostapd.service: Unit entered failed state.
Apr 06 20:53:28 DietPi systemd[1]: hostapd.service: Failed with result 'signal'.
Apr 06 20:53:30 DietPi systemd[1]: hostapd.service: Service hold-off time over, scheduling restart.
Apr 06 20:53:30 DietPi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.

@dashingdon
Copy link

hostapd.conf

interface=wlan0
driver=rtl871xdrv
ssid=wifi
hw_mode=g
channel=12
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=YourPassPhrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

@MichaIng
Copy link
Owner

MichaIng commented Apr 7, 2019

@dashingdon
Hmm, illegal instructions as well. Actually this error typically shows up when using a binary for wrong architecture. I just rechecked the binary set we ship and the armv6 binaries are larger then the armv7 are, while it's typically (but not always) the other way round. Since both yours devices are armv6 and those binaries would work on armv7 as well, and just to sort out that we mixed them up, could you please try with the following (this is our rtl8188c armv7 binary):
hostapd.zip

wget https://github.com/MichaIng/DietPi/files/3051589/hostapd.zip
unzip hostapd.zip
rm hostapd.zip
cp -a $(command -v hostapd) hostapd_bak
mv hostapd $(command -v hostapd)
chmod +x $(command -v hostapd)
hostapd -d /etc/hostapd/hostapd.conf

@MichaIng MichaIng added this to the v6.29 milestone Jan 3, 2020
@MichaIng MichaIng modified the milestones: v6.29, v6.30 Mar 19, 2020
@bowiz2
Copy link

bowiz2 commented Mar 22, 2020

@MichaIng

So with "This" you mean running the Raspbian APT repo hostapd binary (apt install --reinstall hostapd) with driver=nl80211 works well on Raspbian but not on DietPi?

On the most recent version of dietpi (flashed today), and with no other software. Raspberrpi Pi 1B with a Edimax EW-7811Un dongle, which should be using RTL8188CUS.

At first, got the same "Invalid Instruction" and "Could not find driver" errors. Did those two steps, and hostapd runs without issue.
Still can't vouch for long term stability, but I'll check back in a few days and let you know if anything goes wrong.

If there's anything you want me to check/verify, just let me know!

MichaIng added a commit that referenced this issue Mar 22, 2020
+ DietPi-Software | WiFi Hotspot: Exclude RPi when installing our self-compiled RTL8188C-compatible hostapd binaries, since compatible binaries are shipped with archive.raspberrypi.org: #2531
@MichaIng
Copy link
Owner

I exclude RPi now for our self-compiled RTL binaries: c63fa4f
Enough reports that the RPi repo drivers work with RTL8188C* adapters already.

@MichaIng MichaIng modified the milestones: v6.30, v6.31 May 10, 2020
@MichaIng MichaIng modified the milestones: v6.31, v6.32 Jun 24, 2020
@sphh
Copy link

sphh commented Jun 28, 2020

I had the same or similar problem on my RPi1 during a fresh install on a RPi 1 with an Edimax EW-7811UN USB dongle: I enabled the WiFi Hotspot, everything was downloaded, installed and configured automatically. But the hostapd service failed to start. Luckily I was just watching that DietPi added the line driver=rtl871xdrv to the /etc/hostapd/hostapd.conf file. After commenting out this line (because I knew from Raspbian, that this does not work), and everything works.

This might or might not be related to the above problem ...

Required Information

  • DietPi version | cat /boot/dietpi/.version:
G_DIETPI_VERSION_CORE=6
G_DIETPI_VERSION_SUB=30
G_DIETPI_VERSION_RC=0
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
  • Distro version | echo $G_DISTRO_NAME or cat /etc/debian_version:
    buster or 10.4
  • Kernel version | uname -a:
    Linux DietPi 4.19.118+ #1311 Mon Apr 27 14:16:15 BST 2020 armv6l GNU/Linux
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3): 1

Additional Information (if applicable)

  • Was the software title installed freshly or updated/migrated? Freshly installed
  • Can this issue be replicated on a fresh installation of DietPi?: YES

@MichaIng
Copy link
Owner

Interesting actually, since AFAIK on Raspbian that entry should not be added anymore 🤔.

... checked, ah nope actually we do not install our special Realtek binaries on RPi anymore but still apply the setting.

@sphh
Could you please run the following and paste the output?

lsusb
G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf
hostapd

To revert to functional config:

G_CONFIG_INJECT 'driver=' 'driver=nl80211' /etc/hostapd/hostapd.conf

@sphh
Copy link

sphh commented Jun 28, 2020

lsusb:

Bus 001 Device 006: ID 4852:0006  
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 008: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf:

[  OK  ] G_CONFIG_INJECT | Comment in /etc/hostapd/hostapd.conf converted to setting: driver=rtl871xdrv

hostapd /etc/hostapd/hostapd.conf:

Configuration file: /etc/hostapd/hostapd.conf
Line 2: invalid/unknown driver 'rtl871xdrv'
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Failed to set up interface with /etc/hostapd/hostapd.conf
Failed to initialize interface

@MichaIng
Copy link
Owner

MichaIng commented Jun 28, 2020

Okay great, many thanks:

Line 2: invalid/unknown driver 'rtl871xdrv'

That clarifies that the RPi binary did not add the Realtek driver but either patched the nl80211 driver to support those RTL boards or something like that. I'll prevent the driver switch on RPi, lets hope this does not cause opposite reports as if deeper differentiation would be required 😅.

Done: e1c88c3

MichaIng added a commit that referenced this issue Jun 28, 2020
+ DietPi-Software | WiFi Hotspot: In case of RTL8188C* adapter on RPi, stay with default driver, since the issue seems to have been resolved differently and "rtl871xdrv" is not supported: #2531 (comment)
@sphh
Copy link

sphh commented Jun 28, 2020

Thanks!!!

@MichaIng MichaIng modified the milestones: v6.32, v6.33, v6.31 Aug 27, 2020
@MichaIng
Copy link
Owner

I mark this as solved. Compared to the Debian hostapd binary, the one from the RPi foundation indeed seems to support (most of) those, especially since RPi Zero W has an RTL8188 WiFi chip as well.

@Joulinar
Copy link
Collaborator

@MichaIng
can you have a look to this forum post. It's fitting to this issue https://dietpi.com/phpbb/viewtopic.php?f=11&t=8318

@MichaIng
Copy link
Owner

MichaIng commented Nov 28, 2020

Indeed, the driver is applied exactly the opposite way as intended (on all RPi only instead of on all BUT RPi). Should be fixed now (see forum thread).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMv6 External bug 🐞 For bugs which are not caused by DietPi. Raspberry Pi Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

8 participants