Questions tagged [minimalmodbus]

MinimalModbus is an easy-to-use Python module for talking to instruments (slaves) from a computer (master) using the Modbus protocol, and is intended to be running on the master. The only dependence is the pySerial module (also pure Python).

The minimalmodbus Python Modbus library is hosted on https://github.com/pyhys/minimalmodbus and has its documentation at https://minimalmodbus.readthedocs.io

80 questions
1
vote
1 answer

Although the Intesis Modbus adaptor in my heat pump does give me its baud rate, it tells me there is no contact

I run a Raspberry Pi 4 with a USB-RS485 adaptor connected to a Panasonic IntesisBox, using the Python minimalmodbus module. First, I check the connection by this function: import minimalmodbus def openandcheckModbuscom(): …
ChrPoll
  • 23
  • 6
1
vote
1 answer

how to store MinimalModbus debug response in a variable?

import serial import minimalmodbus import time instrument = minimalmodbus.Instrument('COM8', 127, debug=True) instrument.serial.port instrument.serial.baudrate = 19200 instrument.serial.parity = serial.PARITY_NONE instrument.serial.bytesize =…
1
vote
1 answer

create fully customised pymodbus requests

I'm new to pymodbus. I am trying to create a custom request to be sent to a TCP client, this specific request needs to have 3 exclamation marks at the beginning of the message. an example message request would be 21 21 21 01 7F 07 40 01 00 88 00…
1
vote
1 answer

minimalmodbus : Wrong Message being sent over Serial

So i want to send this code : 01 00 14 00 58 over ModBus RTU utilizing minimalmodbus to my VIRTUAL COM Port (COM2). So i do get the "code" but i also get other bytes before and after the code and i can seem to know where they come from and how i can…
kevin00756
  • 33
  • 6
1
vote
1 answer

no communication with the instrument (no answer) Minimalmodbus

I'm having problem with minimalmodbus library. The slave does not respond to the master's request, I want to request a read. I'm using the Raspberry Pi 3 Model B+, with Python 3.10.1, it's the minimalmodbus library with version 2.0. I'm using the…
lopes
  • 29
  • 3
1
vote
2 answers

How to write first two bytes using minimal Modbus write register?

I am trying to figure out how to write first two bytes using minimalModbus write register command. Register size - 240(unsigned 8 bit int array), I used write.registers command and passed the value as an array but write value is happening in 2 and…
1
vote
0 answers

minimalmodbus: No communication with the instrument (no answer) ModBus RTU

I try to establish connection between a Mass flow controller and pc using minimalmodbus python library. Based on device document I have to set the communication port as: Communication speed: 9600 Baud Start bit: 1 Data bits: 8 Stop bits:…
Soprano
  • 17
  • 3
1
vote
3 answers

Minimalmodbus RTU connection problem of Raspberry Pi with SHT20 sensor(XY MD02)

I've been trying to build a simple temperature measuring system using Minimalmodbus. The components are as follows; RPi(Raspberry pi zero) with python ver. 3.7.3 USB to RS-485 adapter Temperature & Humidity Sensor : XY-MD02(SHT20) Modbus RTU…
minilong
  • 11
  • 2
1
vote
1 answer

Read outh kWh meter (PM5100) with modbus RTU on RPI

My goal is to read out a PM5100 from Schneider with a Python script on a raspberry pi using modbus rtu. I've been able to do it for another meter (SDM220) with modbus that worked just fine but I just can't seem to do it right on this one. The PM5100…
1
vote
1 answer

MinimalModbus import error => AttributeError: module 'serial' has no attribute 'Serial'

I'm trying to use minimalmodbus library but i cannot import it because i get the error File "testmodbus.py", line 3, in import minimalmodbus File "/usr/local/lib/python3.7/dist-packages/minimalmodbus.py", line 61, in
MarioC
  • 2,934
  • 15
  • 59
  • 111
1
vote
1 answer

Power Meter - Modbus RS485 - After 5 to 6 hours, the device doesn't answer anymore

Using a Raspberry PI, I've written a loop in Python reading 6 registers of a Polier MTR5LMOD, every 15 sec, using the waveshare 2-ch rs485 hat. The program works during 5 to 6 hours (sometime less, sometime more)... and suddenly... the device…
Phildeal
  • 26
  • 3
1
vote
0 answers

Rotronic Temp/Humidity probe locks into a "no communication" state with minimalmodbus and python

EDIT: For whatever reason, this entire problem was solved (for now) with a finally statement that only contains time.sleep(1). It doesn't make any sense why that would work in my program, but it does. Thanks user Brits for the recommendation. I am…
natalieb
  • 11
  • 3
1
vote
1 answer

Noob trying to get values from his EnergyMeter via Modbus RTU RS485 in python

fist Post as i normaly find the answers if i search long enough. But today is the day... I bought a EnergyMeter from Aliexpress with MODBUS RTU connection and im trying to read it out. I already tried a lot of stuff from all over the Internet. This…
Marv21
  • 21
  • 3
1
vote
1 answer

Store modbus messages using minimalModbus

I need to write and read registers from a serial device. Everything works fine, but I need to store the messages in a variable. For example: instrument = minimalmodbus.Instrument("/dev/ttyUSB0", 1, minimalmodbus.MODE_ASCII,…
Deffo
  • 191
  • 1
  • 8
  • 21
1
vote
0 answers

Minimalmodbus I can read data, but i cannot write it (RTU)

I´m using minimalmodbus python library to communicate my Raspberry Pi with "Spacelogic Thermostat TC900" (RTU). I have no problem reading the data, but when I try to write on it, the console shows the next error: No communication with the instrument…
javiertxu18
  • 207
  • 1
  • 9