Skip to main content

hackPyrateBus

hackPyrateBus is a Python library that provides high-level functions to interact with specific integrated circuits using the Bus Pirate. This library takes into account the particularities of the integrated circuits it interacts with.

This project is built on top of pyBusPirateLite, and we would like to give credit to the original authors and contributors of pyBusPirateLite and pyBusPirate.

NOTE: the pyBusPirateLite dependency is vendored from https://github.com/julianvilas/pyBusPirateLite/tree/new for convenience, as the original project does not seem to be maintained and it is not available in PyPI neither. The new branch in that fork contains commits not available in the original upstream, while master matches exactly the upstream (as of today).

Installation

From the root of the cloned repo you can install hackPyrateBus running:

# from the root of the cloned repo
virtualenv venv
source venv/bin/activate

pip install .

Directly From GitHub Releases:

# from anywhere
virtualenv venv
source venv/bin/activate

# latest release
url=$(curl --silent "https://api.github.com/repos/julianvilas/hackPyrateBus/releases/latest" | jq -r .assets[0].browser_download_url)
pip install --upgrade $url

Usage

AT24C128/256

Datasheet

Device particularities:

  • 16,384/32,768 bytes capacity (AT24C128/AT24C256 respectively) organized as 256/512 64-bytes pages
  • Device address range [0x50:0x54] (default 0x50), plus a LSB R/W bit (0 write, 1 read)
  • Page write mode rolls over when more than 64 bytes are written
  • Sequential read with data address auto-increment
  • Reading from a concrete data address requires a previous dummy-write

Initialize with default values

from hackPyrateBus.AT24CXXX import AT24CXXX
at24c = AT24CXXX()
at24c.speed = '50kHz'
at24c.configure(power=True, pullup=True) # do not enable pullup when using external pullup resistors

Default values:

  • Auto-detect and auto-connect to Bus Pirate port
  • 115200 bps serial communication speed with Bus Pirate
  • 1s timeout to ensure full EEPROM can be read/written in a single call
  • 256 model
  • 0x50 device address

Read the first 15 bytes from the EEPROM

at24c.load(0x0000, 15)

Store data from the 100 position of the EEPROM

at24c.store(100, b'\x00Hello, world!\xff')

Reset Bus Pirate

at24c.hw_reset()

Dependencies

This project uses the following open source packages:

License

hackPyrateBus is licensed under the GNU General Public License v3 (GPLv3). The full text of the license can be found in the LICENSE file.

The pyBusPirateLite project, from which this project is derived, is also licensed under the GPLv3. We would like to thank the authors and contributors of pyBusPirateLite for their work.

Metadata

Release files for hackPyrateBus 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hackPyrateBus 0.0.6
File Size Uploaded
hackpyratebus-0.0.6.tar.gz 32.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hackPyrateBus 0.0.6
File Interpreter ABI Platform
hackPyrateBus-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 76.1 kB

Release files / hackpyratebus-0.0.6.tar.gz

Download URL hackpyratebus-0.0.6.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
432234b3202e14b1f96665adc7502b7bf63940d0cb5f8e185906a2f6337678a1
BLAKE2b-256 checksum
How to use checksums
42bc175ab5045c59079384f5500975b5a642a8ccba375046de1c31b5cf3cf8fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.2

Release files / hackPyrateBus-0.0.6-py3-none-any.whl

Download URL hackPyrateBus-0.0.6-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd7a97139684c086297044af4bf165d1b496f6a3acc34601ff01952e9b6029ff
BLAKE2b-256 checksum
How to use checksums
0e707dd44e7d434180c8483c124f78f561c52ce81646764db37f47b910cde4ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page