
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
bobaos.pub
Advanced tools
Hello, friend.
This module is an update for bdsd.sock.
Bobaos.Pub uses redis and bee-queue to accepts requests.
config.json/ipc.request_channel, by default it is bobaos_req.config.json/ipc.service_channel, by default it is bobaos_service.datapoint value, server item, sdk status over channel defined in config.json, by default it is bobaos_bcast.Request queue serves common requests like get datapoint value, etc.
Service queue serves requests ping/get sdk state/reset, so, if program stuck at datapoint method, it will be possible to reset sdk.
In addition to queues, bobaos.pub listen redis pubsub channels with same names(bobaos_req/bobaos_service) for incoming request in stringified json. This feature is supported from version bobaos.pub@2.0.8.
sudo apt install redis-server
sudo systemctl daemon-reload
sudo systemctl start redis.service
sudo npm i -g bobaos.pub --unsafe-perm
/dev/ttyS* or /dev/ttyAMA0 for RPi) to /usr/lib/node_modules/bobaos.pub/config.json.Since version bobaos.pub@2.0.10 config file ~/.config/bobaos/pub.service is used as an overriding config file. So, after first run, you will be able to modify settings from there.
/etc/systemd/system/bobaos_pub.service:[Unit]
Description=PubSub service running on nodejs
After=redis.service
[Service]
User=pi
ExecStart=/usr/bin/env bobaos-pub
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Reload systemd daemon, enable and start service.
sudo systemctl daemon-reload
sudo systemctl enable bobaos_pub.service
sudo systemctl start bobaos_pub.service
$ sudo npm i -g bobaos.tool
$ bobaos-tool
bobaos> ping
ping: true
Bee-Queue job is sent to config.ipc.request_channel with data object, consist following fields:
method is an API method.payload depends on method. It may be datapoint id, array of ids, value, or null.Request:
{
"method": "get parameter byte",
"payload": [1,2,3,4]
}
Response is processes by queue.on("job succeeded"):
{
"method": "success",
"payload": [1,3,5,7]
}
In case of error, method field in response will contain "error" string and payload will describe error.
Since version 2.0.8 this feature is supported to simplify job adding.
bobaos.pub listens request and service channels and on incoming request it add job to corresponding queue.
Only difference from bee-queue request is that request should contain response_channel field, so request sender will receive response from bobaos on that channel. This channels may be randomly generated, then subscribed, and after request was sent and response came, client may unsubscribe from this channel.
payload: null
If bobaos.pub service is running, true will be returned as a response payload.
payload: null
Response payload: "ready"/"stopped".
payload: null
payload: null
Get version of bobaos.pub npm package.
payload: null/number/array of numbers
Returns descriptions for given object ids. If payload is null, return description for all configured datapoints.
Response payload example:
{
"valid": "true",
"id": "1",
"length": "2",
"dpt": "dpt9",
"flag_priority": "low",
"flag_communication": "true",
"flag_read": "false",
"flag_write": "true",
"false": "false",
"flag_readOnInit": "false",
"flag_update": "true",
"flag_transmit": "true",
"value": "23.6",
"raw": "DJw="
}
payload: number/array of numbers
Returns values for given object ids. Sends data to BAOS via UART. When received, value is saved in redis, so can be got also by get stored value method. It is recommended to get values for multiple datapoints at once to reduce UART message count.
Response payload example:
{
"id":1,
"value":23.6,
"raw":"DJw="
}
Returns value as get value method, but without data sending by UART. Values is taken from redis database.
payload: null
Returns values for all configured datapoints. May take a while to accomplish. Response payload is the same as for get values/get stored values.
payload: Object/Array of objects
Request payload object should be one of following: { id: <Number>, value: <Value> }, { id: <Number>, raw: <String> }, where raw is base64 encoded buffer.
If payload is array of objects, it is possible to combine value types, so following payload is valid:
[
{id: 2, value: true}
{id: 3, raw: "AA=="}
]
After values are sent to bus, bobaos.pub broadcasts them via pubsub channel bobaos_bcast.
payload: number/array of numbers
payload: null/number/array of numbers
If payload is null, all server items to be returned in response.
Response payload example:
[
{
"id": 1,
"value": [ 0, 0, 197, 8, 0, 3],
"raw": "AADFCAAD"
},
{
"id": 2,
"value": [ 16 ],
"raw": "EA=="
},
{
"id": 3,
"value": [ 18 ],
"raw": "Eg=="
}
]
payload: 1/0/true/false
payload: null
Response payload: true/false
payload: number/array of numbers
Response payload example:
[ 0, 1, 2, 5, 7, 3]
TODO
To write nodejs applications use bobaos.sub client library.
Basic Java library jobaos.
Help needed.
FAQs
Bobaos SDK powered by js, redis and BeeQueue
We found that bobaos.pub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.