# balenaFin stuck

**URL:** <https://forums.balena.io/t/balenafin-stuck/56947>\
**Category:** balenaFin\
**Created:** [January 15, 2020, 4:58pm UTC](https://forums.balena.io/t/balenafin-stuck/56947 "2020-01-15T16:58:17Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![rodley](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rodley/32/2344_2.png) [@rodley](https://forums.balena.io/u/rodley)\
**Post date:** [January 18, 2020, 6:31pm UTC](https://forums.balena.io/t/balenafin-stuck/56947/40 "2020-01-18T18:31:26Z")

</div>

Potentially useful data points from the fin:

1. running “apt-get install mmc-utils” in the python-buster container hung trying to connect to [prod.debian.map.fastly.net](http://prod.debian.map.fastly.net) and never completed until I killed the process named “/usr/local/lib/python3.5/site-packages/adafruit\_blinka/microcontroller”. Once I killed that process, everything started working.
2. mmc extcsd read reported back 0x01 - less than 10% max wear. Not a memory corruption issue.

Action plan from here while I wait for sandisk sd cards - get rid of the adafruit blinka code (not a big deal) and see if it doesn’t magically fix all my problems. Suspecting it will.

---

<div class="post-metadata">

**Author:** ![rodley](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rodley/32/2344_2.png) [@rodley](https://forums.balena.io/u/rodley)\
**Post date:** [January 18, 2020, 6:39pm UTC](https://forums.balena.io/t/balenafin-stuck/56947/41 "2020-01-18T18:39:44Z")

</div>

Process that was actually running was:

/usr/local/lib/python3.5/site-packages/adafruit\_blinka/microcontroller/bcm283x/pulseio/libgpiod\_pulsein --pulses 2 --queue 20391 gpiochip0 20

---

<div class="post-metadata">

**Author:** ![rodley](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rodley/32/2344_2.png) [@rodley](https://forums.balena.io/u/rodley)\
**Post date:** [January 18, 2020, 8:26pm UTC](https://forums.balena.io/t/balenafin-stuck/56947/42 "2020-01-18T20:26:10Z")

</div>

Strong evidence that Linux package libgpiod2 running in a python-buster container is the problem.

Removed it (was only using it for HCSR04 ultrasonic distance detector) and the fin is behaving much better - updates immediately, logs come through balenacloud timely, ssh’ing into containers and host OS succeeds on first try and stays connected.

---

<div class="post-metadata">

**Author:** ![rodley](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rodley/32/2344_2.png) [@rodley](https://forums.balena.io/u/rodley)\
**Post date:** [January 19, 2020, 12:10am UTC](https://forums.balena.io/t/balenafin-stuck/56947/43 "2020-01-19T00:10:09Z")

</div>

libgpiod2, a debian package required by the Adafruit blinka python package, in particular the command “libgpiod\_pulsein --pulses 2 --queue 20391 gpiochip0 20” seems to interfere seriously with the operation of the supervisor.

The symptoms are:

- spotty access to logs
- very flaky update behavior
- very flaky terminal access
- logging within the supervisor that mimics corrupt SD card behavior

The confusing part is that the GPIO functionality of the library appears to work when run from the command line in a terminal. This is not a balenafin specific behavior - occurs on 3B, 3B+ and 4B.

---

<div class="post-metadata">

**Author:** ![rahul-thakoor](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahul-thakoor](https://forums.balena.io/u/rahul-thakoor)\
**Post date:** [January 20, 2020, 1:15pm UTC](https://forums.balena.io/t/balenafin-stuck/56947/45 "2020-01-20T13:15:01Z")

</div>

hey @rodley,

thanks for your thorough investigation on this. We will look into this and update you once we have some feedback.  
cheers,  
Rahul

---

<div class="post-metadata">

**Author:** ![\_Page](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/_page/32/22_2.png) [@\_Page](https://forums.balena.io/u/_Page)\
**Post date:** [January 20, 2020, 7:31pm UTC](https://forums.balena.io/t/balenafin-stuck/56947/47 "2020-01-20T19:31:40Z")

</div>

Hey, based on [https://github.com/adafruit/libgpiod\_pulsein/blob/master/src/libgpiod\_pulsein.c](https://github.com/adafruit/libgpiod_pulsein/blob/master/src/libgpiod_pulsein.c) it looks like it sets itself to the max priority possible and runs in a tight loop, which I expect is starving the system resources and that’s what’s causing the issues you’re seeing, can you check it’s behaviour whilst running to confirm if it’s maxing out resources?

---

<div class="post-metadata">

**Author:** ![rodley](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rodley/32/2344_2.png) [@rodley](https://forums.balena.io/u/rodley)\
**Post date:** [January 20, 2020, 7:52pm UTC](https://forums.balena.io/t/balenafin-stuck/56947/48 "2020-01-20T19:52:13Z")

</div>

That’s what I figured. The use case is arguably real time. I’ll check it out and report back here.

Jr

[Previous page](https://forums.balena.io/t/balenafin-stuck/56947.md?page=1)
