Coder Social home page Coder Social logo

smart.plant.2021.mycodo's Introduction

smart.plant.2021.Mycodo

Порядок настройки системы

Скачать 2021-05-07-raspios-buster-armhf-lite.zip

Прошить SD карту с помощью etcher

Включить ssh и добавить нужный wifi в wpa_supplicant.conf

Подключиться к одной с raspberry pi сети, подождать загрузки системы raspberry pi, подключиться к ней по ssh с именем пользователя pi и паролем raspberry по 22 порту. Посмотреть ip адрес можно через arp-scan:

sudo apt-get update; sudo apt-get install arp-scan; sudo arp-scan -l | sort

Выполнить "Expand Filesystem" через raspi-config, выйти с сохранением и перезагрузкой из raspi-config

Заново подключиться, включить i2c, переименовать hostname на "smartplant", сменить пароль на "raspberrySMARTplant.2021" (или иной) в raspi-config и также выйти с перезагрузкой.

Теперь ssh можно выполнять иначе:

ssh [email protected]

В заключение желательно обновить пакеты системы до актуальных версий

sudo apt -y update
sudo apt -y upgrade
sudo apt -y dist-upgrade
sudo apt -y autoremove
sudo reboot

Установка и настройка Mycodo

cd /etc/systemd/system/
sudo rm -rf Mycodo/

INSTALL_DIRECTORY=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )

if [ "$EUID" -eq 0 ]; then
    printf "Do not run as root. Run as non-root user: \"/bin/bash %s/install\"\n" "${INSTALL_DIRECTORY}"
    exit 1
fi

if [ -d ~/Mycodo ]; then
  printf "## Error: Install aborted. Cause: The ~/Mycodo directory already exists. The install cannot continue because a previous Mycodo install was detected. Please either move or delete the ~/Mycodo directory and rerun this script to initiate the install or run ~/Mycodo/install/setup.sh.\n"
  exit 1
fi

sudo apt-get install -y jq whiptail python3

curl -s https://api.github.com/repos/kizniche/Mycodo/releases/latest | \
jq -r '.tarball_url' | sudo wget -i - -O mycodo-latest.tar.gz
sudo rm -rf Mycodo
sudo mkdir Mycodo
sudo chown pi:pi Mycodo
tar xzf mycodo-latest.tar.gz -C Mycodo --strip-components=1
sudo chown pi:pi Mycodo
sudo rm -f mycodo-latest.tar.gz
cd Mycodo/install
sudo /bin/bash ./setup.sh

cat /etc/systemd/system/Mycodo/install/setup.log

Открывать web интерфейс можно так:

http://smartplant.local

Подключение фронта

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 12.21.0
npm install -g @angular/cli@13
npm install http-server
# npm install --save-dev @angular-devkit/build-angular
ng --version

Запускать скомпилированный проект Angular:

cd ~
sudo rm -rf smartplant-dist
git clone https://github.com/malvill/smartplant-dist.git
cd smartplant-dist
npx http-server smartplant-final -a smartplant.local --port 8080

Доступен по ссылке:

http://smartplant.local:8080

smart.plant.2021.mycodo's People

Contributors

d3dx13 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.