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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sl-departures-display

v1.0.0

Published

A Raspberry Pi application that displays real-time public transport departures (SL/Stockholm) on an 8x8 LED matrix. It uses a GPS or IP lookup to determine location, finds the nearest stations, and fetches live data.

Downloads

17

Readme

SL Departure Display for SenseHAT:

This project turns a Raspberry Pi with an 8x8 senseHat screen into a real-time public transport departure board for the Stockholm Public Transport (SL) system. It uses an external GPS or IP location to find the nearest stations and displays live departure times on 8x8 LED matrix.

Features:

  • Real-time Data: Fetches live departure information from the SL API.
  • Automatic Location: Uses connected GPS sensor (/dev/ttyACM0) as the primary source, falling back to IP geolocation for city-level location when GPS fails.
  • Location Update: Checks every 5 min if the device has moved more than 0.5 km and automatically updates the list of nearest stations.
  • Persistent Operation: Uses systemd service to ensure autostart on boot and auto-restart on crash.
  • Interaction: Stop navigation and departure selection via the SenseHAT Joystick.
  • Animated Feedback: Plays a line-specific transit animation followed by a scrolling text display for the selected departure.

System Prerequisites

You must have the following hardware and software installed and configured on your Raspberry Pi.

Hardware Requirements

  • Raspberry Pi (Model 3B+ or newer recommended).
  • SenseHAT module
  • External GPS device (required for accurate, moving location data).

Software Dependencies

  1. Node.js (v18 or higher) installed on your Raspberry Pi.
  2. npm (Node Package Manager).

Setup and Installation

Project uses standard Node.js convention (npm start) and the Linux service manager (systemd).

1. Clone the Repository

Clone repo into the target user's home directory (/home/pi).

git clone [https://github.com/moyartumanley/Traffik-Lab.git](https://github.com/moyartumanley/Traffik-Lab.git)
cd Traffik-Lab

2. Dependencies

Install required Node.js modules as defined in package.json

npm install

3. Systemd Service Config (OPTIONAL)

Resource: (https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html)

If you want the application to auto-restart, it has to be configured as a systemd unit.

Creating the service unit file

Ensuring you have admin privileges, create the service definition file.

sudo nano /etc/systemd/system/sl-display.service

Then insert the following config. WorkingDirectory param must reflect the project's cloned path. Save and exit.

[Unit]
Description=SL Departure Display Daemon
After=network.target

[Service]
User=pi
Group=pi
WorkingDirectory=/home/pi/Traffik-Lab
ExecStart=/usr/bin/npm start

Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

Activate service

Reload systemd daemon

sudo systemctl daemon-reload

Enable the service to ensure autostart on system boot

sudo systemctl enable sl-display.service

Initiate the service daemon

sudo systemctl start sl-display.service

For real-time logs (helpful for debugging)

sudo journalctl -u sl-display.service -f

How To Use:

Explanation of Screen Visuals:

  • Stop Selection (Bottom Row): Each light represents one of the 8 nearest stations. Stations are ordered left to right in order of distance from the user's location.
  • Departure Selection (Rows 1-7): This shows up to 7 upcoming departures for the stop currently selected in the bottom row.

Color Cues:

| What It Looks Like | What It Means | | :--- | :--- | | Bright LED | This is the item you have currently selected. | | Dim LED | This is a real stop or departure, but it is currently unselected. | | Color | The color of the LED tells you the color of the transit line. |

Joystick Controls

The joystick lets you select a specific stop and departure.

| Joystick Command | What It Does | User Intent | | :--- | :--- | :--- | | Left & Right | Change Stops: Selects a different station. | Use this to choose which of the 8 nearby stops you want to look at. | | Up & Down | Change Departures: Selects a different departure time or line. | Use this to pick the exact train or bus you want to check. | | Enter (Press Joystick) | Show Details: Shows more information about selected departure | Use this to see the full information (Destination, Line Number, and estimated time left) scroll across the screen. |

Notes:

  • When you change stops (left/right): The departure selection automatically jumps back to the first (earliest) departure for that new stop.
  • During Animation: When you press enter, the screen will flash a quick animation (like a moving train). During this animation and the scrolling text, the monitor is busy and will ignore all joystick movements. Wait for the screen to return to the grid before moving the joystick again.