sudo apt-get install python3-serial python3-usb python3-opencv python3-aiohttp python3-pampy wget unzip

WD=$HOME/3dprinteros-client

mkdir -p $WD || true
wget -c https://builds.3dprinteros.com/builds/master/rpi/install/3dprinteros-client.zip
unzip -o 3dprinteros-client.zip -d $WD
rm 3dprinteros-client.zip
wget -c https://builds.3dprinteros.com/3dprinteros.service -O $WD/3dprinteros.service
sed -i "s/printeros/${USER}/" $WD/3dprinteros.service || true

sudo systemctl link $WD/3dprinteros.service
sudo systemctl enable 3dprinteros
sudo systemctl start 3dprinteros

echo "Install complete"

echo -e "\nUse console login script to login your 3DPrinterOS Client, like this:\ncd 3dprinteros-client\npython console_login.py"
