i am completely new to nameko
when i run this below code i am getting a error -
Not Importing deprecated clients. Dependency Twisted is not Installed
Error: Failed to find anything that looks like a service in module ‘rrr’
how to solve this please kindly help me
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as ModbusClient
from pymodbus.client.asynchronous import schedulers
from nameko.rpc import rpc
UNIT = 0x1
class readregister:
rr = "readregister"
async def start_async_test(client):
rr = await client.read_coils(4146, 1, unit=255)
print(rr)
print(rr.function_code)
def run_with_no_loop():
"""
ModbusClient Factory creates a loop.
:return:
"""
loop, client = ModbusClient(schedulers.ASYNC_IO,host='10.0.0.85', port=502)
loop.run_until_complete(start_async_test(client.protocol))
loop.close()
if __name__ == '__main__':
run_with_no_loop()
@rpc
def run_sync_client():
return start_async_test(client)