fermentrack icon indicating copy to clipboard operation
fermentrack copied to clipboard

Tilt disconnects

Open cdnninja opened this issue 2 years ago • 5 comments

Every since the most recent large update my tilt disconnects regularly. A restart of my pi resolves this. No docker container in use yet. image

cdnninja avatar Jun 20 '22 14:06 cdnninja

I rebuilt this system using a brand new Raspbian instance and fresh docker install. The issue persists.

cdnninja avatar Oct 18 '22 00:10 cdnninja

To summarize what I found. On a fresh raspian install with a auto install docker and fermentrack I loose my tilt my tilt every few days.

I found something interesting while looking at becon filtering.

On the host pi if I run: Bluetoothctl Scan on Scan off

The docker container stops receiving data. If I don't run scan off and quote bluetoothctl same thing occurs.

Only way to fix is restart the docker container. My guess is a process is shutting off the scan at the host layer. I found a way to enable bluetooth in the kernel and plan to try that later.

cdnninja avatar Oct 18 '22 16:10 cdnninja

Another note start scan makes it work again, haven't confirmed that with the natural bug yet just when I was playing.

cdnninja avatar Oct 18 '22 16:10 cdnninja

Further updates. The above didn't seem to be related and when the issue occur doesn't solve it. I found this in the logs:

image

cdnninja avatar Oct 19 '22 03:10 cdnninja

Sorry for the long run of items. Hoping @thorrak can jump in here.

I have confirmed I am having issues with the PID files existing when it tries to scan. Three issues I have noticed:

  1. The exception being thrown by pid library is not the one being caught in the code. https://github.com/thorrak/fermentrack/blob/d347b623b367b304c9c880b35d05ed5af1bad363/gravity/tilt/tilt_monitor_utils.py#L87-L92
  2. Not sure why the pid isn't being released.
  3. I am seeing this same behavior when I restart docker on the primary controller. The script keeps not connecting. Multiple docker restarts and this solves itself. Or I delete the file and I am up and running. I don't know the code well enough to see why this is the case.

cdnninja avatar Oct 19 '22 03:10 cdnninja

This has been rock solid after manually deleting the pid files. Odd.

cdnninja avatar Oct 26 '22 16:10 cdnninja

I don’t my way around the Pi/files/folders well enough to test this out, but I’m having a similar issue with the Tilt disconnecting. Once I reboot the Pi (fresh docker install as of today), everything works as it should again.

Additionally, I’m seeing an issue with the Pi/Fermentrack becoming unresponsive to the point it won’t load the web interface shortly after the Tilt disconnects.

cipriani14 avatar Jan 16 '23 22:01 cipriani14

Apologies for missing this issue for so long. I’m drilling into this currently and am looking at breaking the tilt support out in order to hopefully make it more robust. This won’t be released with #724 , but should be the next release thereafter.

thorrak avatar Jun 18 '23 18:06 thorrak

Sounds good! Happy to test this out. I will switch back to the dev branch as well for next brew.

cdnninja avatar Jun 18 '23 19:06 cdnninja

No rush on switching - the main change will be to break the Tilt interface into its own docker image and then make the interface with Fermentrack take place via a REST(ish) interface. This will require more then the standard “click upgrade”, so I want to try to bundle it with #722

thorrak avatar Jun 18 '23 19:06 thorrak

I spoke too soon - This is probably going to end up bundled with #724 after all.

As I mentioned, I'm rebuilding the daemon to be completely standalone, and live inside its own docker container. For now, I'm naming it "TiltBridge Junior" and tracking it here. I'll drop a note here once it's ready for testing/use.

thorrak avatar Jun 19 '23 21:06 thorrak

Alrighty! It should now be released.

To upgrade, log into your Raspberry Pi via SSH, and run the following commands:

  • cd fermentrack-tools
  • git fetch
  • git pull
  • ./install.sh

thorrak avatar Jun 23 '23 23:06 thorrak