Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pymodbus/server/simulator/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def __init__(
if custom_actions_module:
actions_module = importlib.import_module(custom_actions_module)
custom_actions_dict = actions_module.custom_actions_dict
else:
custom_actions_dict = None
server = setup["server_list"][modbus_server]
server["loop"] = asyncio.get_running_loop()
if server["comm"] != "serial":
Expand Down Expand Up @@ -502,8 +504,8 @@ async def build_json_server(self, params, json_dict):

def helper_build_filter(self, params):
"""Build list of registers matching filter."""
range_start = params.get("range_start", -1)
range_stop = params.get("range_stop", range_start)
range_start = int(params.get("range_start", -1))
range_stop = int(params.get("range_stop", range_start))
reg_action = int(params["action"])
reg_writeable = "writeable" in params
reg_type = int(params["type"])
Expand Down
2 changes: 2 additions & 0 deletions pymodbus/server/simulator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def get_commandline():
async def run_main():
"""Run server async."""
cmd_args = get_commandline()
cmd_args["http_port"] = 8081
cmd_args["json_file"] = "./pymodbus/server/simulator/setup.json"
task = ModbusSimulatorServer(**cmd_args)
await task.run_forever()

Expand Down