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

serial2excel

v1.1.4

Published

Command-line utility for capturing data from a serial connection and exporting it to an Excel spreadsheet.

Downloads

9

Readme

serial2excel-screenshot

Serial2Excel is a CLI for capturing data from a serial connection (e.g. Arduino) and exporting it to an Excel spreadsheet, a CSV or JSON file.

If this package is helping you, maybe consider buying me a coffee :).

Table of Contents

Features

  • Capture data from a serial device.
  • Process incoming data in real-time.
  • Generate Excel, CSV or 🆕JSON files containing the processed data.

Node Compatibility

serial2excel has not been tested on every singe NodeJS version. For best results you may stick to LTS versions. Issue reports related are highly appreciated.

Installation

Install serial2excel globally using npm:

npm install -g serial2excel

or run

npx serial2excel [port] [options]

Notes

  • Ensure that no other devices or programs are utilizing the serial connection before running the command.
  • If you don't include file extensions in your output file path, the CLI will add them based on the chosen file type (see second example).
  • If you have any occuring issues, email me or create a Github issue.
  • If you are using Windows PowerShell make sure two wrap your columns in quotation marks -c 'Column1,Column2,Column3'. Otherwise PowerShell parses the commas wrong, resulting in an error.
  • Use -h or --help to display information about the available options.

Usage

Once installed, you can use the serial2excel command to capture data from a serial device and export it to Excel, CSV or JSON format.

Ensure that no other devices or programs are utilizing the serial connection before running the command.

serial2excel [port] [options]
  1. Ensure that the serial device is configured to send data in a seperated format, such as data1;data2;.... You can define a custom seperator setting the -s flag. Your serial monitor must be set to use NR & CR.

serial-monitor-screenshot

  1. Start Serial2Excel by running it in your terminal or command prompt. Set the columns as they fit to your data.

  2. The CLI will capture data from the serial device automatically as it's sent.

  3. When you're done sending data, send the command stop via the serial device. This signals to the CLI that data transmission is complete.

  4. Once the data processing is complete the output file will be generated (Excel spreadsheet / CSV / JSON).

If you have any occuring issues, do not hesitate to email me or create a Github issue.

Options

-V,  --version                       output the version number
-br, --baud-rate <number>            set baud rate for serial communication (default: 9600)
-t,  --type <filetype>               set expected file type (choices: "xlsx", "csv", "json", default: "xlsx")
-s, --seperator <separator>          set custom seperator - this will only effect the data your sending, not the columns specified in the cli (default: ";")
-o,  --output <filepath>             define the output file path and filename. (e.g. '/path/to/file/filename')
-c,  --columns <col1,col2,...>       define the columns of the table (e.g. 'Song,Musician,Album')
-h,  --help                          display help for command

Examples

  1. You have an Arduino running on port 'com4', which sends weather data including Temperatur, Humidity and Pressure formatted as Temperatur;Humidity;Pressure. You want to export the data as CSV. Your command prompt might look like this:
    serial2excel com4 -t csv -o ./data -c 'Temperature,Humidity,Pressure'
  1. Your serial device runs on port '/dev/ttyUSB0' and sends data about a hardware device your testing and debugging. The device operates at 115200 baud and the data is formatted as Acceleration|Speed|Timestamp.
    serial2excel /dev/ttyUSB0 -o ./data.xlsx -br 115200 -s '|' -c 'Acceleration,Speed,Timestamp'

Note: Changing the seperator only applies to the data your sending from your serial device. In the CLI itself, keep using the comma.

Errors

Invalid user input (100)

  • 101: Invalid Port. Make sure you choose the right port, where the serial connection is running on.

Invalid Data (300)

  • 301: Column mismatch. The provided data has more columns than the table. Make sure every data row has the exact same columns. However you can bypass this, by adding more columns to the -c flag than actually needed (e.g. -c 'Temperatur,Humidity,Pressure,-,-,...'), though this is not recommended.

Internal (500)

  • 501: Error writing to file. Try again later.