npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bdsd.sock

v2.0.16

Published

Bobaos Datapoint Sdk Unix Domain Socket

Downloads

16

Readme

bdsd - baos datapoint sdk daemon

This module intended to solve architecturing problem when developing js applcation for KNX. Nodejs connects to BAOS 838 module via serial port, usually /dev/ttyAMA0 and it handles only one connection at a time. But what if you want to connect to KNX bus multiple clients? If you want to write some custom scripts and use this device as a MQTT gateway at a same time?

So, schematically it may look like this:

meow

Installation

Assuming you have Raspberry Pi with installed Raspbian with configured access to BAOS module via /dev/ttyAMA0.

If not, follow instructions on bobaos repository page

Installation via script

$ curl -L https://raw.githubusercontent.com/bobaos/bdsd.sock/master/bdsd_install.sh | bash

Manual installation

1. Install npm package

$ sudo npm install -g bdsd.sock --unsafe-perm

Check if it executes correctly:

$ bdsd.sock
IPC: Checking for leftover socket.
IPC: No leftover socket found.
IPC: Listening at  /run/user/1000/bdsd.sock
BAOS: connected to baos
BAOS: success on setting indications to: 0
BAOS: success on get datapoint description: { id: 1 , dpt:  dpt9 }
BAOS: success on get datapoint description: { id: 2 , dpt:  dpt5 }
......
......
BAOS: success on get datapoint description: { id: 999 , dpt:  dpt16 }
BAOS: success on get datapoint description: { id: 1000 , dpt:  dpt16 }
BAOS: success on setting indications to: 1
BAOS: got bus state: connected

Since version 2.0.0 bdsd.sock accepts command line arguments to ease running on different platforms.

$ bdsd.sock --help
Options:
  --help                   Show help                                   [boolean]
  --version                Show version number                         [boolean]
  --sockfile, -s           path to socket file. Default:
                           /run/user/1000/bdsd.sock'
  --serialport-device, -d  path to serialport device. Default: /dev/ttyAMA0
  --serialport-params, -p  serialport parameters: "baud rate,parity,data
                           bits,stop bits". Default: "19200,even,8,1"

2. Create systemd service folders, create service file

$ cd ~/
$ mkdir ~/.config/systemd
$ mkdir ~/.config/systemd/user
$ touch ~/.config/systemd/user/bdsd.service

Then add following to this file using your favourite text editor:

[Unit]
Description=Bobaos Datapoint Sdk Daemon

[Service]
ExecStart=/usr/bin/env bdsd.sock

[Install]
WantedBy=default.target

3. Enable service, enable automatic start-up

$ systemctl --user daemon-reload
$ systemctl --user enable bdsd.service
$ sudo loginctl enable-linger pi

4. Start the service

$ systemctl --user start bdsd.service

5. Check with bdsd-cli

$ sudo npm -g install bdsd-cli
$ bdsd-cli
connected
bobaos> setProgrammingMode -v 1
Set programming mode: success
bobaos> getValue -s 1
{ id: 1, value: true }
bobaos>

Usage in js

For js applications there will be available client-side library which you may install from npm.

Further information you can find in repo: bdsd.client

Usage with other programming languages

For other programming languages you may implement client-side library which should communicate with IPC following Bobaos Datapoint Sdk Message Protocol.

Support me

You can send me a beer by PayPal