cjkrolak / ThermostatSupervisor

supervisor to detect and correct thermostat deviations
MIT License
0 stars 0 forks source link

SHT31: update noip client on pi0 to start on reboot #599

Closed cjkrolak closed 11 months ago

cjkrolak commented 1 year ago

noip ddns not updating, client probably not starting on boot

cjkrolak commented 1 year ago

https://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/

cjkrolak commented 1 year ago

created /etc/init.d/rc2.d folder and added the following code as a script called "functions" within that folder.

    #######################################################
    #! /bin/sh
    # . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc
    case "$1" in
        start)
        echo "Starting noip2."
        /usr/local/bin/noip2
        ;;
        stop)
        echo -n "Shutting down noip2."
        killproc -TERM /usr/local/bin/noip2
        ;;
        *)
        echo "Usage: $0 {start|stop}"
        exit 1
    esac
    exit 0
    #######################################################

Need to reboot server to determine if script is running on startup

cjkrolak commented 1 year ago

auto re-start did not work

check status: sudo /usr/local/bin/noip2 -S start service manually: sudo /usr/local/bin/noip2

cjkrolak commented 1 year ago

pi-specific instructions for install here: https://www.noip.com/support/knowledgebase/install-ip-duc-onto-raspberry-pi/

cjkrolak commented 1 year ago

I tried moving script from /etc/init.d/rc2.d/functions to /etc/init.d/rc2.d, but still did not work on reboot.

cjkrolak commented 11 months ago

updated startup script to start noip service.

[Desktop Entry]
Encoding=UTF-8
Name=SHT31 server autostart
Comment=Start a terminal, start DNS service, pull latest dev branch, and launch sht31 server
Exec=/usr/bin/lxterm -hold -e 'cd /home/pi/github/ThermostatSupervisor && sudo /usr/local/bin/noip2 && sudo noip2 ­-S && git checkout develop && git pull && pip install -r requirements.txt -r requirements_sht31.txt && python -m thermostatsupervisor.sht31_flask_server'
Terminal=true
X-KeepTerminal=true