Skip to content

Commit

Permalink
Merge pull request #82 from KGS501/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
danielwippermann committed Nov 14, 2022
2 parents 9991bb8 + ac04bf2 commit a134067
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
15 changes: 15 additions & 0 deletions examples/json-live-data-server/README.md
Expand Up @@ -20,13 +20,28 @@ Starts up a simple web server

You must edit the file `config.js` to adapt it to your environment. See the file for details.

### Serial to json

...
connectionClassName: 'SerialConnection',
connectionOptions: {
/**
* The serial port to which the Vbus/USB device is connected. (commonly 'dev/ttyACM0')
* @type {String}
*/
path: '<YOUR_SERIAL_PORT>',

},


## Starting

$ cd .../resol-vbus/examples/json-live-data-server
$ node index.js
info: Ready to serve from the following URLs:
info: - http://127.0.0.1:3333/api/v1/live-data (internal)


### Data Returned as JSON
Accessing one of the listed URLs with a browser returns a simplified list of VBus value:
Expand Down
11 changes: 10 additions & 1 deletion examples/json-live-data-server/config.js.example
Expand Up @@ -28,19 +28,28 @@ const config = {
loggingFilename: path.resolve(__dirname, 'live-data.json'),

/**
* The name of the `Connection` subclass to use for connecting to the VBus.
* Either 'TcpConnection' or 'SerialConnection' to connect to the VBus.
* @type {String}
*/
connectionClassName: 'TcpConnection',

connectionOptions: {
/**
* SerialConnection only:
* The serial port to which the Vbus/USB device is connected.
* @type {String}
*/
path: '/dev/ttyACM0',

/**
* TcpConnection only:
* The host name / IP address of the VBus/LAN or Datalogger device.
* @type {String}
*/
host: '192.168.13.21',

/**
* TcpConnection only:
* The password for the VBus/LAN or Datalogger device.
* @type {String}
*/
Expand Down

0 comments on commit a134067

Please sign in to comment.