Talk Preparation: systemd’s D-Bus Implementation, And Its Python asyncio Binding#

Old Stuff, Random Notes#

D-Bus Show#

  • Monitoring/Debugging

    $ dbus-monitor --session
    

D-Bus Spec, Implementations#

Client Implementation#

  • Bus name (service name): me.faschingbauer.IrrigationService

  • Object path: /me/faschingbauer/IrrigationSystem

  • Interface name: me.faschingbauer.IrrigationSystem, as parameter of DBusIrrigationSystem (see jfasch/jf-irrigation)

  • Irrigation system

    • Simple: blocking operations

      • Structure/objects ⟶ sketch

    • Challenge: expose objects via D-Bus. Continue irrigation in the “background” while serving D-Bus operations. No-go: create a thread.

  • Read doc: https://python-sdbus.readthedocs.io/en/latest/examples.html

Gotchas, Weirdnesses#

  • D-Bus methods (and properties) are always BiCapitalized; if you name a method some_method, SDBus will translate it to SomeMethod

  • DBus socket is watched somehow magically. in main(), I’d expect I have to create a task for DBus traffic - but no. Must be done magically inside some of the routines that we use to export object and register names.

  • complain about confusion: busname, path, and iface name

What Else?#

Irrigation Outlook#

  • Hardware, finally

  • User interface with textual

  • Add logging, error reporting, watchdog