eterey / pymodbus3

A full Modbus protocol written in Python 3.
http://uzumaxy.github.io/pymodbus3/
BSD 3-Clause "New" or "Revised" License
39 stars 11 forks source link

issue is in tcp server... #6

Closed neama closed 4 years ago

neama commented 7 years ago

File "D:\Programs\Python\Python36-32\lib\site-packages\pymodbus3-1.0.0-py3.6.egg\pymodbus3\device.py", line 236, in update self.__data.update(value) TypeError: iter() returned non-iterator of type 'dict_items'

may be issue is in a different python versions.

yentingli commented 6 years ago

I have a (maybe) similar issue which comes from "ModbusSparseDataBlock". I modified exsample code: synchronous-server.py d = {0x0001: 123} store = ModbusSlaveContext(ir = ModbusSparseDataBlock(d) )

Following error code appeared when I'm using a dictionary of values as parameters:

sudo python3.4 synchronous-server.py Traceback (most recent call last): File "synchronous-server.py", line 94, in <module> ir = ModbusSparseDataBlock(d) File "/usr/local/lib/python3.4/dist-packages/pymodbus3/datastore/store.py", line 210, in __init__ self.default_value = self.values.values().__next__().__class__() AttributeError: 'dict_values' object has no attribute '__next__'

jacobq commented 6 years ago

I have run into this exact same problem when trying to use ModbusDeviceIdentification (using Python 3.5). I highly suspect it is a 2.x vs. 3.x problem.

OldNewbold commented 5 years ago

Looks to be solved, just check the pull requests for this library, someone has made the updates to devices.py and payload.py to fix compatibility with python 3.x

eterey commented 4 years ago

Issue should be solved in latest pull-requests. Feel free to re-open in case if issue appear again. Thanks!