Repository: pymodbus-dev/pymodbus

Issue:
Updating Server Example does not work
<!--
Please use the Pymodbus gitter channel at https://gitter.im/pymodbus_dev/Lobby or Stack Overflow(tag [pymodbus](https://stackoverflow.com/questions/tagged/pymodbus) for
support questions.

Before opening a new issue, make sure you do the following:
    * check that your issue isn't already filed: https://github.com/riptideio/pymodbus/issues
    * check the discussions forum https://github.com/riptideio/pymodbus/discussions
    * prepare a short, runnable example that reproduce the issue with the latest development version of Pymodbus
-->

### Versions

* Python: 3.7, 3.8, 3,10
* OS: ubuntu bionic
* Pymodbus: 2.5.3
* Modbus Hardware (if used): 

### Pymodbus Specific
* Server: tcp - sync/async


### Description

I try to run example, first error is
`TypeError: ModbusDeviceIdentification.__init__() got an unexpected keyword argument 'info_name'`

when i remove that info, it ends on

```
modbusupdater.py", line 81, in run_updating_server
    loop.start(time, now=False)  # initially delay by time
AttributeError: '_UnixSelectorEventLoop' object has no attribute 'start'
```

async/sync server have same error with info_name, but run when removed. But i am unable to run updating server example.

Thank you


Discussion:
There have been no changes to version 2.5.3 for about the last year, you noted in another PR that the removal of twisted was causing this....but twisted was removed after 3.0.0dev4 and a very long time after 2.5.3 was frozen.

Please try with the current version or even better with dev.

Resolving patch:
diff --git a/examples/common/updating_server.py b/examples/common/updating_server.py
--- a/examples/common/updating_server.py
+++ b/examples/common/updating_server.py
@@ -36,7 +36,7 @@ def updating_writer(extra):
     """Run every so often,
 
     and updates live values of the context. It should be noted
-    that there is a race condition for the update.
+    that there is a lrace condition for the update.
 
     :param arguments: The input arguments to the call
     """
@@ -52,7 +52,7 @@ def updating_writer(extra):
     context[slave_id].setValues(register, address, values)
 
 
-def run_updating_server():
+async def run_updating_server():
     """Run updating server."""
     # ----------------------------------------------------------------------- #
     # initialize your data store
@@ -83,11 +83,15 @@ def run_updating_server():
     # ----------------------------------------------------------------------- #
     # run the server you want
     # ----------------------------------------------------------------------- #
-    time = 5  # 5 seconds delay
-    loop = asyncio.get_event_loop()
-    loop.start(time, now=False)  # initially delay by time
-    StartTcpServer(context, identity=identity, address=("localhost", 5020))
+    log.debug("Start server")
+    await StartTcpServer(
+        context,
+        identity=identity,
+        address=("localhost", 5020),
+        defer_start=False
+    )
+    log.debug("Done")
 
 
 if __name__ == "__main__":
-    run_updating_server()
+    asyncio.run(run_updating_server())


Test patch: