OpenSprinkler Forums OpenSprinkler Unified Firmware Opensprinkler Pi and systemd (Raspbian Jessie)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42687

    robgreen
    Participant

    Hello
    I ask for a little help , I’m using debian jessie of sd ,
    I installed following
    https://opensprinkler.freshdesk.com/support/solutions/articles/5000631599-installing-and-updating-the-unified-firmware"
    " Cd ~
    git clone https://github.com/OpenSprinkler/OpenSprinklerGen2.git
    cd OpenSprinklerGen2
    sudo ./build.sh Ospi "

    However
    Jessie has switched to systemd and the software shall be undertaken through service is no longer used rc.local

    I ask you to please show me how to set systemd
    to follow a draft
    thank you

    1 )
    sudo nano /etc/systemd/system/xxxx.service

    [ Unit ]
    Description = xxx

    [ Service ]
    Type = oneshot
    ExecStart = xxxx

    [ Install]
    WantedBy = multi-user.target

    2)
    insserv
    systemctl enable xxx.service

    3)
    systemctl start xxx.servic

    #42690

    Peter
    Participant

    OK, so this is what I did.

    1) Build OSPi Firmware as per normal but select “No” when prompted to auto-start OpenSprinkler.

    $ sudo ./build.sh OSPI

    2) Create a Systemd configuration file to control the start-up of OSPi

    $ sudo nano /etc/systemd/system/ospi.service

    3) Add the following lines to the ospi.service file and then save the file

    [Unit]
    Description=OpenSprinkler Server
    # After=weather.service apache2.service
    
    [Service]
    # ExecStart=/usr/bin/stdbuf -oL /home/peter/OpenSprinklerGen2/OpenSprinkler
    ExecStart=/home/peter/OpenSprinklerGen2/OpenSprinkler
    WorkingDirectory=/home/peter/OpenSprinklerGen2
    Restart=always
    RestartSec=10
    
    [Install]
    WantedBy=multi-user.target

    Note that in my setup, I need OSPi to wait until I have started the web server and weather service as I host these on my local RPi. Also, I use “stdbuf” to set the output from OSPi to be line buffered (i.e. -oL) so that diagnostic output is written immediately to the journal log file. Both of these may be unnecessary for you so have commented out. You will need to adjust the directories to your OSPi directory location.

    4) Initialise the service and set to auto-start

    $ sudo systemctl enable ospi.service
    $ sudo systemctl start ospi.service

    5) You can check that the service is running successfully with the systemctl command

    $ systemctl status ospi.service

    That should be it.
    Pete

    #42711

    robgreen
    Participant

    Hi
    excellent guide
    I completed the installation
    we can say that everything is working

    thank you very much !

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware Opensprinkler Pi and systemd (Raspbian Jessie)