Autostart Devices

From ago control wiki
Revision as of 22:02, 4 December 2014 by Bjacobse (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Autostart Devices

Here is an example on creating a service to automatically start your custom device driver:

IMPORTANT Your custom file's first line MUST be:


As root, copy your custom file to /opt/agocontrol/bin . Change the file permissions so that the file has read and execute permissions :

chmod a+rx /opt/agocontrol/bin/

Make sure root owns the file:

chown root /opt/agocontrol/bin/
chgrp root /opt/agocontrol/bin/

Create a new file in /lib/systemd/system/ called agohumidity.service :

Description=ago control Weather Device



Note: If you are using RPI and use GPIO, you must change "User=agocontrol" to "User=root" in above, else you don't have privileges to control the GPIO pins

Change the filename, description and ExecStart to match the needs of your device driver.

Next, enable the service:

systemctl enable agohumidity.service

Then, start the service:

systemctl start agohumidity.service

Finally, ensure that the service is running:

root@debian# systemctl status agohumidity.service
agohumidity.service - ago control Weather Device
          Loaded: loaded (/lib/systemd/system/agohumidity.service; enabled)
          Active: active (running) since Wed, 31 Dec 1969 18:00:26 -0600; 43 years and 9 months ago
        Main PID: 361 (python)
          CGroup: name=systemd:/system/agohumidity.service
                  â 361 python /opt/agocontrol/bin/

You can temporarily stop the service by using:

systemctl stop agohumidity.service

To permanently disable the service use:

systemctl disable agohumidity.service
Personal tools