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

node-tile

v1.1.1

Published

Package to ring & talk to your Tile Tracker

Downloads

3

Readme

node-tile

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 ☕

Installation

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:

Node-ble

Provide permissions

(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>

Noble

Running without root/sudo (Linux-specific)

(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:

  • apt: sudo apt-get install libcap2-bin
  • yum: su -c \'yum install libcap2-bin\' You will have to checkout the noble documentation on how to configure NodeJS to use a Bluetooth Adapter.

Usage

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))

Features

  • Make your Tile ring
  • Get the signal strength to your Tile (only available using noble)
  • Act on the event you single click your Tile button
  • Act on the event you double click your Tile button
  • Program the "Bionic Birdie" song

Tested & working with

  • Tile Slim 2022
  • Tile Pro 2022
  • Tile Mate 2022

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.