Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pymodbus.console do not start with version 3.7.0 #17

Closed
serioca opened this issue Aug 8, 2024 · 10 comments
Closed

pymodbus.console do not start with version 3.7.0 #17

serioca opened this issue Aug 8, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@serioca
Copy link

serioca commented Aug 8, 2024

When I try to start pymodbus.console I get the following error message:

ImportError: cannot import name 'ModbusBinaryFramer' from 'pymodbus.transaction' (/Users/sergiobruni/.pyenv/versions/3.12-dev/envs/panarea2/lib/python3.12/site-packages/pymodbus/transaction.py). Did you mean: 'ModbusAsciiFramer'?

@araneusdiadema
Copy link

Hello, same issue here. I searched the source files a little and found out that "ModbusBinaryFramer" was removed from pymodbus transtaction.py. In previous version 3.6.9 it was present. This change (or error?) is not reflected in repl. I will stick to 3.6.9 for now.

@alexrudd2
Copy link
Collaborator

Thanks for the report, and sorry for the breakage. It's good to know REPL has users but it's less-maintained than we'd like.

Yeah, there are at least three breaking changes from 3.6.x to 3.7.0.
(1) the removed ModbusBinaryFramer
(2) several classes in the PDU moved. For instance, pymodbus.diag_message -> pymodbus.pdu.diag_message.
(3) the framers moved

I will try to update the code to work with 3.7.x. In the meantime, downgrading to 3.6.9 should work fine.

@dhoomakethu
Copy link
Contributor

dhoomakethu commented Aug 8, 2024

On latest dev

❯ pymodbus.console --help
Traceback (most recent call last):
  File "/.pyenv/versions/pymodbus3.12/bin/pymodbus.console", line 5, in <module>
    from pymodbus_repl.client.main import main
  File "/.pyenv/versions/3.12.0b3/envs/pymodbus3.12/lib/python3.12/site-packages/pymodbus_repl/client/main.py", line 22, in <module>
    from pymodbus_repl.client.mclient import ModbusSerialClient, ModbusTcpClient
  File "/.pyenv/versions/3.12.0b3/envs/pymodbus3.12/lib/python3.12/site-packages/pymodbus_repl/client/mclient.py", line 9, in <module>
    from pymodbus.diag_message import (
ModuleNotFoundError: No module named 'pymodbus.diag_message'

@alexrudd2
Copy link
Collaborator

alexrudd2 commented Aug 8, 2024

(2) several classes in the PDU moved. For instance, pymodbus.diag_message -> pymodbus.pdu.diag_message

@dhoomakethu
Copy link
Contributor

@serioca @araneusdiadema Could you please give a try this branch pymodbus-3.7-changes and see if that fixes the issue ? Thanks

@dhoomakethu dhoomakethu added the bug Something isn't working label Aug 10, 2024
@dhoomakethu dhoomakethu self-assigned this Aug 10, 2024
@araneusdiadema
Copy link

@serioca @araneusdiadema Could you please give a try this branch pymodbus-3.7-changes and see if that fixes the issue ? Thanks
Hi, I confirm that the changes solved the issue. REPL works for me now.

@dhoomakethu
Copy link
Contributor

Thanks for the confirmation @araneusdiadema

@alexrudd2
Copy link
Collaborator

@dhoomakethu Nice job with the changes. Don't forget to release on PyPI.

@serioca
Copy link
Author

serioca commented Aug 12, 2024

@dhoomakethu @araneusdiadema

thanks

@dhoomakethu
Copy link
Contributor

Fixed with v2.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants