Docs/simulator official entrypoint#2873
Conversation
|
Just checked it does start (somebody added a default configuration). I believe the best way to document it are to show the allowed parameters in README.rst, otherwise it is easy to see the next issue "why does it not work when my client request data". |
README.rst
Outdated
|
|
||
| pymodbus.simulator | ||
|
|
||
| Once started, the Modbus server will listen on port 5020 and the Web UI will be available at http://localhost:8081. This command provides a persistent instance for manual testing. |
There was a problem hiding this comment.
But you need to add configuration to start it properly. It actually surprises me that it starts without configuration.
There was a problem hiding this comment.
I've updated the README with the parameter table and a note about the default behavior.
Regarding the 'silent start' surprise: I investigated the source and found that in pymodbus/server/simulator/main.py (line 86), the --json_file parameter defaults to an internal setup.json within the package directory. This explains why it starts even without a local config.
Beyond documentation, should we 'armour' this entry point? I could add a logic check in that same main.py to log a heavy warning or even exit if a user-defined configuration isn't explicitly found.
Let me know what you think of the new docs and this potential code fix!

5b7c5f2 to
29d11d7
Compare
This PR addresses the documentation gap discussed in issue #2872. It clarifies the use of the official entry point for a persistent simulator experience.