Hi! I'm pretty new to python, however I cloned your repo so to create a custom adapter for a custom device. I am running adapter.py with python 3.9.5. In my environment, the send_to_client method would throw an "TypeError: a bytes-like object is required, not 'str'".
I edited mtconnect_adapter.py to change all the
print ""
in
print()
and to change
send(<string>)
into
send(bytes(<string>, "utf-8"))
With these changes, the adapter.py is not throwing any exceptions. I am using the latest x64 release of cppagent for Windows 10 as the agent.
Hi! I'm pretty new to python, however I cloned your repo so to create a custom adapter for a custom device. I am running adapter.py with python 3.9.5. In my environment, the
send_to_clientmethod would throw an "TypeError: a bytes-like object is required, not 'str'".I edited mtconnect_adapter.py to change all the
print ""in
print()and to change
send(<string>)into
send(bytes(<string>, "utf-8"))With these changes, the adapter.py is not throwing any exceptions. I am using the latest x64 release of cppagent for Windows 10 as the agent.