Project

General

Profile

Actions

Bug #5121

closed

interfaces.php - Wireless Antenna Selection should default to "Default"

Added by Jim Pingle over 8 years ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
09/11/2015
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

The Transmit and Receive antenna options under "Antenna Settings" are defaulting to "Auto" on bootstrap rather than the "Default" option which was the default on 2.2.x.


Files

Actions #1

Updated by Anonymous over 8 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Anonymous to Jim Pingle

Antenna controls now default to "Default"

Actions #2

Updated by Anonymous over 8 years ago

  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle over 8 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Anonymous

On a fully up-to-date system with a wireless card, it's still defaulting to Auto for me.

Actions #4

Updated by Anonymous over 8 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Anonymous to Jim Pingle

If $pconfig['txantenna'] is not set, the selector value is null, and the null array element is 'Default'.

Would you check your config file please and see what valueis in there for rxantenna and txantenna? Blank, '0' or '1' ?

Thanks

Code:

if (isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"])) {
$group->add(new Form_Select(
'txantenna',
null,
(isset($pconfig['txantenna'])) ? $pconfig['txantenna']:'',
['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']
))->setHelp('Transmit antenna');
Actions #5

Updated by Jim Pingle over 8 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Anonymous

Before adding the interface it did not exist in config.xml at all and there was nothing in in the wireless tag.

Assigning the interface, it appears like so:

                <opt2>
                        <descr><![CDATA[OPT2]]></descr>
                        <if>ath0</if>
                        <wireless/>
                </opt2>

And farther down in the config:

 <wireless/>

Navigating to Interfaces > OPT2 it shows Auto for antennas.

Inspecting the source shows both options marked selected:

<select id="txantenna" class="form-control" name="txantenna">
    <option selected="" value="">Default</option>
    <option selected="" value="0">Auto</option>
    <option value="1">#1</option>
    <option value="2">#2</option>
</select>

Actions #6

Updated by Anonymous over 8 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Anonymous to Jim Pingle

Thanks for your help in finding this!

It was an obscure issue in the Select.class.php framework file wherein '' == '0' if one is a string and the other an int.

Actions #7

Updated by Anonymous over 8 years ago

Actions #8

Updated by Jim Pingle over 8 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Anonymous

It defaults to "default" now, but when manually set to auto, it still marks default as selected. I know PHP is pretty quirky when it comes to use of empty() on "" vs 0, 0 even as a string all evaluate to true. Might be related.

Actions #9

Updated by Chris Buechler over 8 years ago

Jim T. said the antenna selection is of no use anyway, so should just remove it, then this can be closed out.

Actions #10

Updated by Jim Pingle over 8 years ago

That's probably a good move, though if the framework has a general issue with the scenario it may still come back to haunt us in other areas.

Actions #11

Updated by Anonymous over 8 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Anonymous to Jim Pingle

Fixed and removed.

Actions #12

Updated by Anonymous over 8 years ago

Actions #13

Updated by Jim Pingle over 8 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Anonymous
  • % Done changed from 100 to 0

The Antenna selection options are still showing up here for me when synced to master.

Actions #14

Updated by Anonymous over 8 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Anonymous to Jim Pingle

Mia culpa

if(ANTENNAS) condition corrected

Actions #15

Updated by Anonymous over 8 years ago

  • % Done changed from 0 to 100
Actions #16

Updated by Jim Pingle over 8 years ago

  • Status changed from Feedback to Resolved

Gone now. Thanks!

Actions #17

Updated by Chris Buechler about 8 years ago

  • Affected Version changed from All to 2.3
Actions #18

Updated by Jonathan Lee 8 months ago

Hello, what about 3 antenna port pcie cards? I learned the AR5BXB112 functions in some appliances. Is the 3rd port not utilized in this situation?

ref:
Regression #14703

Actions

Also available in: Atom PDF