Alternate Systemd Files for BLE: Activation Timer and Parallel Uxplay Beacon Service #517
Open
p0mm wants to merge 1 commit into
Open
Alternate Systemd Files for BLE: Activation Timer and Parallel Uxplay Beacon Service #517p0mm wants to merge 1 commit into
p0mm wants to merge 1 commit into
Conversation
Collaborator
|
Thanks! will look it over... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternate systemd files for BLE only mode
I wanted to run uxplay automatically, without relying on mDNS at all - i am very happy about the BLE feature!
This PR shows an alternate set of systemd files that allows uxplay to startup automatically, without relying on avahi to be present, via a timer.
In addition the uxplay-beacon script is configured to always run in parallel to uxplay.
Changes made
The uxplay.service file by @Deuchnord was used as a starting point.
To run uxplay independent of the avahi-daemon i decided to use a timer instead.
This is the new uxplay.timer file.
It simply activates the uxplay.service after some time.
I currently have this set to 30 seconds, which is a lot and can definitely be optimized - however uxplay cannot run immediately as this will mess with startup & the time may vary for different setups, so i felt it better to be safe.
In the new uxplay.service file dependencies to avahi and the install section have been removed.
A dependency to the new uxplay-beacon.service has been added.
The uxplay-beacon.service automatically starts the uxplay BLE script, which manages the BLE advertising that replaces the mDNS discovery.
The uxplay.service and uxplay-beacon.service have been configured so that the uxplay-beacon.service essentially follows all start, stops and restarts from the uxplay.service.
While this may be a little overcautious it allows smooth operation even if uxplay crashes in unexpected ways, as the BLE script is restarted alongside uxplay.
Usage
As with the previous systemd file, all files are placed in the
systemd/userdirectory.They should then be enabled.
Uxplay should also be configured to use the BLE advertising - this can be done via uxplay's config file.
At this point uxplay starts automatically after startups (plus some delay from the timer).
The setup can also be triggered manually, with the same command as the previous non-BLE service setup (with no delay).