Skip to main content

A Python32 implementation of the RP1210C standard.

Project description

RP1210 for Python

pip install rp1210

A Python module for interacting with RP1210 adapter drivers, following the RP1210C standard. Contributions welcome!

Some documentation and examples are available in this repo's wiki and the Examples folder.

This module was written and tested with Python 3.9 and 3.10, 32-bit. Older (and newer) Python versions have not been tested and may not be supported.
32-bit Python is required because RP1210 drivers are all 32-bit, and can thus only be loaded with 32-bit Python. A 64-bit implementation via MSL-LoadLib is possible and may be released as a separate module sometime in the future.

This module is currently in alpha, and changes to core functionality may happen. Once it hits beta, I will start taking care not to break people's code. Until then, expect changes. You can keep track of planned changes in the Issues page.

Not all aspects of the RP1210C standard are fully implemented as independent features. Currently, my focus is on J1939 communication. Other protocols have significantly less support, but you can still access all the low-level commands via the RP1210API class.

While I try to provide adequate documentation, the RP1210C standard is owned by TMC, not me, and is not reproduced here. For a complete understanding of the RP1210 standard, you must purchase and read the official RP1210C documentation from TMC.

Official RP1210C documentation can be purchased from TMC at this link ($37.50 at time of writing): https://www.atabusinesssolutions.com/Shopping/Product/viewproduct/2675472/TMC-Individual-RP

Getting Started

from RP1210 import RP1210Client, translateErrorCode

# init client
client = RP1210Client()

# select vendor and device
client.setVendor("NULN2R32") # Nexiq USB-Link 2 in this case
client.setDevice(1) # wired USB-Link 2

# connect to adapter w/ specified protocol
clientID = client.connect(b'J1939:Baud=Auto') # will return clientID or error code
error_msg = translateErrorCode(clientID)
if error_msg != "NO_ERRORS": # failed to connect
   print("Connection failed:", error_msg)

# read all messages (no filter)
client.setAllFiltersToPass()

# send a message
msg = b'message contents'
err_code = client.tx(msg)
print("Tx Result:", translateErrorCode(err_code))

# read messages
while True:
   msg = client.rx()
   if msg: # message was received
      print(msg)

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

RP1210-0.0.26.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

RP1210-0.0.26-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file RP1210-0.0.26.tar.gz.

File metadata

  • Download URL: RP1210-0.0.26.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for RP1210-0.0.26.tar.gz
Algorithm Hash digest
SHA256 b4ae5a9cb99114e27ebede9a34c162d7ebea58832a9502c5345f725d17c63a7b
MD5 4987432ee3a08fd28d803609ccf26246
BLAKE2b-256 d0d17b896ddd54afde6bdd9757724ebe9c3cf03517f8eeb25154ca6af6815a4a

See more details on using hashes here.

File details

Details for the file RP1210-0.0.26-py3-none-any.whl.

File metadata

  • Download URL: RP1210-0.0.26-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for RP1210-0.0.26-py3-none-any.whl
Algorithm Hash digest
SHA256 1386b30ee61156ff4adc65a9b4e41c586b965a874e70dc7ccf3c4fbc70b1ef42
MD5 1a6dc8900961e46866dee11381171cd6
BLAKE2b-256 1ab2ceb1792c3082eff5b83b0bc1085408d63e9677ece23e22731182b9f9baf8

See more details on using hashes here.

Supported by

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