Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sphero-connector-http

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sphero-connector-http

A small CLI tool to run an express based HTTP server for connecting and controlling Sphero toys via HTTP requests

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

npm version Dependency Status devDependency Status Build Status Coverage

Sphero Connector HTTP

Sphero Connector HTTP

This is a small CLI tool to run an express based HTTP server for connecting and controlling Sphero toys via HTTP requests. It uses Sphero Connector Core, a tiny wrapper around the unofficial Sphero V2 API for communicating with Sphero toys.

Getting Started

Install Sphero-Connector-HTTP via npm:

npm install --save sphero-connector-http

Add npm run script to your package.json:

{
  "scripts": {
    "sphero-connector-http": "sphero-connector-http"
  }
}

Add the following section to your package.json:

{
  "sphero-connector": {
    "type": "http"
  }
}

Finally, run npm run sphero-connector-http and sphero-connector-http will start its express server listening on port 3000.

Configuration

Port

By default, sphero-connector-http will listen on port 3000 for incoming HTTP requests. You can change the port number (range from 3.000 to 40.000) in the sphero-connector section of your package.json as follows:

{
  "sphero-connector": {
    "type": "http",
    "port": 7331
  }
}

Connect with toy on startup

To auto-connect with a Sphero toy on start, you can specify the toy type and name in your package.json.

{
  "sphero-connector": {
    "type": "http",
    "connectOnStart": {
      "toyType": "SpheroMini",
      "toyName": "SM-0815"
    }
  }
}

Valid values for toyType are: SpheroMini, LightningMcQueen, R2D2, R2Q5, BB9E. The toyName option is currently only supported for toyType: "SpheroMini".

API

  • POST /connect (body: { type: 'SpheroMini' }, name: 'SM-0815' })
  • POST /wake
  • POST /sleep
  • POST /main-led-color/random
  • POST /main-led-color/hex (body: { color: '#ACADDB' })

License

Please be aware of the licenses of the components used in this project. Everything else that has been developed by the contributions to this project is under MIT License.

Keywords

FAQs

Package last updated on 27 Jan 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc