diff --git a/dist/iotAmak-0.0.1-py3-none-any.whl b/dist/iotAmak-0.0.1-py3-none-any.whl index ecceb38dff0b499d796796332dc48fa9eded58fb..0f6f9fad1f9cbf4bfdacf46e08c21224869851eb 100644 Binary files a/dist/iotAmak-0.0.1-py3-none-any.whl and b/dist/iotAmak-0.0.1-py3-none-any.whl differ diff --git a/iotAmak/amas.py b/iotAmak/amas.py index 84248902706f76b68f7cb060fe6ab33893eee64f..573f36916cf7e6c5f760ce817f0c64b412857783 100644 --- a/iotAmak/amas.py +++ b/iotAmak/amas.py @@ -57,7 +57,7 @@ class Amas(Schedulable, SSHClient): if args is None: args = [] command = "nohup python " - command += "\"Desktop/mqtt_goyon/iotamak-core/" + experience_name + "/agent.py\" " + command += "\"Desktop/mqtt_goyon/example/" + experience_name + "/agent.py\" " command += str(self.next_id) + " \"" command += str(self.broker_ip) + "\" " for arg in args: diff --git a/iotAmak/ihm.py b/iotAmak/ihm.py index 5c3db3174281d70518278617e7102c2ddd9785f8..0af4707916d257e1b0cfe2968c7f440b9e2cd644 100644 --- a/iotAmak/ihm.py +++ b/iotAmak/ihm.py @@ -80,8 +80,6 @@ class Ihm(MqttClient, SSHClient): self.loading() self.ping() - if self.ping_is_true: - self.agent() while not exit_bool: @@ -144,6 +142,9 @@ class Ihm(MqttClient, SSHClient): self.update(self.experiment_name) + if cmd.lower() == "agent": + self.agent() + # Crée les processus amas/env/scheduler de l'experience chargé if cmd.lower() == "start": diff --git a/iotAmak/tool/ssh_client.py b/iotAmak/tool/ssh_client.py index 591b0605b9f0a125af03a8cf8d02a53e63f422d6..27262054c409f6b42d5a48350dcc8f3cec5384b3 100644 --- a/iotAmak/tool/ssh_client.py +++ b/iotAmak/tool/ssh_client.py @@ -50,7 +50,13 @@ class SSHClient: transport.connect(username=client.user, password=client.password) sftp = MySFTPClient.from_transport(transport) sftp.mkdir("Desktop/mqtt_goyon/example/" + experiment_name, ignore_existing=True) - sftp.put_dir("../"+experiment_name, "Desktop/mqtt_goyon/example/" + experiment_name) + + print(str(pathlib.Path().resolve()), "Desktop/mqtt_goyon/example/" + experiment_name) + + sftp.put_dir( + str(pathlib.Path().resolve()), + "Desktop/mqtt_goyon/example/" + experiment_name + ) sftp.close() class MySFTPClient(paramiko.SFTPClient): @@ -62,7 +68,7 @@ class MySFTPClient(paramiko.SFTPClient): for item in os.listdir(source): if os.path.isfile(os.path.join(source, item)): self.put(os.path.join(source, item), '%s/%s' % (target, item)) - print(os.path.join(source, item)) + print(os.path.join(target, item)) else: if any([i in item for i in [".git", "__pycache__", ".idea", ".vscode"]]): pass