Bug 11769 - DHCP failure menu - retry DHCP selection disabled when connection is ethernet
: DHCP failure menu - retry DHCP selection disabled when connection is ethernet
Status: VERIFIED FIXED
Product: SB Touch
Classification: Unclassified
Component: Setup
: unspecified
: PC Windows XP
: -- critical (vote)
: MP
Assigned To: Felix Mueller
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-11 17:50 UTC by Jim McAtee
Modified: 2009-09-08 09:11 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
Proposed patch for SetupNetworking.lua (761 bytes, patch)
2009-04-14 03:29 UTC, Felix Mueller
Details | Diff
Another patch (2.12 KB, patch)
2009-04-15 07:58 UTC, Felix Mueller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jim McAtee 2009-04-11 17:50:45 UTC
Brought up in the forum's r5265 feedback thread:

http://forums.slimdevices.com/showthread.php?p=414786#post414786

If a DHCP server is unavailable during the initial setup then an error screen is presented to the user, with choices of (from memory):

- Detect DHCP server
- Assign IP information manually
- Self-assign address

Choosing the first selection does nothing but beep.  The only way to retry DHCP is to go back and select the network type again.

I think the terminology on this screen should be reviewed as well, starting at the top with the error message, which said (again, from memory) something like 'A DHCP network could not be found'.

Also, the menu choices might be better expressed:

- Try again
- Assign an IP address manually
- Use self-assigned IP address 169.254.x.x
Comment 1 Jim McAtee 2009-04-11 19:42:01 UTC
In the forums bpa suggests not giving the choice of self-assigned IP address during setup.  I agree, as the first thing that will happen is that the firmware update will fail unless the unlikely network configuration exists where the user's router NATs 169.254 IP addresses to the outside world.

Second, it appears selecting self-assigned IP address becomes a permanent network setting.  On rebooting the Fab4 it won't try to get a DHCP address.  This is much different than previous Squeezebox behavior of automatically self-assigning an address on DHCP failure, but still attempting DHCP on subsequent startups.
Comment 2 Blackketter Dean 2009-04-11 20:39:17 UTC
*** Bug 11770 has been marked as a duplicate of this bug. ***
Comment 3 Blackketter Dean 2009-04-11 20:42:45 UTC
AutoIP is a failure mode for DHCP timeouts that lets the device stay on the network even though DHCP failed.  If DHCP succeeds later, then the AutoIP address goes away.  So, there's no specific AutoIP setting, it should just be DHCP or static.

Finally, for the first setup experience that requires an internet connection to download firmware, then AutoIP is useless, since it's is by definition, not routable to the internet.  

If there is a way to get a firmware update from a local SC, then there's a case where it would work, but it's very unlikely.
Comment 4 Jim McAtee 2009-04-12 00:27:19 UTC
I just ran a test for bug 11668 (DHCP failure menu, fails to appear in setup) and found that the "Try again" ("Detect DHCP automatically") menu selection _does_ work when the connection is wireless.  So this bug only appears when the connection type is ethernet.
Comment 5 Jim McAtee 2009-04-12 00:41:24 UTC
(In reply to comment #3)
> AutoIP is a failure mode for DHCP timeouts that lets the device stay on the
> network even though DHCP failed.  If DHCP succeeds later, then the AutoIP
> address goes away.  So, there's no specific AutoIP setting, it should just be
> DHCP or static.

I think my earlier report was wrong.  The DHCP server must not have been running when I rebooted after selecting self-assigned address.  Another test:

- disable DHCP server
- factory reset SBT
- select self-assigned address (AutoIP) when DHCP fails
- there's no way to get past the firmware update
- enable DHCP server
- reboot SBT

On rebooting, the SBT did get an IP address, so it was using DHCP again.
Comment 6 Rudolf Janz 2009-04-12 07:20:14 UTC
> - disable DHCP server
> - factory reset SBT
> - select self-assigned address (AutoIP) when DHCP fails
> - there's no way to get past the firmware update
> - enable DHCP server
> - reboot SBT
> 
> On rebooting, the SBT did get an IP address, so it was using DHCP again.

FOr me rebooting was not necessary, worked directly  after reenabling DHCP.
And the problem happens in wireless as well.

  Rudolf
Comment 7 Mickey Gee 2009-04-13 13:44:49 UTC
Adding QA to the cc list.
Comment 8 Ross Levine 2009-04-13 15:05:18 UTC
I'm able to confirm the Detect DHCP automatically selection does nothing. This prompt only shows up on a network with DHCP server disabled. I selected self assigned and it cannot reach mysqueezebox.com. Enabled DHCP, rebooted fab4, ifconfig shows self assigned IP address still. WRT310N by Linksys.
Comment 9 Felix Mueller 2009-04-14 03:29:57 UTC
Created attachment 5113 [details]
Proposed patch for SetupNetworking.lua

Confirmed on r5265 / wired that 'Detect DHCP automatically' does nothing due to a call from SetupNetworking.lua to t_wpaStatus() in Networking.lua which should be in a task.
Comment 10 Felix Mueller 2009-04-14 03:33:33 UTC
I agree that the first option probably should be named differently as the system already tried (and failed) to detect the dhcp server automatically.

I suggest the whatever we chose it should at least contain the word 'again', either 'Try again' or 'Detect DHCP server again'.
Comment 11 Blackketter Dean 2009-04-14 07:42:25 UTC
"Try again" sounds great.
Comment 12 Richard Titmuss 2009-04-14 11:59:37 UTC
I am not sure about the patch, as it will display the popup even when the ethernet error is displayed. From looking at the coded, it would appear that _connect() is usually not called in a Task(), so should this not normally always fail?
Comment 13 Felix Mueller 2009-04-15 02:28:40 UTC
I think you are correct, '_connect()' only sometimes is called in a Task() and as long as it is for the wireless interface the offending part of the code is not used and doesn't cause an error.

However of the three occasions _connect() is called for the wired interface two calls use a Task() ('networkScan' and 'ethernetConnect') only the one the bug is about doesn't.

I don't understand your remark: "it will display the popup even when the
ethernet error is displayed" - when would that happen?
Comment 14 Richard Titmuss 2009-04-15 07:29:16 UTC
The Task() is executed later, asynchronously. The code as written is designed to exit early in the return if there is not status link:

	local status = iface:t_wpaStatus()
	if not status.link then
		return _attachEthernet(self, iface, ssid, createNetwork)
	end
        -- more stuff

As this code now gets executed in a task, the "more stuff" is always run, even when the attachEthernet screen is shown. Either the whole function should be moved into the task, of the task calls _connect1() to do "more stuff" after the link status is checked.

What I don't understand is why this does not fail if you do:
1. factory reset
2. choose ethernet

Should the error not happen then too? It does not, as I see the attach ethernet screen.
Comment 15 Felix Mueller 2009-04-15 07:58:00 UTC
Created attachment 5125 [details]
Another patch

If you do a factory reset and choose ethernet (w/o cable attached) _connect() is called in a task "networkScan". That is at least what I can see when I debug.
Comment 16 Richard Titmuss 2009-04-15 08:00:15 UTC
That looks better. Thanks.
Comment 17 Felix Mueller 2009-04-15 10:15:44 UTC
Fixed in r5308.
Comment 18 Ross Levine 2009-04-15 14:26:07 UTC
I'm ready to verify this, when can I expect to see r5308 available on eng?
Comment 19 Ross Levine 2009-04-15 17:26:31 UTC
This looks solid. Without reboot Fab4 gets an IP from DHCP after it has been enabled. WRT310N, r5312.