Skip to main content

A modbus analyser written in pure Python

Project description

ModTerm

Home

Introduction

ModTerm is a terminal based modbus analyser software, written in pure Python, utilising the curses UI extensions. The aim of the software is to help reverse engineering modbus data of unknown, or poorly documented modbus devices and allow registers to be written into the devices for testing and analysis purposes.

Features

Reading registers

ModBus registers can be read from devices connected to the computer via TCP or RTU. The registers read from the device are listed in a table, with the rows being the register numbers, and the columns being results of various register decoding methods, such as INT16, INT32, Float32, string, bits, etc. The endianness can be changed on the fly to make sense of the register contents. Supports reading registers in blocks, if the number of registers to be read is above 125, the reads are broken down to blocks of 120 register reads. Also supports reading each registers individually for the case when devices return exceptions to unsupported registers.

Read registers Read registers result

Writing registers

Registers with a provided encoding method can be written into one or more registers

Write registers

Scanning devices on a bus

TThis feature allows to sweep through modbus unit IDs on a connected bus and run a register read operation, in the hope of receiving a response and thus detecting a device.

Unit sweep Unit sweep results

Requirements

The project runs best on Python 3.11 and above, but should run on any versions of Python above 3.9 The project depends on the pymodbus library and should install that from pypi during installation.

⚠️ The project has been tested on macOS and Linux, but not on Windows. According to the documentation of the curses module in Python, it is not included in the Windows version. The documentation mentions the UniCurses module to be used under Windows, but this has not been tested yet. This section will be updated once testing has been done. For Windows users wanting to take advantage of this software, I recommend using WSL.

Installation and usage

  • Install a version of Python 3 using your operating system's package manager, or start up a virtual environment with Python version being ideally 3.11 or above
  • Issue pip3 install modterm
  • Launch the app by issuing modterm in the terminal.

The menu items and configuration options are accessible via the F-keys indicated next to each option. On the main screen, pressing F1 brings up the help screen to show which features are accessible via which keys.

Ways to contribute

For now, please report any issues with decoding, inconsistencies, bugs and crashes.

Feel free to suggest improvements and changes that would help

Development path

The below describes the features planned to be added for each point release in the future. All the below are subject to change

V1.0

  • Testing on multiple platforms and making the initial set of features robust and bug-free enough for a proper point release.
  • Add logging and proper error handling
  • Multicast writes

V1.1

  • Add coil and discrete input reads/writes (where applicable)
  • Sweep IP addresses for ModbusTCP responses

V1.2

  • Write float registers
  • Test windows compatibility

V1.3

  • Read modbus device information registers

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

modterm-0.2-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file modterm-0.2-py3-none-any.whl.

File metadata

  • Download URL: modterm-0.2-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.16

File hashes

Hashes for modterm-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c1609c4f906f2a12ad36cb791008d4d7bbd6bc9295d95f07c232f2901b6db28
MD5 4bde06237e02f8ddb7ace81ef5e2f34f
BLAKE2b-256 6c9fc93e613a0c63f2990c916f65115b01eb719df522ba625601766f3af016bf

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