vorbereitungen unter debian


 ./reboot-to-writable-mode.sh
apt install -y python3-pip python3-venv python3-dev libffi-dev rustc cargo librust-regex-dev

########################
MQTT-Broker Mosquitto

wget -O - http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key | apt-key add -

wget -O /etc/apt/sources.list.d/mosquitto-buster.list http://repo.mosquitto.org/debian/mosquitto-buster.list

sudo apt update 
sudo apt install -y mosquitto mosquitto-clients

sudo bash -c "cat > /etc/mosquitto/mosquitto.conf" <<'EOT'
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /mnt/usb1/mosquitto/
persistent_client_expiration 2m

log_dest syslog
#log_dest file /mnt/usb1/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d
EOT


cp -a /var/lib/mosquitto /mnt/usb1/

sudo systemctl enable mosquitto.service
sudo systemctl restart mosquitto.service

##############################
mDNS Discovery für MQTT

sudo apt install -y avahi-daemon
sudo bash -c "cat > /etc/avahi/services/mqtt.service" <<'EOT'
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">MQTT on %h</name>
  <service>
   <type>_mqtt._tcp</type>
   <port>1883</port>
  </service>
</service-group>
EOT

sudo systemctl enable avahi-daemon
sudo systemctl restart avahi-daemo

adduser --system --group --home /mnt/usb1/riego --shell /bin/bash riego
echo "source .venv/bin/activate" >/mnt/usb1/riego/.profile
chown -R riego.riego /mnt/usb1/riego
chmod 2775 /mnt/usb1/riego


cd /mnt/usb1/riego
rm -rf .venv
sudo -u riego python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip && pip install riego && chmod -R g+w .venv/
sh .venv/bin/setup_riego_service.sh


Login as riego:
su --login riego

VSC-Windows-Development:

python3 -m venv .venv
.venv\scripts\activate
pip install pylint
pip install pep8
pip install -r requirements_dev.txt

code .
Extension "Python von Microsoft" installieren
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned


VSC-Mac-Development:

python3 -m venv .venv
source .venv/scripts/activate
pip install pylint
pip install pep8
pip install -r requirements_dev.txt

code .
Extension "Python von Microsoft" installieren




