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

Check if wireless.radio0 is disabled #987

Merged
merged 3 commits into from
Sep 20, 2016

Conversation

HipsterBrown
Copy link
Contributor

Fixes #972

Smoke test:

The only way I've figured out how to recreate this issue is to manually disable the radio0 wireless interface. I would suggest doing this over USB using dterm or screen because an ssh session will cut off as soon as the radio is disabled, i.e. screen /dev/tty.usb<tab complete from here> and hit the "enter" key twice.

Once rooted into your Tessel, run the following commands:

uci set wireless.radio0.disabled='1'
uci commit wireless

While still rooted, running wifi should give you the error 'radio0' is disabled. To leave the screen session, hit Control+a+\ then type "y".

Now that the wireless radio has been disabled:

  1. Check out this branch
  2. npm link . (if you haven't linked this locally yet)
  3. t2 wifi -n "Your Network Name" -p PasswordIfNeeded123

You should get the following output:

hipsterbrown:t2-cli (handle-wifi-radio) $ t2 wifi -n "My Network Name" -p MyPassword
INFO Looking for your Tessel...
INFO Connected to tessel-router.
INFO Wifi Enabled.
INFO Wifi Connected. SSID: My Network Name, password: MyPassword, security: psk2

Let me know if there are any questions.

@HipsterBrown HipsterBrown mentioned this pull request Sep 20, 2016
.then(() => this.simpleExec(commands.commitWirelessCredentials()))
.then(() => this.simpleExec(commands.reconnectWifi()))
.catch(reject);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there is an error that doesnt include "'radio0' is disabled"? I think this needs to return Promise.resolve()?

(Sorry, I reposted this because I'm not sure if we're officially using Github Review yet)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe, and after experimenting, once the execution of a thenable function finishes, the Promise will continue to the next chained method. Returning in a thenable function will pass that value to the next thenable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping track of promises is not my cup of tea. Thanks for clarifying

@HipsterBrown
Copy link
Contributor Author

@rwaldron Pushed a test to confirm your comment.

@rwaldron rwaldron merged commit 87ee3a6 into tessel:master Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants