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

particle-firmware-update-js

v2.1.3

Published

Particle module for node js that listen for online devices and pushes a firmware to that device.

Downloads

1

Readme

Particle Firmware Update

This module allows you to automate the firmware release for particle photon device.


How it works?

When a device becomes online, the module get notified about that, and check whether the device has the last firmware or not; if not, the module pushes to the device the new firmware and mark the device as updated.

Install

$ npm install particle-firmware-update-js --save

Initialization


var p = require('particle-firmware-update-js');

Configuration

You can provide the configuration via your code


p.configure({
  "token":"test",
  "firmware":"firmware2.bin",
  "firmwareLocation":"/opt/firmware",
  "dbLocation":"/opt/db/"
});

Also, you can override the configuration options passing the flags:


node app.js --token=<token> --firmware=firmware.bin --firmware-location=/opt/firmware

Or even you can use the default firmware location (./firmware):


node app.js --token=<token> --firmware=firmware.bin

Or even you can use the default firmware name (firmware.bin):


node app.js --token=<token> --firmware-location=/opt/firmware

also, the module may keep in memory (as default option) the firmware definicion and the flashing history, meaning that the data will lost on reboot. If you want to keep all the operation you have to specify the db location:


node app.js --token=<token> --db-location=/top/db/

And, if you need to flash a specific firmware to a specific device you can to name your firmware file with the Particle device id, asumming your device has the ID ABCDE1234ABCDE1234ABCDE1234:


ABCDE1234ABCDE1234ABCDE1234ABCDE1234.bin

so you can diferentiate which firmware goes to which device.

Start

Start listening for events


p.start();

Command line options

  • token : (Mandatory). Your particle token associated to your account.
  • firmware : (Optional. Default firmware.bin). The name of your latest firmware to flash.
  • firmware-location : (Optional. Default ./firmware). The directory where the module will look for a firmware file.
  • db-location : (Optional). If you specify this path, your DB will be on memory, otherwise the database will be stored in that location.

JSON Config options

  • token : (Mandatory). Your particle token associated to your account.
  • firmware : (Optional. Default firmware.bin). The name of your latest firmware to flash.
  • firmwareLocation : (Optional. Default ./firmware). The directory where the module will look for a firmware file.
  • dbLocation : (Optional). If you specify this path, your DB will be on memory, otherwise the database will be stored in that location.

New in version 2.1.2

  • Now you can target a specific firmware to a specific device

New in version 2.0.1

  • Now the module uses bedb as a database to keep in memory or in the file system the firmware definition and flashing history