diff --git a/config.py b/config.py index 021481c4e0f399a04981203ac2e1497918b10c65..8ce65319ad240ef7dec4d367c7d73ae520d584d9 100644 --- a/config.py +++ b/config.py @@ -29,7 +29,7 @@ HARDWARE_CONFIG = { 'coef_p2': 2.50, # slope for current conversion for ADS.P2, measurement in V/V 'nb_samples': 20, # Max value 10 # was named integer before... }, - 'mux': {'model' : 'ohmpi_i2c_mux64_v1.01', + 'mux': {'model' : 'dummy_mux', # 'ohmpi_i2c_mux64_v1.01', 'max_elec': 64, 'board_addresses': {'A': 0x73, 'B': 0x72, 'M': 0x71, 'N': 0x70}, # CHECK IF YOUR BOARDS HAVE THESE ADDRESSES 'voltage_max': 100, diff --git a/utils.py b/utils.py index 86e740b9f74506893292a51ebc40b1ea925c7b52..7f367f03df24e39a6c51e560fd014ed54895339c 100644 --- a/utils.py +++ b/utils.py @@ -20,10 +20,15 @@ def get_platform(): pass return platform, on_pi -def change_config(config_file): +def change_config(config_file, verbose=True): cwd = os.getcwd() try: shutil.copyfile(f'{cwd}/OhmPi/config.py', f'{cwd}/OhmPi/config_tmp.py') shutil.copyfile(f'{cwd}/OhmPi/{config_file}', f'{cwd}/OhmPi/config.py') + if verbose: + print(f'Changed to {cwd}/OhmPi/{config_file}:\n') + with open(f'{cwd}/OhmPi/config.py', mode='r') as f: + print(f.read()) + except Exception as error: print(f'Could not change config file to {cwd}/OhmPi/{config_file}:\n{error}') \ No newline at end of file