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

Ambient module still trying (and sometimes failing) to update itself #69

Open
Frijol opened this issue May 17, 2016 · 7 comments
Open

Comments

@Frijol
Copy link
Member

Frijol commented May 17, 2016

The ambient module often thinks its firmware version is old. This makes it try to update itself, often every time you run something with it. Sometimes it updates and reports success and you can keep working. Sometimes it goes to "are you sure it's plugged in?"

One weird/possibly coincidental fix I've employed: switched to Port B and it was ok.

@jimbojw
Copy link

jimbojw commented May 26, 2016

I've found that using console.log() before the ambient object's ready event will trigger this behavior. Documented here: #70

@johnnyman727
Copy link
Contributor

@jimbojw really glad that you were able to find a reproducible test case. I'll try to take a look at this while at the WebRebels/Nodeconf Oslo conferences this week.

@Frijol
Copy link
Member Author

Frijol commented Jun 5, 2016

Have now encountered this at several workshops. Switching to Port B has consistently worked. Not sure why ..?

@jimbojw
Copy link

jimbojw commented Jun 6, 2016

Switching to Port B did not work for me—it only made the issue happen consistently. :/

I've successfully used the Relay module in Port B on my Tessel 2, so I do not believe my Port B to be uniformly bad.

@Frijol
Copy link
Member Author

Frijol commented Sep 1, 2016

Investigating the issue. On a standard run of the Ambient module example, plugged in to Port A:

INFO Running ambient.js...
Could not retrieve firmware version and module ID. Attempting update.
[Error: Unable to communicate with module. Are you sure it's plugged in?]

SPI trace gives:

screen shot 2016-09-01 at 4 51 41 pm

Zoomed in on that last bit (700ms+):

screen shot 2016-09-01 at 4 52 21 pm

For completeness, here is the earlier bit (400ms+):

screen shot 2016-09-01 at 4 58 39 pm

The update attempt begins here: https://github.com/tessel/attiny-common/blob/master/lib/index.js#L66

Attiny datasheet: http://www.atmel.com/Images/doc8006.pdf

@Frijol
Copy link
Member Author

Frijol commented Sep 2, 2016

Not expecting to have a chance to continue this investigation today, but if you want to continue, the above images should help. Next steps:

  1. Figure out what the function is looking for & not finding such that it fails out by reading through the linked Attiny-common code
  2. Figure out what the values being passed back and forth between the module and the Tessel mean by looking at the Attiny datasheet and the Logic traces screenshotted above

@johnnyman727
Copy link
Contributor

This should be fixed with a combination of c11274f and tessel/t2-firmware#209.

Should be closed once tessel/t2-firmware#209 is merged and a new firmware build is released.

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