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

First use of t2 ap, if over USB, will fail #475

Closed
johnnyman727 opened this issue Dec 4, 2015 · 5 comments
Closed

First use of t2 ap, if over USB, will fail #475

johnnyman727 opened this issue Dec 4, 2015 · 5 comments
Assignees
Labels

Comments

@johnnyman727
Copy link
Contributor

I updated a fresh T2 up to 0.0.6. Note that the wireless config files (related to t2 ap) won't actually be overwritten by OpenWRT going from (sub 0.0.6, when we add the functionality, to 0.0.6) so you'd have to manually reset them to their original default state if you've already used t2 ap).

Running t2 ap -n SSID -p PASS results in a failure if it's run over USB:

➜  ambient-attx4 git:(jon-t2-compat) ✗ t2 ap -n Frank_Net -p Frank_Pass --usb
INFO Looking for your Tessel...
INFO Connected to Tessel-02A3E843B7A8.
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: Error upon remote process exit: 1
    at USBProcess.<anonymous> (/Users/Jon/Work/technical/t2-cli/lib/usb/usb_process.js:56:26)
    at USBProcess.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at USBProcess.emit (events.js:169:7)
    at Parser.<anonymous> (/Users/Jon/Work/technical/t2-cli/lib/usb/usb_daemon.js:127:14)
    at emitOne (events.js:77:13)
    at Parser.emit (events.js:169:7)
    at Parser._write (/Users/Jon/Work/technical/t2-cli/node_modules/usb-daemon-parser/index.js:152:16)
    at doWrite (_stream_writable.js:292:12)
    at writeOrBuffer (_stream_writable.js:278:5)
    at Parser.Writable.write (_stream_writable.js:207:11)
    at ondata (_stream_readable.js:528:20)
    at emitOne (events.js:77:13)
    at emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Readable.push (_stream_readable.js:110:10)

The reason is because the CLI attempts to fetch the SSID of the access point network which, since this is a fresh install, doesn't exist yet. If you run the command on T2 itself, you'll see that it emits an error message and the error code is non-zero:

root@Tessel-02A3E843B7A8:~# uci get wireless.@wi
fi-iface[1].ssid
uci: Entry not found

root@Tessel-02A3E843B7A8:~# $?
-ash: 1: not found

The USB Process that's running the command notices the exit code of 1, interprets it as an error and because there is nothing there to catch it, the error is thrown and process is aborted.

The question here is how the USBProcess should handle an error. I'm not convinced just emitting an error is the right way to go.

Also, the Access Point logic will need to check for a non-existent SSID.

@HipsterBrown
Copy link
Contributor

The question here is how the USBProcess should handle an error. I'm not convinced just emitting an error is the right way to go.

So could this be more of an issue with the USBProcess than the ap setup? I can still look into this, just wondering where to narrow down the search.

@johnnyman727
Copy link
Contributor Author

@HipsterBrown after thinking about this for a bit, I think the usb_connection behavior should be as similar to the lan_connection as possible. That way, we abstract the physical channel as much as possible.

I've started a PR here.

t2 ap over USB with this change but I haven't tested it yet.

@HipsterBrown
Copy link
Contributor

@johnnyman727 Awesome. I'll try it out tonight.

@johnnyman727
Copy link
Contributor Author

@HipsterBrown did you get a chance to try this out?

@HipsterBrown
Copy link
Contributor

Not yet. I will be trying it out this week though.

On Dec 21, 2015, at 7:58 PM, Jon notifications@github.com wrote:

@HipsterBrown did you get a chance to try this out?


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

2 participants