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

uwrf-team-rocket-flight-recorder

v1.0.1

Published

Records flight data on the rocket. It comes with a fancy web interface.

Downloads

1

Readme

UWRF Falcon Rocket Team Flight Recorder

Flight Recorder Web Interface Screenshot for UWRF Falcon Team Rocket Flight Recorder

Description:

A rocket flight recorder that runs on a Raspberry Pi with a Sense Hat. It can be used as a template for a Node.js app that does some kind of long processing in the background on a separate thread.

It comes with a web interface that allows a user to start or stop the flight recorder script, download any of the available logs, or delete all logs.

The web interface also notifies the user of the current state of the script on the Pi and attempts to notify the user of any errors it detects.

These directions are intended to permit a user to connect with the Pi over Ethernet to control the flight recorder script. If you are connecting by Wi-Fi, adjust the network setup steps accordingly.

Usage:

  1. Boot the Raspberry Pi

  2. Connect control computer/phone to Pi using networking technology of choice

  3. On control computer/phone, open a web browser and go to IP address of Pi

  4. Once web interface is up, click the "Start" button to start recording flight data

Setup:

  1. Physically install sense hat on Raspberry Pi

  2. Install dietpi on Raspberry Pi
    If using another distro, setup instructions may vary from this point on. You can set some of these settings ahead of time by editing "dietpi.txt" and "dietpi-wifi.txt" on the boot partition of the sd card before first boot.

  3. Before first boot, edit "dietpi.txt" to set the Pi to use a static IP address.

  4. (optional) Also edit "dietpi-wifi.txt" to preconfigure a wireless network to connect to on first boot.

  5. Boot the Pi. You will want to either have a keyboard and monitor plugged into the Pi, or you will need to know its IP address on the wireless network so you can SSH into it. Let DietPi do its first-run scripts before doing anything.

  6. Update dietpi using:

dietpi-update  
apt update
  1. (optional) Remove unnecessary packages using "dietpi-software"

  2. Install dependencies:

apt install sense-hat build-essential git  

build-essential is needed by the nodejs binding library node-sense-hat, and git is needed by the n nodejs version manager

  1. (optional) Install quality-of-life packages:
apt install syncthing less mlocate rsync e2fsprogs

These made it easier for me to develop, and/or are nice to have if something goes wrong. To get an up-to-date syncthing, follow the directions at Up-To-Date Syncthing on Raspberry Pi

  1. Enable I2C using:
    "dietpi-config" -> "Advanced Options -> "I2C State" (just press to toggle from off to on)

  2. Install Node.js version 14.21.3 using the "n" nodejs version manager

curl -L https://git.io/n-install | bash  
n 14.21.3
  1. Install "flight-recorder" nodejs package locally
npm install uwrf-team-rocket-flight-recorder
  1. Copy the included system config files to their locations
cp dietpi-config-files/uwrf-team-rocket-flight-recorder.service /lib/systemd/system
cp dietpi-config-files/dnsmasq.conf /etc/dnsmasq.conf
  1. (optional) To reduce the risk of data loss, edit /etc/fstab to add the boot option "sync" to the root partition. I've included a sample fstab in dietpi-config-files/, but yours will probably have different partition UUIDs.

  2. Set the Raspberry Pi to serve DHCP addresses on its ethernet port or run as a Wi-Fi hotspot (tutorial)

  3. Connect control computer/phone to Raspberry Pi

Notes:

  • I wrote this script under the assumption that I was running as root. If you are not running node as root (usually a good idea), you many have to add "sudo" to the command string for spawning the "sense-hat.js" process. I'm not sure about this, though.

  • Although I did not make any design decisions that I knew were overtly insecure, security was not my primary priority on this project. Thus, there is no user authentication and no client input sanitization. I also made no attempt to sanitize IPC messaging or calls, so a compromised "server.js" process running as a normal user may be able to run arbitrary privileged code if it it se to run "sense-hat.js" as root.

  • If you end up using this for anything, whether for its intended purpose or as a template, I'd love to know.

  • The only image resource that is included in this project is the favicon, and I license that under the same license as the rest of this project.

  • Quality-of-life packages explained:

    • syncthing: I wrote this app on the Pi over SSH. I used syncthing to automatically back up the app files from the Pi as I changed them

    • rsync: I tried to use this to back up the app files from the Pi too. I switched to syncthing, but rsync is nice to have anyway

    • less: useful for viewing logs and the output of commands:

command | less  
  • mlocate: finds anything on the Pi (update database using the command updatedb)

  • e2fsprogs: if something goes wrong out in the field, this package of filesystem tools gives you a way to repair the filesystem

fsck.ext4 /