Skip to main content

Open-source macOS/Linux driver for SM2 Pro J2534 CAN adapters

Project description

SM2CAN

Open-source macOS/Linux driver for SM2 Pro J2534 CAN adapters (Scanmatik).

The SM2 Pro is a professional automotive diagnostic adapter that officially supports only Windows. SM2CAN provides native macOS and Linux support via clean room reverse engineering of the USB wire protocol.

Install

pip install sm2can

macOS also needs libusb:

brew install libusb

Quick Start

python-can interface

import can

bus = can.Bus(interface='sm2', bitrate=500000)

# Receive
msg = bus.recv(timeout=1.0)
if msg:
    print(f"0x{msg.arbitration_id:03X}: {msg.data.hex()}")

# Send
bus.send(can.Message(arbitration_id=0x7DF,
                     data=[0x02, 0x01, 0x00, 0, 0, 0, 0, 0]))

bus.shutdown()

Direct API

from sm2can import SM2Device

dev = SM2Device()
dev.open(bitrate=500000)

dev.send(0x7DF, bytes([0x02, 0x01, 0x00, 0, 0, 0, 0, 0]))
frame = dev.recv(timeout=1.0)

dev.close()

CLI

sm2can probe              # Detect device, test echo, show firmware info
sm2can info               # Show device info
sm2can monitor            # Live CAN bus monitor
sm2can monitor -l         # Listen-only mode
sm2can send 7DF 0201000000000000   # Send a frame
sm2can echo               # Health check

Protocol

The wire protocol was reverse engineered from the official Scanmatik Android APK and confirmed via live hardware probing.

Frame format:

[CMD, LEN_LO, LEN_HI, CHECKSUM, ...PAYLOAD]

Checksum = (CMD + 0x55 + LEN_HI + LEN_LO) & 0xFF

USB identifiers: VID 0x20A2 PID 0x0001, bulk endpoints 0x02 (OUT) and 0x81 (IN).

See SM2_PRO_PROTOCOL_SPEC.md for the complete protocol specification.

Hardware Requirements

  • SM2 Pro adapter (Scanmatik)
  • USB cable
  • Vehicle connection for CAN bus operations (12V on OBD-II pin 16 powers the vehicle side, but the SM2 Pro itself boots on USB 5V)

Project Status

Component Status
USB transport (pyusb) ✅ Confirmed
Wire protocol (frame format, checksum) ✅ Confirmed
System commands (INIT, ECHO, DEVICE_INFO, CLEAR_FIFO) ✅ Confirmed
CAN channel commands (0x8A-0x8F) ⏳ Accept payloads, need vehicle bus to verify
python-can integration ✅ Complete
Bluetooth transport 🔧 Framework (needs pybluez)
CLI tools ✅ Complete

Legal

This project uses clean room reverse engineering to achieve interoperability with legitimately purchased hardware. No proprietary code, firmware, or documentation was used. See LEGAL.md for details.

License

MIT — Copyright (c) 2026 Aldo Guzman

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sm2can-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sm2can-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file sm2can-0.2.0.tar.gz.

File metadata

  • Download URL: sm2can-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for sm2can-0.2.0.tar.gz
Algorithm Hash digest
SHA256 85419a45e5ebd753c679d8f0138f14aa8233b712e6197826b2f62666d97030f2
MD5 7da91bfea2bdfc8896b9b20de154b248
BLAKE2b-256 8c38fe500bee7a9128a2065c6994398ea32d9d145c717f4625189f814cfd12fe

See more details on using hashes here.

File details

Details for the file sm2can-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sm2can-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for sm2can-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48a0493321acce1596d656a70934d88ab336e2f240437c6f9c97b0acc7c44a37
MD5 52b6838133ede480fd9ede27f31f1681
BLAKE2b-256 650c183ce798105f578af33745300a999f87bad5701bcc3390add1161e137dc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page