Closed neama closed 4 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__'
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.
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
Issue should be solved in latest pull-requests. Feel free to re-open in case if issue appear again. Thanks!
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.