Wake and notifications
The hub can wake a sleeping spoke just before a routine is due and pass its phone notifications on, both off until you turn them on.
Wake a sleeping computer
Routines run only while their computer is awake. The hub can wake a computer just before one of its routines is due. A computer takes part only if its own person ticked Wake.
Turn on the wake service (the hub)
On the hub, open Settings → Remote access → Wake service and switch it on, or run octant hub wake on. octant hub wake off turns it off, and the hub forgets every time it held. Only the hub's own window changes this.
Take part (a spoke)
Tick Wake in the spoke's hub grant. The spoke then tells the hub, for each enabled routine, when it next runs, under a random id the spoke made up. That is all: never the routine's prompt, Project, profile, name or schedule. The spoke sends a new list when a time changes, and a routine you pause or delete drops out. Unticking Wake withdraws the list.
Add Wake-on-LAN (optional)
To have the hub also send a Wake-on-LAN magic packet on your home network, enter the computer's hardware (MAC) address under Settings → Remote access → Join a hub, on that computer. The address goes to the hub only while Wake is ticked, and only if you entered it. Without it, the hub sends only the message over your private network, which reaches a computer that is awake but idle. On a Mac, turn on Wake for network access in Energy settings for the packet to work.
What happens at a wake
- A couple of minutes before a routine is due, the hub wakes the computer: the magic packet if you entered an address, and a signed message to its listener.
- The message names only the random id and the time. The computer acts on it only if the id is one of its routines, the time is that routine's own next time, and its grant still ticks Wake. Otherwise it does nothing and says why.
- When it believes the message, the computer only makes sure its own scheduler is awake. The scheduler runs the routine at its time under that routine's own rules, and a missed time follows the routine's missed-run setting. The hub never tells a computer to run anything.
- If neither the packet nor the message gets through, the hub records the time as unreachable. The computer settles it when it is back, under its missed-run setting.
octant hub status and the hub's Wake service section show, for each computer, how many wakes are ahead and how the last one went.
A machine that is powered off, away from home, or not set to wake cannot be woken. A standby hub holds a copy of the wake times; while it stands in, it wakes the computers that ticked both Wake and Standby, takes their new routine times, and hands them back to the hub.
Send phone notifications through the hub
A computer sends phone notifications through the push gateway named in its own Settings → General → Phone notifications (see Remote Access). With the hub's push sender, a spoke can hand its notifications to the hub, which passes them on. A computer takes part only if its own person ticked Push.
Turn on the push sender (the hub)
On the hub, open Settings → Remote access → Push sender and switch it on, or run octant hub push on. octant hub push off turns it off. Only the hub's own window changes this. The hub forwards only to the gateway in its own Notifications setting, so turn phone notifications on there too, or the hub refuses every request.
Take part (a spoke)
Tick Push in the spoke's hub grant.
What happens to a notification
- The spoke seals each notification to your phone's key and signs the delivery request with its own key, exactly as it would to send it itself, then hands the request to the hub instead of calling the gateway.
- The hub checks that the sender is a spoke in its list, that its own switch is on, and that the request is small and not too frequent. It then asks the spoke whether its grant still ticks Push, and only then passes the request to the gateway, unchanged. It never signs for the spoke, never opens the content (it has no key to), and keeps nothing of the request afterwards.
- The gateway's answer goes back to the spoke, which treats it as if it had sent the request itself.
- If the hub cannot be reached, or refuses, the spoke sends to the gateway itself when its own Notifications setting allows. Otherwise the notification is reported as not sent.
- While a standby stands in, it forwards for the computers that ticked both Push and Standby, only while they cannot reach the hub, using the gateway in its own Notifications setting, and only if the hub's push sender was on.
octant hub status and the hub's Push sender section show, for each computer, how many notifications the hub forwarded and refused, and how the last one went. The hub's journal records which computer, how large, and why a request was refused, never what was in it.
By default the hub passes notifications to the push gateway only. It sends to Apple and Google itself only if you build the phone app yourself and turn on direct sending.
Send notifications directly from the hub
If you build the phone app yourself, with your own Apple Developer and Firebase accounts, your hub can be that phone's push gateway, so nothing goes through an Octant-run service. The store build of the phone app cannot use this: only the account that signs an app can send notifications to it.
- Build the app with your own bundle identifier and the Push Notifications capability, add your Firebase project's
google-services.jsonfor Android, and set the app's push gateway address to your hub's private address. The steps are in Building the phone app yourself. - On the hub, open Settings → Remote access → Send notifications directly. Enter your Apple key ID, team ID, bundle ID and the
.p8key, and paste your Firebase service-account JSON. Settings then says Stored. It never shows a key again. - Turn on Development build if you installed the app straight from Xcode. Leave it off for TestFlight and App Store builds.
- Switch on Send notifications directly. It is off by default.
Only the hub's own window changes any of this. Phones reach the hub over your private network only, and while the switch is off the hub answers that notifications are unavailable. The hub calls Apple and Google with your credentials, and nobody else. What it sends is the same sealed notification the gateway would get, which only your phone can read. A computer that ticked Push hands its notifications to the hub as before, and the hub delivers them itself.