I've been having some issues with the Bluetooth RFCOMM Server I've written for an open source project I've been working on in the particular case that it is used within a daemon.
We have a Python Bluetooth server that seems to work perfectly well, when I run the server directly from the CLI using the pi user, it works fine and am able to access from our app (Cordova/Java Bluetooth plugin). When run from the CLI, it transfers the data from the app, through the Bluetooth server and to the web hook.
However, we need this script to be daemonized as it'll be used mainly headless and having to SSH via an ethernet tether will become cumbersome.
When the server is run using the below daemon it "runs" the server fine with no "errors" but clearly something is off. The tablet thinks it's connected and has no errors; I have also tested the app when the daemon is not running, and it can clearly distinguish the two states even though the daemon has no output.The daemon has no logs of connection nor does it connect to the webhook whereas running from CLI does. I'm led to believe that's it's something different about running in the sandboxed root env provided by systemd as opposed to the local pi user, yet I can't seem to figure out what that may be. It's almost as if line 31 in the server script below hangs when run in the systemd environment, but not so when run via CLI.
Link to Server: https://github.com/FRCteam4909/The-Gree ... -worker.py
Link to Daemon: https://github.com/FRCteam4909/The-Gree ... er.service
Relevant Bluetooth/Daemon Install/Config: https://github.com/FRCteam4909/The-Gree ... ALL.sh#L75
Any help would be greatly appreciated!