Skip to content

Conversation

@FedericoMusa
Copy link
Contributor

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

@janiversen
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you need to add configuration to start it properly. It actually surprises me that it starts without configuration.

Copy link
Contributor Author

@FedericoMusa FedericoMusa Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!
image

image image

@FedericoMusa FedericoMusa force-pushed the docs/simulator-official-entrypoint branch from 5b7c5f2 to 29d11d7 Compare February 10, 2026 18:50
Copy link
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@janiversen janiversen merged commit 67b527a into pymodbus-dev:dev Feb 10, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants