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.1.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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sm2can-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 89d9072b4dab595a3921d6e1f531c321a2aca47f89934a674e7fc0adf216c812
MD5 af27e93d35d93006aaffdc0e81954476
BLAKE2b-256 b77862d2a71bac3a3809a6a39982c729cdd0c02a7a10dd4083ae582360b748a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sm2can-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32e9ea7705b7ccde60e8feae4afea3b58e7a8a55dbe40dcc51732595d416df5c
MD5 93ca747bdae12c36e429bbf350a2f790
BLAKE2b-256 fc0834015acb8c1d2ed77defed29c1bd04009d914f91c1809fe8ef7c84e41d8b

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