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

[RFC] Expose Tessel network utilities #129

Closed
HipsterBrown opened this issue Dec 1, 2015 · 9 comments
Closed

[RFC] Expose Tessel network utilities #129

HipsterBrown opened this issue Dec 1, 2015 · 9 comments

Comments

@HipsterBrown
Copy link
Contributor

At the moment, the quickest way to connect to a wifi network or start an access point is through the command line interface, t2-cli. It would be cool to expose this functionality through the tessel module for controlling network operations programatically.

Example:

var tessel = require('tessel');

// connects to wifi network called 'MyNetwork' and returns wifi object for use later
// tessel.network.ap could work the same way
var myNetwork = tessel.network.wifi({
  ssid: 'MyNetwork',
  password: 'SecurePassword123',
  security: 'psk2'
});

// turns off the connection to 'MyNetwork'
myNetwork.off();

// turns on connection to 'MyNetwork'
myNetwork.on();

Use Case:
If a developer wanted to create an access point based on user interaction, like pressing the button on the Tessel. Then a user could toggle that access point every time they press the button.

When mesh networking is available, that could also be exposed through this tessel.network object/class for dynamically creating mesh nodes and connections.

Any feedback is helpful. I can work on a PR if there is a general approval.

@rwaldron
Copy link
Contributor

rwaldron commented Dec 1, 2015

What happens if tessel.network.wifi is called more than once?

@HipsterBrown
Copy link
Contributor Author

Hmmm I suppose it would connect to that new network and return a new wifi object, then invalidate any old wifi objects. I think having that returned object to pass around will be easier to understand, as opposed to:

var tessel = require('tessel')

tessel.network.wifi(creds); // automatically connects to this network
tessel.network.wifi.off(); // turns the last connected network off.

@johnnyman727
Copy link
Contributor

@HipsterBrown what do you think of the WiFi API we have for Tessel 1? It doesn't have any access point option so we'd have to add that.

@HipsterBrown
Copy link
Contributor Author

@johnnyman727 I was not aware of that API but it looks great to me, especially since it existed with Tessel 1 it would be nice to continue support within the tessel module. I think the same API should work for access points as well.

@johnnyman727
Copy link
Contributor

👍 Yeah, I forgot about this API so I'm glad you brought it up.

@rwaldron
Copy link
Contributor

rwaldron commented Dec 3, 2015

I also forgot about that API—thanks for the refresher @johnnyman727

@HipsterBrown HipsterBrown self-assigned this Dec 10, 2015
@johnnyman727
Copy link
Contributor

@HipsterBrown do you think this will be ready for our next milestone tomorrow? Are you blocked by anything?

@HipsterBrown
Copy link
Contributor Author

@johnnyman727 It won't be ready tomorrow. Not blocked by anything, just haven't had a bunch of time to work on it. I can have it by the next release though now that I have some feedback on the initial WIP API.

@johnnyman727
Copy link
Contributor

👍 Will move it to the next milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants