Do I need to start a new experiment to change air bubbler OD dodging parameter?

Hey,

I am running a very long experiment and wanted to test different conditions to see their effect on OD measurements. I changed “enable_dodging_od=1” in [air_bubbler.config] to “enable_dodging_od=0”, saved the new config, and restarted all running background jobs. It seems to keep dodging though. Is this expected behavior?

Hi @rafik.n,

Hm, no, that change should have been sufficient. Can you check what the following returns when run on the leader:

pio mqtt -t "pioreactor/+/+/air_bubbler/enable_dodging_od"

Is the value returned “true” or “false” (or ,1 or 0 respectively)?


If it’s true/1, double check your config.ini and the unit specific config.ini (the former overwrites the latter)

Hi @CamDavidsonPilon,

The output says true:

2024-05-09T12:47:06 | pioreactor/pio/remote working on hardware/air_bubbler/enable_dodging_od True

I even tried changing it from enable_dodging_od=0 to enable_dodging_od=False but no luck. I think the init is being called in the base.py based on the timestamp above. Maybe it is falling for the fallback of true for some reason.

edit: on second thought I think the timestamp is just from when the mqtt is called. Not when value was last set.

I am only using shared config.ini, other one is empty.

Hm, some other ideas:

  1. First check that the config.ini on disk has your changes, i.e:
cat ~/.pioreactor/config.ini

should have enable_dodging_od=0.

  1. Check that there is only one [air_bubbler.config] section. This should only return a single row:
grep "air_bubbler.config" ~/.pioreactor/config.ini
  1. Try totally deleting the section in the config.ini and rerunning the job. The job should fail. If not, something else weird is going on…

All 3 tests work as intended. Notably for test 3 pio run air_bubbler only needs [air_bubbler.config], duty_cycle, and hertz to be defined for it to run. pre-delay, post-delay, enable-dodging can all be commented out and still runs. This is because click_air_bubbler() only checks for those values in air_bubbler.py. Other values are only grabbed via base.py during init.

I also noticed a strange file: /usr/local/lib/python3.11/dist-packages/pioreactor_air_bubbler/additional_config.ini that had different [air_bubbler.config] values than my config file including enable_dodging_od = 1. Dont think its the cause just a strange file

Hi guys,

I am very interested to see your solution to this issue. I encountered the same problem, even though i changed all the dodging to 0:

[air_bubbler.config]
duty_cycle=50
hertz=200
pre_delay_duration=0
post_delay_duration=0
enable_dodging_od=0

For me dodging starts as soon as i turn on the OD measurement and the Air bubbler, but then when i stop the OD measurement and start it again the problem is solved. In the beginning i had to do this a couple of times until it really stopped dodging. Now i only have to do it just once.

Maybe this helps you locate the issue in the code? Otherwise I hope it helps as a temporary solution.

I’ll spend some time today to reproduce + resolve this - I’ll report back shortly

Okay so yes, I was able to reproduce it quickly. The problem is that I retrieve the value from the config, which is either "0" or "1", and then cast this to a boolean. But, in python:

bool("0")

is True (since it’s a non-empty string), and not False! Usually we avoid this problem by using some internal methods, like config.getboolean which casts “0”, “False”, “false”, etc. to False. We didn’t do that here due to a coding shortcut.

Anyways, it’s fixed for the next release. For now, here’s what you can do.

On the Pioreactors you want this fix for,

  1. SSH in and add a file to plugins, ex:

    nano ~/.pioreactor/plugins/temporary_dodge_fix.py
    
  2. Copy and paste the following code: bg_dodge_fix.py · GitHub, and exit.

  3. Confirm you have the following in your config:

    [air_bubbler.config]
    ...
    enable_dodging_od = 0
    
  4. Try running it again.


Thanks @rafik.n and @Eleni_M for bringing this up!

1 Like

Wow thats a sneaky one. Thanks Cameron. Ill try out the temp fix

It worked