Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Package to ring & talk to your Tile Tracker
This project is the result of countless hours of reverse engineering the Tile bluetooth protocol.
If you like my work, give this repository a ⭐
or consider Buying Me A Coffee ☕
npm install node-tile
This package can use both node-ble or noble to connect to bluetooth. This means you require a bluetooth adapter.
Based on which bluetooth package you want to use, you might need some additional configuration:
(Source) In order to allow a connection with the DBus daemon, you have to set up right permissions.
Create the file /etc/dbus-1/system.d/node-ble.conf
with the following content (customize with userid)
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="%userid%">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.GattCharacteristic1"/>
<allow send_interface="org.bluez.GattDescriptor1"/>
<allow send_interface="org.freedesktop.DBus.ObjectManager"/>
<allow send_interface="org.freedesktop.DBus.Properties"/>
</policy>
</busconfig>
(Source) To use this package on linux, you will have to run the script as root to get access to your bluetooth adapter. Otherwise you will get the error that the noble adapter's state is unauthorized.
You can also fix this by running the following command:
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
This grants the node
binary cap_net_raw
privileges, so it can start/stop BLE advertising.
Note: The above command requires setcap
to be installed.
It can be installed the following way:
sudo apt-get install libcap2-bin
su -c \'yum install libcap2-bin\'
You will have to checkout the noble documentation on how to configure NodeJS to use a Bluetooth Adapter.See example.js or example-noble.js. Once you have a connected service, you can do the following:
Make your tile ring:
await service.sendRinger(TileVolume.MED)
Program the default ring tone:
await service.sendRinger(TileVolume.MED)
Run some code on a single tab on your tile's button:
service.on("singleTab", _ => console.log("Got single tab!"))
Double tab:
service.on("doubleTab", _ => console.log("Got double tab!"))
On signal strength/RSSI update reported by bluetooth adapter
only supported by noble, NOT node-ble
service.on("rssi", rssi => console.log("rssi", rssi))
On signal strength/RSSI update reported by your tile
service.on("tileRssi", rssi => console.log("tileRssi", rssi))
Get debug output:
service.on("debug", msg => console.log("debug", msg))
This package may not work with all Tiles as the protocol changes over time. Also the level of success may vary depending on your bluetooth adapter and tile.
FAQs
Package to ring & talk to your Tile Tracker
The npm package node-tile receives a total of 1 weekly downloads. As such, node-tile popularity was classified as not popular.
We found that node-tile 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.