Skip to content
MagicMirror Module for the HoverLabs hover gesture detector
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
templates Clean slate with MM module template Aug 16, 2017
translations Clean slate with MM module template Aug 16, 2017
.eslintrc.json Clean slate with MM module template Aug 16, 2017
.gitignore Clean slate with MM module template Aug 16, 2017
.stylelintrc Clean slate with MM module template Aug 16, 2017
.travis.yml Clean slate with MM module template Aug 16, 2017
Gruntfile.js Clean slate with MM module template Aug 16, 2017
LICENSE
MMM-Hover.css First pass (untested) following HoverLabs python library and NorthMco… Sep 11, 2017
MMM-Hover.js
README.md
node_helper.js remove pointless console.log Sep 20, 2017
package.json Just using existing hover npm package instead of trying to recreate i… Sep 18, 2017

README.md

MMM-Hover

This is a MagicMirror module to communicate with the
HoverLabs Hover (Unofficial). The Hover can detect a hand direction swiping in front of it (Up, Down, Left, Right) and taps on the board surface (Top, Left, Bottom, Top, Middle).

Uses NPM package hover-nodejs, which is based on the original python library from HoverLabs, linked here.

Getting events from the Hover board is cool and all, but to make it useful these events can trigger notifications to other modules. For example, configured by default, swiping or tapping left/right will send off PAGE_DECREMENT and PAGE_INCREMENT for the MMM-pages module to change pages.

Installation

cd ~/MagicMirror/modules
git clone https://github.com/dancj/MMM-Hover

cd MMM-Hover && npm install

This installs required NPM packages. Set up your GPIO pins of choice in the config file.

If you have any suggestions, please let me know with an issue.

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'MMM-Hover',
		config: {
			// See 'Configuration options' for more information.
			i2cAddress: 0x42,
			pinTs: 23,
			pinReset: 24,
			pollRate: 10
		}
	}
]

To customize the events triggered by Hover events, use this option:

modules: [
	{
		module: 'MMM-Hover',
		config: {
			// See 'Configuration options' for more information.
			i2cAddress: 0x42,
			pinTs: 23,
			pinReset: 24,
			pollRate: 10,
			triggeredEvents: {
				tap: {
					north: "",
					south: "",
					west: "PAGE_DECREMENT",
					east: "PAGE_INCREMENT",
					center: ""
				},
				swipe: {
					up: "",
					down: "",
					left: "PAGE_DECREMENT",
					right: "PAGE_INCREMENT"
				}
			}
		}
	}
]

Raspberry Pi GPIO Pins

  1. HOST_V+ ---- 3V3 pin
  2. RESET ---- Any digital pin, for example: pin 18, GPIO 24 (BCM Mode)
  3. SCL ---- SCL pin
  4. SDA ---- SDA pin
  5. GND ---- Ground Pin
  6. 3V3 ---- 3V3 pin
  7. TS ---- Any digital pin, for example: pin 16, GPIO 23 (BCM Mode)

Configuration Options

The following properties can be configured:

Option Description
updateInterval Time in ms to update display
i2cAddress i2c address

Value from HoverLabs library: 0x42
pinTs Input pin for hover board, which will receive an 8-bit binary value to indicate the event type, gesture direction, and tap location.

Value from HoverLabs library: 23
Note: please use BCM numbering
pinReset Reset pin

Value from HoverLabs library: 24
Note: please use BCM numbering
pollRate Polling rate in milliseconds to check for input from hover board

Value from HoverLabs library: 1
debug Put module in debug mode (prints messages to browser console)

Default value: false
triggeredEvents Notifications that get fired off upon the different taps and swipes received from Hover. Empty strings result in no action.

Default value:
				{
					tap: {
						up: "",
						down: "",
						west: "PAGE_DECREMENT",
						east: "PAGE_INCREMENT",
						center: ""
					},
					swipe: {
						up: "",
						down: "",
						left: "PAGE_DECREMENT",
						right: "PAGE_INCREMENT"
					}
				}
  </td>
</tr>
</tbody>

Dependencies

Installed via npm install

Troubleshooting

  1. Page won't change

    • Check that LED on back of Hover board is lit. If not power wires are not correct
    • Check that python library from Hoverlabs works, found here. If this detects motion, you have the wiring correct.
    • Check that MMM-pages is installed, and you have multiple pages set up
    • Check config.js file.. by default when you swipe or tap left or right, it will trigger PAGE_INCREMENT and PAGE_DECREMENT

Developers

Run the test npm script, which runs linters

npm test

LICENSE

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.