# sensorium-server

> Http proxy server for connecting web to serialPort

Latest version **0.1.1** (published 2017-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install sensorium-server
pnpm add sensorium-server
yarn add sensorium-server
bun add sensorium-server
```

Provides the commands `ss`, `sensorium-server`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-10-26 |
| First published | 2017-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jeremy_yang |
| Maintainers | jeremy_yang |
| Keywords | sensorium-server, serialPort, IOT, sensor |

## Links

- npm: https://www.npmjs.com/package/sensorium-server
- npm.io page: https://npm.io/package/sensorium-server

## Dependencies (7)

- [colors](https://npm.io/package/colors.md) 1.0.3
- [corser](https://npm.io/package/corser.md) ~2.0.0
- [opener](https://npm.io/package/opener.md) ~1.4.0
- [optimist](https://npm.io/package/optimist.md) 0.6.x
- [socket.io](https://npm.io/package/socket.io.md) ^2.0.3
- [portfinder](https://npm.io/package/portfinder.md) ^1.0.13
- [serialport](https://npm.io/package/serialport.md) ^6.0.4

## Recent versions

- 0.1.1 (latest) — 2017-10-26
- 0.1.0 — 2017-10-18
- 0.0.5 — 2017-09-20
- 0.0.4 — 2017-08-08
- 0.0.3 — 2017-08-02
- 0.0.2 — 2017-08-02
- 0.0.1 — 2017-07-27

## README

#sensorium-server
sensorium-server is a broker tool based on `socket.io` and [serialport](https://www.npmjs.com/package/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
```

---
_Source: https://npm.io/package/sensorium-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
