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

Fix 2215 by properly remapping ports to fit new firmware changes #2229

Merged
merged 7 commits into from Jul 31, 2019
Merged

Fix 2215 by properly remapping ports to fit new firmware changes #2229

merged 7 commits into from Jul 31, 2019

Conversation

knandersen
Copy link
Contributor

Resolves

Resolves the part of #2215 that relates to block behavior, NOT connection issues.

Proposed Changes

This PR changes port mapping as such:

Port A: 55 is now 0
Port B: 56 is now 1
Port C: 1 is now 2
Port D: 2 is now 3

Additionally it adds a case in onMessage() that catches responses from the LED to avoid warnings from appearing in the browser console.

Reason for Changes

LEGO has released a new firmware version 2.0.00.0017 for the LEGO BOOST Move Hub. The release included changes to the IDs that physical ports map to, and adds responses to LED commands.

@knandersen knandersen changed the title Bugfix/2215 Fix 2215 by properly remapping ports to fit new firmware changes Jul 11, 2019
@knandersen
Copy link
Contributor Author

Blocked by scratchfoundation/scratch-link#120

@apple502j
Copy link
Contributor

This breaks old-firmware Boosts...

@thisandagain
Copy link
Contributor

/cc @ericrosenbaum @cwillisf @BryceLTaylor

We should discuss how to handle communication and support for Boost hubs that are running the older firmware as @apple502j points out above.

…ater as well as newer firmware version 2.0.00.0017 or newer
…lity.

This change creates two different port mappings for the Move Hub. By default the extension will use the newer mapping introduced in firmware version 1.0.00.0224. When connected to the hub, the extension will request the hub's firmware version. If it's older than 1.0.00.0224 it will use the older mapping.
@thisandagain
Copy link
Contributor

🎉 Thanks @knandersen!

@ericrosenbaum
Copy link
Contributor

Looks like ports C and D are now set incorrectly for the old firmware

@ericrosenbaum
Copy link
Contributor

Motor position reporter for port A is not working- I think it's because the portID of zero for port A is false-y at this line (gotta check for not null I guess!): https://github.com/LLK/scratch-vm/blob/f6f97ef3a7b562374ab9d52108c717827fe19cde/src/extensions/scratch3_boost/index.js#L1855

Copy link
Contributor

@ericrosenbaum ericrosenbaum left a comment

Choose a reason for hiding this comment

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

LGTM! Tested on mac chrome with Scratch Link 1.1.46, with both old and new BOOST firmware versions.

@knandersen knandersen merged commit d379dc1 into scratchfoundation:develop Jul 31, 2019
@knandersen knandersen deleted the bugfix/2215 branch July 31, 2019 15:05
yokobond added a commit to xcratch/scratch-vm that referenced this pull request Aug 18, 2019
… extension/microbit-more

* 'develop' of https://github.com/yokobond/scratch-vm: (79 commits)
  Revert "Update gh-pages to the latest version 🚀"
  chore(package): update lockfile package-lock.json
  chore(package): update gh-pages to version 2.1.0
  Fixed issue where port A motor position was not being reported because the port number was false-y
  Corrected old port mapping! Thanks for catching that @EricR.
  Adjusted portmapping variables to match firmware versions correctly
  This commit addresses a discussion in scratchfoundation#2229 around backward compatibility.
  Add port mappings to support older firmware version 2.0.00.0016 and later as well as newer firmware version 2.0.00.0017 or newer
  Revert "Raise params to the next frame when pushing"
  fix stopThisScript inside procedures
  Added START_POWER enum to BoostOutputSubCommand which allows the extension to use unregulated motor commands with the Move Hub. Changed BoostMotor.turnOff() to use unregulated motor commands since it seems like a more reliable way of turning the motor off
  Add case to onMessage to catch responses from the LED
  Changed port-mapping to reflect firmware update.
  chore(package): update lockfile package-lock.json
  chore(package): update lodash.defaultsdeep to version 4.6.1
  Lint (remove logs, add spaces)
  test stopThisScript in procedures
  Making constants decimals.
  Fixing enum var name again.
  Adding 'byte to follow' comments back.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants