dd-wrt console can't display option value after hostapd

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
doiche
DD-WRT Novice


Joined: 08 Apr 2009
Posts: 13

PostPosted: Mon Jun 05, 2023 22:42    Post subject: dd-wrt console can't display option value after hostapd Reply with quote
Hi Guys, good night.

Firmware: DD-WRT v3.0-r44715 std (11/03/20)
TL-WR1043ND V.1

I'm writing a simple custom script on DD-WRT console and the last step is reloading /tmp/ath0_hostap.conf.

All radio setting works as intended but I get one missing thing that is really bothering me. After loading the /tmp/ath0_hostap.conf as:

hostapd -B -P /var/run/ath0_hostapd.pid /tmp/ath0_hostap.conf ;

The feature "Channel Width" on dd-wrt console:
Wireless -> Basic config
the "Channel Width" value isn't properly displayed.
Before loading the config file /tmp/ath0_hostap.conf the "Channel Width" option display 40Mhz (as my initial setup and desire.)

but after loading config file /tmp/ath0_hostap.conf the "Channel Width" options display Full (20 MHz) and the "Wireless Channel" option is blank.

Does anyone know what is the ath0_hostap.conf variable that is responsible for setting the "Channel Width" option on the dd-wrt console?

Any help is really appreciated
Sponsor
doiche
DD-WRT Novice


Joined: 08 Apr 2009
Posts: 13

PostPosted: Mon Jun 05, 2023 23:09    Post subject: Reply with quote
It looks like that after loading the Atheros drive via insmod, it ups it as wlan0 instead of the expected ath0 and even after renaming it to ath0 with ip link, the dd-wrt console isn't able to find "Channel Width"....

hummm where I'm broking the console display x insmod ?
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1941

PostPosted: Tue Jun 06, 2023 0:12    Post subject: Reply with quote
First, (and foremost) you should consider upgrading to the current release as of this post:

https://ftp.dd-wrt.com/dd-wrtv2/downloads/betas/2023/06-02-2023-r52869/tplink_tl-wr1043nd/

The router database is not up-to-date with current release information and may suggest builds that are broken for some devices.

Second, interface names were renamed "a while ago" to standardize them across all non-Broadcom platforms (not going to find the development commits for you to explain, sorry).

You need to adjust your script to modern nomenclature. Also, the channel width and other variables may be contained in nvram variables (nvram show | grep wlan0).

Enjoy.

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
doiche
DD-WRT Novice


Joined: 08 Apr 2009
Posts: 13

PostPosted: Tue Jun 06, 2023 1:14    Post subject: Reply with quote
Hi @dale_gribble39, thank you for the fast reply.

I don't know that I'm not running the last version of dd-wrt firmware but that was the firmware that I was able to upgrade after a broken upgrade console feature in dd-wrt =/

So, regarding the interface name, you are right, the default interface name is ath0 and after insmod the ath and ath9k modules it must be renamed from wlan0 to ath0 to main the dd-wrt standards and I think that is the issue because renaming it will probably change /proc/dev hardware address?

I think the Web Console is unable to load the Wireless -> Basic config
the "Channel Width" because of these "rename from wlan0 to ath0"

So in brief, do you know a way that even re-loading the Atheros modules (ath and ath9k) the interface would still initiate as ath0 instead wlan0?

Thank you
doiche
DD-WRT Novice


Joined: 08 Apr 2009
Posts: 13

PostPosted: Tue Jun 06, 2023 1:18    Post subject: Reply with quote
By the way, just upgraded it Wink

Firmware: DD-WRT v3.0-r52869 std (06/02/23)

So let me perform some tests regarding insmod ath and ath9k.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1941

PostPosted: Tue Jun 06, 2023 1:33    Post subject: Reply with quote
doiche wrote:
So in brief, do you know a way that even re-loading the Atheros modules (ath and ath9k) the interface would still initiate as ath0 instead wlan0?

Let me repeat myself. The ath* interface names inside DD-WRT firmware source code were renamed to wlan* on all non-Broadcom devices. The kernel module (ath*) names do not make any difference. Rename your instances of ath0 in your script to wlan0. There is no changing hard-coded interface name values without patching your own development tree and compiling your own firmware images.

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
doiche
DD-WRT Novice


Joined: 08 Apr 2009
Posts: 13

PostPosted: Tue Jun 06, 2023 1:47    Post subject: Reply with quote
Oh!! Now I got you! In this new version, we are using wlan0 as default! Cool!

Actually, I will let it running on this new version to see if the radio will stop as it was stopping before.


I hope that this new version fixes the issue =) It would be perfect.

By the way.

That is what I was planning to do:


#!/bin/sh

# Henrique D. J. Campos
# 05 Jun 2023
#
# Recycle Radio
# Fixing connection issues

# Dump
#hostapd -P /var/run/ath0_hostapd.pid -dd /tmp/ath0_hostap.conf ;

rmmod ath9k ;
rmmod ath ;
ifconfig ath0 down ;
killall hostapd ;
insmod ath ;
insmod ath9k ;
ip link set wlan0 name ath0 ;
ifconfig ath0 up ;

# Load
hostapd -B -P /var/run/ath0_hostapd.pid /tmp/ath0_hostap.conf ;

#-------------


Now even if the new version keeps stopping the radio I can remove the line:
ip link set wlan0 name ath0 ;

I believe that this was what "bugs" the Web Console.

Thank you so much @dale_gribble39!
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1941

PostPosted: Tue Jun 06, 2023 2:33    Post subject: Reply with quote
I would think the easier options would be:
Code:
service wland restart && service checkhostapd restart

Or under Administration -> Keepalive setting up a scheduled reboot. I haven't seen the need to do either on more recent releases on TL-WR1043ND v1.8.

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
doiche
DD-WRT Novice


Joined: 08 Apr 2009
Posts: 13

PostPosted: Tue Jun 06, 2023 12:44    Post subject: Reply with quote
Yep, it freezes this morning after like running for 10h so I created a custom script with your suggestion and enabled cron. Let's see how it behaves =)


00 03,06,16,21 * * * root /tmp/.rc_custom
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum