diff --git a/config.py b/config.py index 25f6efb46a42842ce6a5d8d7d877e762be2bbf31..e8e74a6d170091a404a4273c3a2331661f1b3809 100644 --- a/config.py +++ b/config.py @@ -20,7 +20,7 @@ OHMPI_CONFIG = { CONTROL_CONFIG = { 'tcp_port': 5555, - 'interface': 'mqtt_interface.py' + 'interface': 'http_interface.py' # 'mqtt_interface' } # Execution logging configuration EXEC_LOGGING_CONFIG = { diff --git a/webserver.py b/http_interface.py similarity index 100% rename from webserver.py rename to http_interface.py diff --git a/mqtt_interface.py b/mqtt_interface.py index 24124527c88d7b564fbb4cd78f578c3e9817739d..ed5837aed44fd5f7323fe53c2d7ee74e23147529 100644 --- a/mqtt_interface.py +++ b/mqtt_interface.py @@ -14,11 +14,6 @@ def on_message(client, userdata, message): socket.send(message.payload) # Get the reply - # event = socket.poll(timeout=1000) - # if event == 0: - # print('timeout') - # reply = 'no reply...' - # else: reply = socket.recv() print(f'Received reply {message.payload.decode("utf-8")}: {reply}') diff --git a/ohmpi.py b/ohmpi.py index 2d0ac6a7e61955cd18e1612f3d973dbc2d3e3de0..c066a368d3db88fff869218c3377ffcecde4ba61 100644 --- a/ohmpi.py +++ b/ohmpi.py @@ -656,9 +656,6 @@ class OhmPi(object): self.exec_logger.debug(f'Start listening for commands on port {tcp_port}') while self.cmd_listen: try: - #id_sock = socket.recv() - #assert not socket.recv() # empty data here - #assert socket.recv() == id_sock message = socket.recv(flags=zmq.NOBLOCK) self.exec_logger.debug(f'Received command: {message}') e = None @@ -673,6 +670,7 @@ class OhmPi(object): if cmd is not None and cmd_id is not None: if cmd == 'update_settings' and args is not None: self._update_acquisition_settings(args) + status = True elif cmd == 'start': self.measure(cmd_id) while not self.status == 'idle': diff --git a/ohmpi_settings.json b/ohmpi_settings.json index 273f22904d72553ed4c5140379992cd9672d0462..fe28a272124e643c4f6f8f8f61a864b5bfb99836 100644 --- a/ohmpi_settings.json +++ b/ohmpi_settings.json @@ -1,6 +1,6 @@ { "nb_electrodes": 64, - "injection_duration":0.2, + "injection_duration": 0.2, "nbr_meas": 1, "sequence_delay": 1, "nb_stack": 1,