diff --git a/config.py b/config.py index dfff4b100d0d3bd1d1d1bed608c14280d64ca8de..cb664fe1dbb2cb68f784bd2f5d5837e0e943cf0a 100644 --- a/config.py +++ b/config.py @@ -16,7 +16,7 @@ OHMPI_CONFIG = { 'integer': 2, # Max value 10 # TODO: Explain what this is... 'version': 2, 'max_elec': 64, - 'board_addresses': {'A': 0x70, 'B': 0x71, 'M': 0x72, 'N': 0x73}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} + 'board_addresses': {'A': 0x73, 'B': 0x72, 'M': 0x71, 'N': 0x70}, # def. {'A': 0x76, 'B': 0x71, 'M': 0x74, 'N': 0x70} 'settings': 'ohmpi_settings.json' } # TODO: add a dictionary with INA models and associated gain values diff --git a/http_interface.py b/http_interface.py index ab13c81d457f1c69da06d1cb01b51a1bcf676365..010c75df4088167403d38178196900364b1721d1 100644 --- a/http_interface.py +++ b/http_interface.py @@ -120,10 +120,11 @@ class MyServer(SimpleHTTPRequestHandler): os.mkdir('data') elif dic['cmd'] == 'update_settings': # ohmpi.stop() - if 'sequence' in dic['config'].keys and dic['config']['sequence'] is not None: + if 'sequence' in dic['config'].keys() and dic['config']['sequence'] is not None: sequence = dic['config']['sequence'] dic['config'].pop('sequence', None) payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'set_sequence', 'args': sequence}) + publish.single(payload=payload, **publisher_config) payload = json.dumps({'cmd_id': cmd_id, 'cmd': 'update_settings', 'args': dic['config']}) cdic = dic['config'] publish.single(payload=payload, **publisher_config)