sensorium-server
Http proxy server for connecting web to serialPort
Last updated 3 years ago by jeremy_yang .
MIT · Original npm · Tarball · package.json
$ cnpm install sensorium-server -g
SYNC missed versions from official npm registry.

#sensorium-server sensorium-server is a broker tool based on socket.io and serialport. With this tool, you can connect HTML pages easily to your computer USB serialport and debug your protocol communication with the hardware.

Change log

  • sensorium-server@0.1.0 is based on serialport@6.0.0
  • sensorium-server@0.1.1 is based on serialport@6.0.4, this 6.0.4 version has fixed some bugs in windows

Install

You can install it globally like this as recommendation.

npm install sensorium-server -g

or install locally in your project,

npm install sensorium-server -save-dev

if you update your node version, probably sensorium-server would not work. You just need to update your ss by npm install sensorium-server -g to rebuild it.

Usage

Firstly, make sure you have initialized your project. Then complete the JavaScript code to set up connections between your pages and the sensorium-server tool just like this:

import io from 'socket.io-client';
let socket = io.connect('http://localhost:8800');

socket.on('sensor2web', function (data) {
    console.log(JSON.parse(data));
});

let buf = [0xf3, 0x0a, 0x55, 0xf4];
socket.emit('web2sensor', { buf: JSON.stringify(buf) });

Secondly, open your command line and in any file directories(because it can run globally)type in

sensorium-server

or just simply like this,

ss

** You may need connect a USB line to your computer before, or it would fail to start*

when comes the start-up log, it says the connection has been established!

>>> ss
Starting up sensorium-server, serving on port 8800
  http://127.0.0.1:8800
Hit CTRL + C to stop the server

Defualtly ss connets to the [0] ports as follows:
[ 0 ] : /dev/tty.wchusbserial1420  √
[ 1 ] : /dev/tty.Makeblock-ELETSPP
[ 2 ] : /dev/tty.Bluetooth-Incoming-Port
If there comes an error or no response, you should try to connect to the other port:
 ss -s 1

Current Tags

  • 0.1.1                                ...           latest (3 years ago)

7 Versions

  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 6
Last Day 0
Last Week 4
Last Month 11
Dependencies (7)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |