chrisz / pyhusmow

Control your Husqvarna automower
GNU General Public License v3.0
59 stars 29 forks source link

start web server on reboot #26

Open icepicknz opened 6 years ago

icepicknz commented 6 years ago

Thanks so much for your wonderful API; i'm just building this into my smart things hub using the inbuilt web server and its all working great.

Do you mind advising (and adding to your documentation) the method to start at reboot, for instance I need to start the following but not sure how to do the virtualenv -p python3 husmow_venv and then to start; would it be a bash script or something? husmow --login X@y.com --password password123 server --address 192.168.1.9

maglub commented 6 years ago

This of course depends on what distro/OS you are running.

sudo apt-get install python3 virtualenv
virtualenv -p python3 husmow_venv
source husmow_venv/bin/activate
pip3 install pyhusmow
#!/bin/bash

. ~/husmow_venv/bin/activate

husmow --login X@y.com --password password123 server --address=0.0.0.0
@reboot ~/automower/bin/startHusmowServer >/dev/null 2>&1 &