Start and stop server from v2.5.3 to v3.0.0 #2541
Replies: 4 comments 2 replies
-
First of all 3.0.0 is very old and should not be used. Current version is 3.8.4 Secondly have a look at our examples, you can ether use startserver or continue use modbusserver which e.g. have a serve_forever public method. However please be aware that the 3.x server code is async. |
Beta Was this translation helpful? Give feedback.
-
Please also be aware this is the pymodbus project, NOT python3-modbus ! We have all source available on github, including unit test etc, I have no idea about the project you want to use. |
Beta Was this translation helpful? Give feedback.
-
It is of course up to you, which package you want to use, but it must be considered quite unusual that the maintainers of Debian include a release candidate instead of the proper release. You might not be able to use pip in the standard environment, but you can create a virtual environment and in that install the packages you want (you can even install different python versions). I do that on my raspberry PIs, exactly to get around the Debian limitations. Running the server in background is not a feature of pymodbus, but at a standard python functionality. We show how to use pymodbus not python :-) If you want to you can simply run start server in background, with the method of your preference, pymodbus do not care. And just for reference a lot of our unit test run the server in background (of course using asyncio). Please be aware that especially the release candidate had some severe bugs, which we will not be able to help you with. |
Beta Was this translation helpful? Give feedback.
-
Neither Jan nor anyone else on this project have involvement with Debian's packaging of I note that |
Beta Was this translation helpful? Give feedback.
-
Hello everyone !
I have an application using v2.5.3 which spawns multiple
SlaveModbus
.These slaves contains either a
ModbusTcpServer
or aModbusSerialServer
which can bestarted
orstopped
via public methods. When started, the server are ran in the background via a thread.The implementation is really simple and look like this.
I have to update to version v3.0.0 because I need to use the package
python3-modbus
from debian 12.I've spent multiple days trying to adapt this code using the new async pattern you adopted from this version, without any success.
I've looked for your examples, your unit tests, the documentation of asyncio, but I don't manage to make it work.
Should I use some tasks, keep using a thread, use await directly? I'm a bit lost to be honest 😕...
Note that I want the modification to be minimal and not use
async
functions since my whole code is complety synchronous.I hope you'll be able to help me !
Thank in advance
Beta Was this translation helpful? Give feedback.
All reactions