Site Information

 Loading... Please wait...

Blog

Under Development: Programmable CAN Bus to USB, Bluetooth, BLE, WiFi Gateway

Posted by Wilfried Voss on

For the longest time, I had resisted the idea of creating my version of a CAN-to-USB gateway, primarily due to the vast competition. A professional CAN/J1939 development requires a professional CAN-to-PC solution to monitor data traffic. I am pleased with the PEAK PCAN-USB device, as shown in the above image. However, not everybody is willing (or able) to spend in the neighborhood of $500...$800 for such a commodity. On the other hand, there are lower-priced alternatives, but they usually shine through poorly written firmware and bizarre PC user interfaces. Furthermore, regardless of the price range, most gateways either do not provide a programming interface or are excessively complex.

USB to SAE J1939 Gateway

Consequently, we at Copperhill Technologies will enter the market with a reasonably priced and easy-to-program series of CAN Bus gateways. And since we are using the ESP32 processor for our development, we will offer not only a USB connection but also Bluetooth, BLE, and Wifi. The initial version will support Classical CAN, but we are currently modifying existing hardware to support CAN FD.

The current hardware is the same as for our  SAE J1939-to-USB Gateway (see image to the right). In addition, we are utilizing existing software libraries which helps to shorten the development process.

We use an ASCII-based serial protocol for communication between the gateway and the PC. It loosely resembles the commands and functionality of the LAWICEL CAN232/CANUSB specifications to establish a basic communication format. It uses only a sub-set of the LAWICEL commands but adds new features where necessary (e.g., to support CAN FD features).

Furthermore, the protocol differs from the LAWICEL functionality regarding the command responses. While LAWICEL responds to commands with either CR (ASCII 13 = success) or BELL (ASCII 7 = error), our version responds with the command token (first character of the command line = Success) or 'x' for error, terminated by a CR.

Available ASCII Commands

  • All messages between the gateway and the PC end with [CR] (ASCII 13) and are case-sensitive.
  • All ASCII commands start with a token byte identifying the function.
  • Commands are accepted by repeating the token, while erroneous commands are answered with ‘x’.

Here is a set of available ASCII Commands:

The image below demonstrates a sample to transmit an 11-bit CAN data frame:

The next image (below) shows a test session, where I set the CAN baudrate (S command), opened the CAN port (O command), and sent CAN data frame with an 11-bit message identifier (t command). 

Following these commands are several CAN data frames as received from the PEAK PCAN-USB gateway. These are samples of 11-bit and 29-bit messages.

As part of the delivery, we will provide C source code samples for programming under Linux and C# for Windows demonstrating the process. Finally, a Windows monitor, analyzer, and recording software is in the works, but it will take a few more months before it is ready for release. 

Last, but not least, please feel free to contact us for further information. 


SAE J1939 to USB Gateway in Plastic EnclosureSAE J1939 ECU Simulator and Gateway With USB Port

Our SAE J1939 gateway allows you to monitor, simulate, and record any PGN as defined in the SAE J1939-71 Standard but also including diagnostic messages according to SAE J1939-73. The gateway supports the full SAE J1939 protocol according to J1939/81 Network Management (Address Claiming) and J1939/21 Transport Protocol (TP). It is also supported by an extensive programming interface for Windows and Linux/Ubuntu applications, including full C/C++/C# source code for short time-to-market developments.

More Information...

Selection Criteria and Requirements for a Telematics Gateway

The  March 2023 issue of the CAN Newsletter, a CiA (CAN-in-Automation) online publication, posted an article on the selection criteria and requirements for a Telematics gateway. With cars evolving towards network technologies, OEMs (Original Equipment Manufacturers) require telematics solutions that boost seamless communication within and outside the vehicle. The device should be cloud-enabled, connectable to servers for real-time [...]

Read More »


SAE J1939 Protocol Stack Sketch for ESP32 Using the Arduino IDE

The ESP32 is a series of low-cost, low-power system-on-chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations and includes built-in antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. Furthermore, the processor provides the means to easily [...]

Read More »


ESP32 Project: USB to Bluetooth Gateway

The ESP32 processor allows the integration of Wi-Fi, Bluetooth, and Bluetooth LE (BLE) for a wide range of IoT (Internet of Things) applications. Using Wi-Fi ensures connectivity within a large radius. At the same time, Bluetooth allows the user to easily detect (with low-energy beacons) a module and connect it to an Android/iOS smartphone or [...]

Read More »


Controller Area Network (CAN), SAE J1939, NMEA 2000 Wireless Module for IoT and ELD Applications

Due to the global shortage of electronic components, we at Copperhill Technologies began rethinking our strategy regarding new developments. Luckily, that change turned out to be a blessing in disguise because the transition from NXP LPC to the ESP32 processor opened the door to more industrial and automotive applications, especially those involving wireless transmissions for [...]

Read More »


Raspberry Pi Compute Module With CAN FD for Automation and IoT Applications

Kontron announced the release of their Pi-Tron CM4 computer with Linux OS, which utilizes the fourth-generation Raspberry Pi compute module with the 1,5-GHz, 64-bit Broadcom BCM2711 chip and four Arm Cortex-A72 processors. The computer’s steel housing allows for universal use, e.g., for automation and IoT (Internet of Things) applications. Depending on the variant, it provides a 1-GiB, 2-GB, [...]

Read More »


ESP32 Starter and Development Kits for Building Bluetooth and WiFi Enabled IoT Devices

The integration of Wi-Fi, Bluetooth, and Bluetooth LE allow a wide range of applications with ESP32 modules. Using Wi-Fi ensures connectivity within a large radius, while using Bluetooth allows the user to easily detect (with low-energy beacons) a module and connect it to a smartphone. The chips add priceless functionality and versatility to your applications [...]

Read More »


Arduino Portenta H7 - Dual-Core STM32 Processor Board with Two CAN FD Ports and Support for Arduino IoT Cloud

The Portenta H7's central processor is represented by the dual-core STM32H747, including a Cortex M7 at 480 MHz and a Cortex M4 at 240 MHz. The two cores intercommunicate through a Remote Procedure Call mechanism that seamlessly enables calling functions on the other processor. Both processors share on-chip peripherals and can run Arduino Sketches on the Arm [...]

Read More »


CAN Bus Development with ESP32-WROOM32 Development Board

This post will demonstrate how to add a CAN Bus port to the ESP32-WROOM32 development board, i.e., regarding hardware and software. Download this post as PDF... As a matter of fact, we already offer a hardware utilizing the ESP32 processor and an onboard CAN Bus transceiver as shown in the image to the left. The ESP32 WiFi, Bluetooth [...]

Read More »


Wireless IoT Project Development with the ESP32

The ESP32 represents a low-cost, low-power System-on-Chip (SoC) microcontroller with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series utilizes either a Tensilica Xtensa LX6 microprocessor in dual-core and single-core variations, Xtensa LX7 dual-core microprocessor, or a single-core RISC-V microprocessor and includes built-in antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management [...]

Read More »