-
Notifications
You must be signed in to change notification settings - Fork 56
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
Closes USB comms properly to allow communication while booting. #386
Conversation
@tcr thanks for working on this! So we have some infrastructure in place to make sure all Tessel connections get closed. Essentially, every command run will end with It seems as though the significant part of your PR is calling Additionally, I believe this will throw an error if you have any pending packets to be sent over USB, won't it? |
@johnnyman727 As for your second question, look at |
@tcr need to run |
@@ -97,11 +97,13 @@ Tessel.prototype.simpleExec = function(command) { | |||
var self = this; | |||
return new Promise(function(resolve, reject) { | |||
// Stop processes and delete everything in the folder | |||
return self.connection.exec(command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you need to remove this return
?
@tcr it works great on my machine! It reported when I had Tessels booting and they continue to work once they were up. I added a few comments to clean up the code a bit before merging. Thanks! |
Got this while working from your branch, is it from the branch itself or something else? ➜ ~ t2 wifi
INFO Looking for your Tessel...
WARN 1 Tessel device connected by USB may still be booting.
WARN No Authorized Tessels Found.
events.js:141
throw er; // Unhandled 'error' event
^
Error: Connection was already closed...
at USB.Connection._write (/Users/frijol/t2-cli/lib/usb_connection.js:70:14)
at doWrite (_stream_writable.js:291:12)
at clearBuffer (_stream_writable.js:401:7)
at onwrite (_stream_writable.js:336:7)
at OutEndpoint.WritableState.onwrite (_stream_writable.js:88:5)
at Transfer.callback (/Users/frijol/t2-cli/node_modules/usb/usb.js:343:14) |
Also, getting false positives from this branch where it says "may still be booting" but really it's booted but I'm having USB issues. Not sure if we want to address this or assume USB should be working properly |
I also just had the case where it had definitely finished booting but then the CLI reported that it was still booting. This PR will need some thorough tests. |
Also related tessel/t2-firmware#119 |
@tcr I've superceded this PR with #400. It takes some of the logic from this PR, some of the logic from #291 and some new logic to achieve the correct result. It also needs tessel/t2-firmware#118 merged. |
See #346, #291.
Only tested with
t2 list
for now.