I have a Python module (PyBind11 C++ Lib) that resides on an ECU. To use this library I need a SSH connection to the ECU to start a Python instance via the terminal.
~$ ssh root@IP
~$ python3
python 3.8.2 (default, Feb 25 2020, 10:39:28)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import myModule
>>> myModule.do_something()
...
This works perfectly in the manual application
Now if I want to run the whole thing completely via Python on the host: (Pseudo Code)
>>> from myLibs import ssh_session
>>> with ssh_session(IP, user, pw) as clt:
clt.exec_command("python3")
clt.exec_command("import myModule")
clt.exec_command("myModule.do_something()")
...
Here the commands should be Python commands instead of simple terminal commands.
Anyone have any ideas on how to implement this?
Thanks and greetings