Site Information

 Loading... Please wait...

Blog

Free SAE J1939 Protocol Stack for ESP32 — Open New Paths for CAN Bus Innovation

Posted by Wilfried Voss on

ARD1939 – SAE J1939 Protocol Stack Code for Arduino and ESP32We at Copperhill Technologies are excited to announce that we are releasing a fully functional SAE J1939 protocol stack for the ESP32 — and best of all, it’s completely free to use. Whether you’re an engineer, a student, or a maker, this opens up serious possibilities for CAN-bus projects and vehicle network applications — without licensing fees or restrictive terms.


What You Get — Professional-Grade J1939 Features, No Cost

While many protocol stacks lock you behind licensing fees or limited licenses, our J1939 stack removes that barrier. Here’s what it brings:

  • Zero licensing costs. You can use, modify, and deploy the software without paying royalties or worrying about vendor lock-in.

  • Full J1939 support, including:

    • Address claiming (so multiple ECUs can negotiate bus addresses)

    • Transport protocol (both BAM broadcast and RTS/CTS peer-to-peer for larger messages)

    • Request/response messages

    • Complete PGN (Parameter Group Number) handling

  • Robust error handling, bus-off recovery, and monitoring to keep the stack stable in real-world conditions

  • Ready for prototyping or real deployment in many use cases — from diagnostic tools to gateway devices

This stack is designed to be useful out of the box, but also transparent and modifiable — you can dig into the internals and tweak it for your needs.


Hardware Flexibility — Use It on Any ESP32 Board

We’ve tested this stack using our ESP32 module board that integrates Wi-Fi, Bluetooth (Classic + BLE), and a CAN transceiver. But the software is not tied to that specific board:

  • It will run on any ESP32 variant (DevKitC, WROOM, S3, etc.).

  • You may need to remap SPI or CAN interface pins depending on your board’s layout — a few lines of configuration are all that’s needed.

  • The idea is that, as long as you have an ESP32 and a CAN transceiver, you can adopt the stack with minimal hassle.

In short: “ESP32-based hardware? You’re good. Just adapt your pin wiring and go.”


Reliable CAN Bus Under the Hood

Implementing J1939 isn’t just about message formats. It’s also about reliability, robustness, and handling corner cases. To that end:

  • We enhanced the CAN driver with stricter error monitoring and automatic bus-off recovery (if the controller fails it can reset itself).

  • Full support for the J1939 transport protocol (both broadcast and peer-to-peer) means you can send and receive long messages on the network, segmented when needed.

  • These features help ensure stable, predictable behavior even in noisy or challenging environments (e.g. in-vehicle networks, industrial machines).


Deepen Your Knowledge with a Companion Text

If you’re not already deeply familiar with J1939 — or if you want a full reference — we recommend the companion textbook:

SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino

This book walks you through:

  • J1939 internals (timing, layering, PGN structure, etc.)

  • Hands-on examples (data loggers, network scanners, gateway systems)

  • Step-by-step walkthroughs tied to the codebase

  • Deeper insight into how the stack implementation works

Whether you’re a beginner or an experienced developer, it complements the software nicely.


Ideal Applications & Use Cases

With the flexibility of the ESP32 (wireless + processing) and a feature-rich J1939 stack, you can build many useful systems:

  • J1939 ↔ USB gateways or protocol converters

  • Vehicle network scanners or diagnostic tools

  • Fleet telematics or data loggers (with wireless upload to backend)

  • CAN bus monitoring or logging systems in industrial machinery

  • Simulation of ECUs or test benches

  • Remote or IoT-enabled monitoring (ESP32’s Wi-Fi/Bluetooth can bridge data to the cloud)

The integration of wireless networking with J1939 gives you a powerful platform for hybrid systems — on-vehicle data + wireless connectivity.


Get Started Right Now

Here’s how you can dive in:

  1. Download the example sketch and full source code from our site.

  2. Open & compile in Arduino IDE (or your preferred ESP32 toolchain).

  3. Upload to your ESP32 board.

  4. Connect the ESP32 + CAN transceiver to a J1939/CAN bus and start experimenting.

Note: This software is provided “as is” for educational and demonstration purposes. While it’s a strong foundation, you’ll want to validate and customize it further before deploying in commercial or safety-critical systems.


Summary

Copperhill Technologies is proud to contribute this free SAE J1939 protocol stack for ESP32 to the community. It’s versatile, powerful, and designed for transparency. No licensing fees. No hidden restrictions. Just a solid foundation for your next CAN bus or vehicle network project.

Whether you want to build gateways, diagnostic tools, data loggers, or do experiments with J1939 networks — this gives you the software building blocks. Combine it with ESP32’s communication features, and you’re ready to prototype connected, intelligent systems for automotive, industrial, or IoT environments.


