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

teslams-rdkafka

v0.3.0

Published

Stream Tesla telemetry into Apache Kafka using librdkafka C/C++ library

Downloads

9

Readme

Tesla Telemetry gateway for Apache Kafka

An implementation in Node.js of the streaming telemetry interface of Tesla Motors with output to Apache Kafka.

Disclaimer

Use these programs at your own risk. The authors do not guaranteed the proper functioning of these applications. This code attempts to use the same interfaces used by the official Tesla phone apps. However, it is possible that use of this code may cause unexpected damage for which nobody but you are responsible.

Contributors

Hans Jespersen (https://github.com/hjespers)

Dependencies

Linux dependencies

  • openssl
  • libssl-dev
  • libsasl2-dev
  • libsasl2-modules
  • C++ toolchain

macOS dependencies

  • Apple Xcode command line tools (for the compiler)
  • openssl installed via Brew (needed for root certs file in /usr/local/etc/openssl/cert.pem)
  • Export CPPFLAGS=-I/usr/local/opt/openssl/include and LDFLAGS=-L/usr/local/opt/openssl/lib

Installation

To use this program you must download and install 'node' from http://nodejs.org

Install from npm on macOS

  brew install openssl
  export CPPFLAGS=-I/usr/local/opt/openssl/include
  export LDFLAGS=-L/usr/local/opt/openssl/lib
  sudo -E npm install -g teslams-rdkafka

Install from npm on Ubuntu

  sudo apt install nodejs-legacy
  sudo apt install openssl libssl-dev libsasl2-dev libsasl2-modules
  sudo npm install -g teslams-rdkafka

Install from npm on CentOS

  sudo yum install epel-release nodejs
  sudo yum install openssl openssl-devel cyrus-sasl-devel
  sudo npm install -g teslams-rdkafka

Uninstall

  sudo npm uninstall -g ccloud-node-console-client

Useage

The program requires -u and -p in order to specify the Tesla Motors user name and password to access your Model S. Or, you can instead create a json file in ~/.teslams/config.json and specify them once, in the following format:

{
	"username": "Your teslamotors.com username/email",
	"password": "Your teslamotors.com password"
}

In addition to putting your password as a command line option or a file, you can alternatively use the $TSLA_USERNAME and $TSLA_PASSWORD environment variables. These environment variable allow the execution of these apps in Heroku or other Platform-as-a-Service providers.

teslams-rdkafka - Capture and log real-time telemetry to Apache Kafka for analytics

An application which uses the TESLA HTTP Long Polling "STREAMING" API to get continuous telemetry from a Tesla Model S or Model X. A valid teslamotors.com login and password is required and must be provided on the command line options.

By default the output is a stream of JSON formatted messages published to a set of Kafka topics called "teslams", "teslams.climate_state", and "teslams.charge_state" with the keys being the id if the vehicle. The output topic prefix can be changed by using the --topic command line option.

To execute run:

teslams-rdkafka -u <username> -p <password> -U <kafka_username> -P <kafka_password> --kafka localhost:9092 --topic my_kafka_topic 

Usage: teslams-rdkafka -u <username> -p <password> -U <kafka_username> -P <kafka_password> [-sz]
        [--kafka localhost:9092] [--topic my_kafka_topic] [--ca_cert_loc /usr/local/etc/openssl/cert.pem]
        [--values <value list>] [--maxrpm <#num>] [--vehicle offset] [--naptime <#num_mins>]

Options:
  -u, --username       Teslamotors.com login
  -p, --password       Teslamotors.com password
  -U, --sasl_username  Confluent Cloud login                                                        [required]
  -P, --sasl_password  Confluent Cloud password                                                     [required]
  -C, --ca_cert_loc    location of SSL Certs                                                        [default: "/usr/local/etc/openssl/cert.pem"]
  -s, --silent         Silent mode: no output to console                                            [boolean]
  -z, --zzz            enable sleep mode checking                                                   [boolean]
  -r, --maxrpm         Maximum number of requests per minute                                        [default: 6]
  -k, --kafka          Kafka bootstrap servers                                                      [required]
  -t, --topic          Kafka publish topic                                                          [default: "teslams"]
  -n, --naptime        Number of minutes to nap                                                     [default: 30]
  -N, --napcheck       Number of minutes between nap checks                                         [default: 1]
  -O, --vehicle        Select the vehicle offset (i.e. 0 or 1) for accounts with multiple vehicles  [default: 0]
  -S, --sleepcheck     Number of minutes between sleep checks                                       [default: 1]
  -v, --values         List of values to collect                                                    [default: "speed,odometer,soc,elevation,est_heading,est_lat,est_lng,power,shift_state,range,est_range,heading"]
  -?, --help           Print usage information     

Troubleshooting

If you see the following error when you run either console producer or consumer, it means you have not installed librdkafka correctly with the required SSL and SASL libraries. See install instructions for installing openssl and setting compiler flags.

Caught error: Error: Invalid value for configuration property "security.protocol"

If the ccloud-console-producer or ccloud-console-consumer immediately exits to the shell prompt you are likely missing the Root CA Certificates. See the location of these certs (below) and add the correct -S flag pointing the the location of the certs on your operating system.

The default SSL Certificate location is /usr/local/etc/openssl/cert.pem which works on macOS but every flavor of Linux puts root certificates in different places.

Ubuntu/Debian/Raspbian: /etc/ssl/certs CentOS/RedHat: /etc/pki/tls/cert.pem macOS: /usr/local/etc/openssl/cert.pem (from brew install openssl)

For Ubuntu add the -C /etc/ssl/certs flag to specify your certificate location:

teslams-rdkafka -u [email protected] -p MyTeslaPassword -U $CCLOUD_SASL_USERNAME -P $CCLOUD_SASL_PASSWORD -k $CCLOUD_BROKERS -C /etc/ssl/certs

For CentOS/RedHat add the -C /etc/pki/tls/cert.pem flag to specify your certificate location:

teslams-rdkafka -u [email protected] -p MyTeslaPassword -U $CCLOUD_SASL_USERNAME -P $CCLOUD_SASL_PASSWORD -k $CCLOUD_BROKERS -C /etc/pki/tls/cert.pem 

Feedback and Support

For more information, feedback, or community support see the Tesla Motors Club forum at http://www.teslamotorsclub.com/showthread.php/13410-Model-S-REST-API or email [email protected]