
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Node.js interface for the Lego Boost Move Hub 🤖 🐱 🎸 🚚
$ npm install movehub
If you want to utilize the new async/await syntax see https://github.com/ttu/node-movehub-async which is based on this module.
See test.js.
Kind: global class
Kind: instance method of Boost
| Param | Type | Description |
|---|---|---|
| address | string | MAC Address of the Hub |
| callback | connectCallback |
Kind: event emitted by Boost
| Param | Type | Description |
|---|---|---|
| bleReady | boolean | reports true/false when BLE is active |
Fires when a Move Hub is found
Kind: event emitted by Boost
| Param | Type |
|---|---|
| hub | object |
| hub.uuid | string |
| hub.address | string |
| hub.localName | string |
functionKind: instance typedef of Boost
| Param | Type | Description |
|---|---|---|
| error | null | error | |
| hub | Hub | instance of the Hub Class |
Kind: global class
Disconnect from Move Hub
Kind: instance method of Hub
Run a motor for specific time
Kind: instance method of Hub
| Param | Type | Default | Description |
|---|---|---|---|
| port | string | number | possible string values: A, B, AB, C, D. | |
| seconds | number | ||
| [dutyCycle] | number | 100 | motor power percentage from -100 to 100. If a negative value is given rotation is counterclockwise. |
| [callback] | function |
Run both motors (A and B) for specific time
Kind: instance method of Hub
| Param | Type | Description |
|---|---|---|
| seconds | number | |
| dutyCycleA | number | motor power percentage from -100 to 100. If a negative value is given rotation is counterclockwise. |
| dutyCycleB | number | motor power percentage from -100 to 100. If a negative value is given rotation is counterclockwise. |
| callback | function |
Turn a motor by specific angle
Kind: instance method of Hub
| Param | Type | Default | Description |
|---|---|---|---|
| port | string | number | possible string values: A, B, AB, C, D. | |
| angle | number | degrees to turn from 0 to 2147483647 | |
| [dutyCycle] | number | 100 | motor power percentage from -100 to 100. If a negative value is given rotation is counterclockwise. |
| [callback] | function |
Turn both motors (A and B) by specific angle
Kind: instance method of Hub
| Param | Type | Description |
|---|---|---|
| angle | number | degrees to turn from 0 to 2147483647 |
| dutyCycleA | number | motor power percentage from -100 to 100. If a negative value is given rotation is counterclockwise. |
| dutyCycleB | number | motor power percentage from -100 to 100. If a negative value is given rotation is counterclockwise. |
| callback | function |
Control the LED on the Move Hub
Kind: instance method of Hub
| Param | Type | Description |
|---|---|---|
| color | boolean | number | string | If set to boolean false the LED is switched off, if set to true the LED will be white. Possible string values: off, pink, purple, blue, lightblue, cyan, green, yellow, orange, red, white |
| [callback] | function |
Subscribe for sensor notifications
Kind: instance method of Hub
| Param | Type | Default | Description |
|---|---|---|---|
| port | string | number | e.g. call .subscribe('C') if you have your distance/color sensor on port C. | |
| [option] | number | 0 | Unknown meaning. Needs to be 0 for distance/color, 2 for motors, 8 for tilt |
| [callback] | function |
Unsubscribe from sensor notifications
Kind: instance method of Hub
| Param | Type | Default | Description |
|---|---|---|---|
| port | string | number | ||
| [option] | number | 0 | Unknown meaning. Needs to be 0 for distance/color, 2 for motors, 8 for tilt |
| [callback] | function |
Send data over BLE
Kind: instance method of Hub
| Param | Type | Description |
|---|---|---|
| data | string | Buffer | If a string is given it has to have hex bytes separated by spaces, e.g. 0a 01 c3 b2 |
| callback | function |
Kind: event emitted by Hub
| Param | Type |
|---|---|
| rssi | number |
Kind: event emitted by Hub
Fires when a connection to the Move Hub is established
Kind: event emitted by Hub
Fires on port changes
Kind: event emitted by Hub
| Param | Type |
|---|---|
| port | object |
| port.port | string |
| port.action | string |
Kind: event emitted by Hub
| Param | Type |
|---|---|
| color | string |
Kind: event emitted by Hub
| Param | Type | Description |
|---|---|---|
| distance | number | distance in millimeters |
Kind: event emitted by Hub
| Param | Type |
|---|---|
| tilt | object |
| tilt.roll | number |
| tilt.pitch | number |
Kind: event emitted by Hub
| Param | Type |
|---|---|
| rotation | object |
| rotation.port | string |
| rotation.angle |
Pull Requests welcome! :-)
Thanks to Jorge Pereira who analyzed and documented the move hub ble protocol: https://github.com/JorgePe/BOOSTreveng
LEGO and BOOST are Trademarks from The LEGO Company, which does not support (most probably doesn't even know about) this project. And of course I'm not responsible for any damage on your LEGO BOOST devices - use it at your own risk.
MIT (c) Sebastian Raff
FAQs
Interface to the Lego Boost Move Hub
The npm package movehub receives a total of 6 weekly downloads. As such, movehub popularity was classified as not popular.
We found that movehub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.