RT5370 USB WiFi dongle cannot be used as blue interface anymore

I have RPI 3B+ and I used it to test ipfire for a year. It had troubles for some time, I assume that filesystem at SD card was corrupted. I get new SD card and installed fresh IPfire. I used USB dongle RT5370 with hostapd in the past and it worked OK, I used it as blue interface. This setup doesn’t work anymore, CU 186 and CU 189 are the same, hostapd reports that there is no compatible WiFi card.

This is the USB dongle identified by lsusb, it was working few weeks ago, that is the same dongle.

148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

My setup is RED + GREEN + BLUE and all interfaces have assigned NIC card.

This is the message during boot that blue interface is not there

Could not find interface with address blue0 for wireless access point  [ FAIL ]
FAILURE:

You should not be reading this error message.

 It means that an unforeseen error took place in /etc/rc.d/rc3.d/S18hostapd, which exited with a return value of 1.

If you're able to track this error down to a bug in one of the files provided by ipfire, please be so kind to inform us at https://bugzilla.ipfire.org.

I was testing FriendlyELEC R2S few days ago and I tested several WiFi adapters from my collection. I was surprised that RT5370 was not working with FriendlyWrt on R2S, that really surprised me, because I used such USB dongle with RPI in the past and with Le Potato from LibreComputer, but in that case it is just a WiFi client…

I am not sure what is wrong with RT5370, maybe some change in new kernel? I know there were some bad error messages in the dmesg output generated by driver for RT5370.

Either the device you are using is not recognized at all due to wrong drivers / firmware or the “renaming process” (renaming wlan0 to blue0 for example) takes longer that it should so hostapd does not recognize the device when the service starts. (by the way, hostapd changed from 186 to 189, it’s 2.11 now).

Could you provide some output from the booting-process?

Go to IPFire-logs, check “kernel” in the drop-down menu and post the output from one boot-sequence.

Is the stick recognized at all? Try “lsusb” in the console.

Greetings

Alex

Usually this happens because its looking for the USB device on a different port that it looks for in the zone configuration.

go to zone configuration and unassign that port to blue, then unplug the usb, reboot, then go to the zone configuration page, plug in the interface, refresh the page, the usb device should show up but be unassigned, then assign it to the blue network and reboot and don’t unplug the usb device unless you want to do that over again. if you don’t have a free interface to assign blue, then you will have to run setup and remove the blue zone by changing the network to green-red, then plug in the USB wifi adapter and reboot and run setup from a root terminal and add back the blue network.

USB network devices should be always plugged into the same USB port. Since there isn’t plug-n-play user endpoints on Generic Linux.

This is not correct. The IPFire use the MAC Address to identify a Wlan device. This not depend on the used usb port at all.

1 Like

I see my mistake, I believe I was testing RTL8188CUS but I reported that RT5370. This is my big mistake. I use RTL8188CUS, that was WiFi that worked with RPI in the past. I played with several WiFi dongles and working on several issues at that time, it took me much longer than I expected and I just did it wrong… I use RT5370 in client mode only, I think it doesn’t support AP mode in Linux (but there was software for Windows that can can run it in SoftAP mode…; I never tried that)

I try it again, this time with FriendlyELEC R2S running IPfire CU189.

First, I tried to use USB dongle RTL8188CUS (TP-Link TL-WN725N V1.0) as red0 interface and it worked.

lsusb output:

ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

Second, I tried to use USB dongle as blue0 interface and I was able to enter Wireless Access Point menu but I was not able to start AP (hostapd).

When I tried to start hostapd from CLI, it was clear what is wrong:

[root@ffire ~]# /etc/init.d/hostapd start
Starting hostapd... 
Line 4: Invalid country_code '00'
Cannot enable IEEE 802.11d without setting the country_code
2 errors found in configuration file '/etc/hostapd.conf'
Failed to set up interface with /etc/hostapd.conf
Failed to initialize interface  

