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

Implemented 3G USB dongle setup CLI command #1597

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Implemented 3G USB dongle setup CLI command #1597

wants to merge 2 commits into from

Conversation

bart
Copy link

@bart bart commented Jan 6, 2019

This commit implements a simple way of configuring 3G USB dongles which automatically gets detected by OpenWrt. It has been tested with a HUAWAI E173.

You can use the command like this:

t2 3g --config --apn="" --dialnumber="" --username="" --password="" => Configure network and enable 3G connection
t2 3g --on => Enable 3G connection
t2 3g --off => Disable 3G connection
t2 3g --status => Print 3G connection status information

@tessel-bot
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @rwaldron (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@bart
Copy link
Author

bart commented Jan 6, 2019

Resolves #541

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 84.524% when pulling 90428e6 on bart:feature/3g into 73739db on tessel:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 84.524% when pulling 90428e6 on bart:feature/3g into 73739db on tessel:master.

@HipsterBrown HipsterBrown self-requested a review January 7, 2019 14:46
Copy link
Contributor

@HipsterBrown HipsterBrown left a comment

Choose a reason for hiding this comment

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

This is a great start! 👏 I have a few suggestions to match the coding style of this repo and expected command interface based on the existing t2 wifi and t2 ap commands.

Do you know if you are able to connect to the 3g network and start an access point at the same time?

I can help out with creating some tests for this command if you're new to nodeunit.

Let me know if you have any questions

@@ -0,0 +1,119 @@
var Tessel = require('./tessel');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update the use of var in this file to const? Those variables are never reassigned so we can optimize with the use of const.

return this.configure3gDongle(apn, dialnumber, username, password);
});
}).catch(() => {
return this.configure3gDongle(apn. dialnumber, username, password);
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be a typo here.

Suggested change
return this.configure3gDongle(apn. dialnumber, username, password);
return this.configure3gDongle(apn, dialnumber, username, password);

var off = options.off;
var status = options.status;

if (config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to the wifi and ap commands, I would expect configuration to be the default mode of the 3g command. For example:

t2 3g --apn="" --dialnumber="" --username="" --password=""

I would expect that command alone to configure the Tessel to connect to that 3g network and be enabled.

If none of those configuration options are passed in, i.e. t2 3g, I would expect to see the current configuration and status of 3g mode. Just like if you use t2 wifi, the cli will return the current details of the Tessel's wifi connection (if it is connected).

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.

5 participants