SAE J1939 Starter Kit And Network SimulatorSAE J1939 Starter Kit And Network Simulator

Our JCOM.J1939 Starter Kit and Network Simulator is built for both seasoned engineers and beginners who want to explore SAE J1939 data communication without relying on a real-world vehicle network such as a diesel engine.

To create a functioning network, you always need at least two nodes. This requirement is particularly important with CAN/J1939, where a single CAN controller will shut down if it transmits data but receives no response.

That’s why our Starter Kit includes two fully functional J1939 nodes. At its core is the JCOM.J1939.USB, an SAE J1939 ECU Simulator Board with a USB interface. Together, these nodes provide a self-contained test environment where you can send, receive, and analyze J1939 messages, experiment with network traffic, and develop applications — all without connecting to an actual engine or vehicle system. More information...

ESP32 for CAN Bus Application Developments

The ESP32 has become one of the most versatile microcontrollers in modern embedded development. With its dual-core processor, integrated Wi-Fi and Bluetooth, and robust peripheral set, it is a natural fit for advanced networking and control applications. One of its rising uses is in Controller Area Network (CAN Bus) systems, where the ESP32 provides both [...]

Read More »


CAN Bus and SAE J1939: A Beginner’s Guide to Network Design

If you’ve ever worked with industrial machines or diesel engines, chances are you’ve heard of CAN bus and SAE J1939. These two go hand-in-hand when it comes to reliable, real-time communication between control units. Let’s break down the essentials of how these networks are designed and why they matter. What Is CAN Bus? CAN (Controller Area Network) [...]

Read More »


How to Wire NMEA 2000 with the PICAN-M Raspberry Pi HAT and Power It Using the Onboard SMPS

The PICAN-M is a marine-grade Raspberry Pi HAT that brings both NMEA 0183 and NMEA 2000 connectivity to your Pi, with the added convenience of an onboard 3 A SMPS (Switch-Mode Power Supply) for powering the Pi itself. This makes it ideal for embedded marine systems using platforms like OpenPlotter or Signal K. In this [...]

Read More »


Migrating Legacy CAN Systems to Modern Architectures: Practical Steps & Pitfalls

The Controller Area Network (CAN) protocol has been the backbone of reliable embedded communication for decades. From passenger cars to heavy-duty trucks, from industrial machinery to marine electronics, CAN has delivered deterministic, robust, and low-cost networking. But as data demands grow—driven by autonomous features, connected vehicles, and Industry 4.0—Classical CAN’s 1 Mbit/s bandwidth and 8-byte [...]

Read More »


ESP32S3 CAN & LIN-Bus Board: A Powerful Platform for Automotive Networking

In today’s vehicles, networking technologies such as CAN and LIN are essential for reliable communication between electronic control units (ECUs). From advanced driver-assistance systems to body electronics, these protocols form the backbone of modern automotive design. The ESP32S3 CAN & LIN-Bus Board was created with these exact needs in mind, offering engineers a versatile development [...]

Read More »


CANPico V2 in Action: Compact CAN-Enabled Projects for Robotics and Automation

The CANPico V2 is a small but powerful development platform that brings Controller Area Network (CAN) capability directly into your embedded projects. Built on the Raspberry Pi Pico microcontroller, this board combines affordability with professional-grade communication features—making it an ideal tool for robotics and automation enthusiasts. Its compact size and straightforward interface enable developers to [...]

Read More »


IoT Meets CAN: Building Cloud-Connected Fleet Monitoring with Raspberry Pi + PiCAN3

The Internet of Things (IoT) is reshaping how vehicles and industrial equipment are monitored and maintained. At the heart of this transformation lies the ability to connect embedded systems—such as those using the CAN Bus protocol—to the cloud. By linking CAN data to online dashboards and analytics tools, fleet operators gain real-time insights into vehicle [...]

Read More »


Power and Precision on the Water: The Teensy 4.0 with NMEA 2000 Connector and IPS Display

In the world of marine electronics and embedded development, compact size rarely comes with uncompromising power. That changes with the introduction of the Teensy 4.0 paired with an NMEA 2000 connector and a crisp 240×240 IPS LCD. This unique combination delivers a level of performance and integration that appeals equally to hobbyists, professional developers, and [...]

Read More »


Overstock Savings: PICAN-FD & PICAN-DUO-SMPS Price Drop

As of today's date, we’ve temporarily reduced pricing on our PICAN-FD and PICAN-DUO-SMPS boards to help balance inventory. This is a great opportunity to get professional-grade Raspberry Pi CAN-Bus solutions at a lower cost—while supplies last. Unlock powerful CAN‑Bus functionality for your Raspberry Pi projects with Copperhill’s PICAN‑FD and PICAN‑DUO‑SMPS boards! The PICAN‑FD (US$49.95 - was [...]

Read More »