I changed country code from default 00 to correct country code and after that hostpad was started, it looks OK but there is no WiFi in the air…

It would be good that web form could check for country code, it was not clear that value 00 is wrong and I missed it…

Config looks OK, hostapd is running (green in web gui) but no WiFi.
When I run ifconfig, I see only red0, green0 and lo, when I run ifconfig blue0, I see blue0 interface, it has IP address.

I see that green0 and blue0 have broadcast address 0.0.0.0, is it OK? red0 has broadcast address limited to assigned network, (192.168.111.255) but this interface runs dhcp client. Broadcast address for red0 is OK, but I do not like green0 and blue0 (0.0.0.0)… But I see the same on my main router (IPfire) and it works OK…

Back to hostapd. It is not running, web form that reported it green was not correct.

[root@ffire ~]# /etc/init.d/hostapd start
Starting hostapd... 
blue0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
blue0: interface state COUNTRY_UPDATE->ACS
blue0: ACS-STARTED

[root@ffire ~]# /etc/init.d/hostapd restart
Stopping hostapd...    Not running.                                                                            [  OK  ]
Starting hostapd... 
blue0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
blue0: interface state COUNTRY_UPDATE->ACS
blue0: ACS-STARTED                                                                                             [  OK  ]

I can run this command again and again and WiFi is not working.

This is reported in dmesg:

...
[ 1181.562159] rtl8192cu: MAC auto ON okay!
[ 1181.598200] rtl8192cu: Tx queue select: 0x05
[ 1182.045546] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
[ 1182.045589] rtl8192c_common: Firmware is not ready to run!
[ 1207.641533] rtl8192cu: MAC auto ON okay!
[ 1207.676575] rtl8192cu: Tx queue select: 0x05
[ 1208.124046] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
[ 1208.124089] rtl8192c_common: Firmware is not ready to run!
[ 1964.597529] rtl8192cu: MAC auto ON okay!
[ 1964.632687] rtl8192cu: Tx queue select: 0x05
[ 1965.079796] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
[ 1965.079871] rtl8192c_common: Firmware is not ready to run!

After several tries I fixed it. Other problem was that channel was set to “AUTO”, the default value in the form. Trouble with this field is that in many cases there was no other option, that AUTO was the only value in the list. Sometimes I found there AUTO followed with channels 1-13… Once I changed channel configuration from AUTO to number, WiFi AP was started. This is a black magic… :frowning:

I am going to replicate this configuration with RPI…


I was so happy when I saw WiFi AP in the air that I forgot to test it. Another big mistake. BSID is visible but devices cannot connect to “blue” WiFi… :frowning: So, it is not working…

dmesg output:

[ 2564.608746] rtl8192c_common: chksum report fail! REG_MCUFWDL:0x00030000 .
[ 2564.608789] rtl8192c_common: Firmware is not ready to run!
[ 2605.152799] rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4
[ 2687.516557] rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4
[ 2727.109539] rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4
[ 2766.807460] rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4
[ 2805.787411] rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4

I am not sure but it is possible that even USB dongle RT5370 was working in my RPI as AP (blue) in the past. I did so many tests this week, I changed configuration several times and I am not sure what was the original configuration. To verify it, I has to install some older version of IPfire but it is a lot of work and I do not have time for that task just now…

Please see this thread.

https://community.ipfire.org/t/core-189-update-hostapd-doesnt-start/13080

I have not seen any Realtek wlan like the rtl8192
that support ACS (Automatic Channel Selection) so you have to configure the channel that should be used. (There is a bug in the wlanap.cgi you must save one time before the channel selection work)

The RTL8188CUS will not work without a patched kernel and hostapd. This changes are in RPi os but not mainlined so this will not work at all.

I have tested a Ralink 5370 stick that works even with 40Mhz channel width. (mode gn and a fixed channel and [HT40+] )

1 Like