# Pio freezing if air\_bubbler and growth\_rate\_calculating are run

**URL:** <https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576>\
**Category:** Plugins\
**Created:** [December 1, 2024, 11:28pm UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576 "2024-12-01T23:28:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafik.n](https://forum.pioreactor.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rafik.n](https://forum.pioreactor.com/u/rafik.n)\
**Post date:** [December 1, 2024, 11:28pm UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576/1 "2024-12-01T23:28:17Z")

</div>

Hey @CamDavidsonPilon,  
I am having this strange issue where the pio crashes when I run the **air\_bubbler** and **growth\_rate\_calculating** jobs at the same time ONLY when **enable\_dodging\_od** is on under [air\_bubbler.config]. I have tested extensively and this specific condition is the only time it occurs.

This does not occur when I am dodging LEDs during od\_reading and growth\_rate\_calculating so it should be specific to the air\_bubbler plugin. When the pio crashes I am not getting any error messages when running manually via ssh so I have nothing to go off of here.

Do you have any idea where the air\_bubbler OD dodging and growth\_rate\_calculating coincide in the code? If you point me in the right direction, I can investigate it further.

Hey @Eleni_M,  
From previous posts, I know you also use the air\_bubbler plugin. Have you experienced this same issue described above?

---

<div class="post-metadata">

**Author:** ![rafik.n](https://forum.pioreactor.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rafik.n](https://forum.pioreactor.com/u/rafik.n)\
**Post date:** [December 2, 2024, 1:18am UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576/2 "2024-12-02T01:18:50Z")

</div>

After further investigation, I have found a workaround that may be pointing to the culprit.

If I leave the growth\_rate\_calculating job to finish calculating the OD statistics, and then turn on air\_bubbler then it doesn’t crash. I am running long-term experiments meaning my OD sampling rate is low. So it takes a while for it to finish gathering data points to calculate the OD\_statistics. Could the issue be related to MQTT?

---

<div class="post-metadata">

**Author:** ![CamDavidsonPilon](https://forum.pioreactor.com/user_avatar/forum.pioreactor.com/camdavidsonpilon/32/3_2.png) [@CamDavidsonPilon](https://forum.pioreactor.com/u/CamDavidsonPilon)\
**Post date:** [December 2, 2024, 2:34am UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576/3 "2024-12-02T02:34:17Z")

</div>

> [@rafik.n](#):
>
> pio crashes

Like the RPi freezes up or shuts down? Or that some parts of the software become unresponsive?

The two jobs don’t really intersect. Both listen to od\_readings (via MQTT), but that’s a one way information transfer.

Now, the initial period in growth rate job _will turn on `stirring`_ (if not currently turned on). This could cause problems if the air-bubbler and _stirring_ are somehow connected (ex: via PWMs or hardware or power).

Otherwise, I’m not sure what might be going on. I’ll try to repro locally too.

---

<div class="post-metadata">

**Author:** ![rafik.n](https://forum.pioreactor.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rafik.n](https://forum.pioreactor.com/u/rafik.n)\
**Post date:** [December 2, 2024, 4:16am UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576/4 "2024-12-02T04:16:41Z")

</div>

> [@CamDavidsonPilon](#):
>
> Like the RPi freezes up or shuts down? Or that some parts of the software become unresponsive?

I’m not sure. SSH freezes up and can’t reconnect until I power cycle. Also, the UI becomes unresponsive and does not show any data. The Pi does not turn off fully and starts actuating the external LED and air bubbler sporadically.

 ![Screenshot 2024-12-01 at 11.02.53 PM](https://forum.pioreactor.com/uploads/default/original/1X/d46a24e369b64967910c704515adef05bdd1a666.png)

> [@CamDavidsonPilon](#):
>
> growth rate job _will turn on `stirring`_ (if not currently turned on).

I have this disabled on my system as I do not use stirring. I did this by removing the relevant stirring code from od\_blank.py

I don’t have any issues with the air\_bubbler otherwise (using the air\_bubbler default plugin). The air bubbler is connected via PWM with the following settings:

> [air\_bubbler.config]  
> duty\_cycle = 100  
> hertz = 200  
> pre\_delay\_duration = 2  
> post\_delay\_duration = 1  
> enable\_dodging\_od = 1

---

<div class="post-metadata">

**Author:** ![rafik.n](https://forum.pioreactor.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@rafik.n](https://forum.pioreactor.com/u/rafik.n)\
**Post date:** [December 4, 2024, 7:53pm UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576/5 "2024-12-04T19:53:13Z")

</div>

Ended up finding my issue. I was running out of memory. This was not happening prior but I have since started using the recommended VPN (tailscale) for remote access. And I am using the Pi Zero 2W which doest have too much memory. Tailscale was using 13%. Pio run and mqtt streaming were also using a similar amount each. But issue arrises during memory spikes occuring in scenario mentioned above as well as when I use the stop all feature.

Solution was to allocate some swap memory for the memory spikes that occur at different scenarious. You may want to include this in the docs for others using pi 02w

---

<div class="post-metadata">

**Author:** ![CamDavidsonPilon](https://forum.pioreactor.com/user_avatar/forum.pioreactor.com/camdavidsonpilon/32/3_2.png) [@CamDavidsonPilon](https://forum.pioreactor.com/u/CamDavidsonPilon)\
**Post date:** [December 4, 2024, 8:18pm UTC](https://forum.pioreactor.com/t/pio-freezing-if-air-bubbler-and-growth-rate-calculating-are-run/576/6 "2024-12-04T20:18:58Z")

</div>

Interesting! I haven’t seen this happen before, but I’ll add monitoring for memory spikes and investigate memory footprints of the mentioned jobs / actions.
