???



ps -ef | grep python
kill nr

sudo apt update

sudo apt full-upgrade ???

-----------------------

instalowanie nowszej wersji python
cd ./tmp/

https://allurcode.com/install-latest-version-of-python-on-raspberry-pi/

wget https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz
Extract source files
tar -zxvf Python-3.10.2.tgz
Go into just created directory
cd Python-3.10.2
Run the configuration command
./configure --enable-optimizations
Install any missing dependencies
sudo apt update
sudo apt install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev
Compile Python
sudo make altinstall

cd /usr/bin
sudo rm python3
sudo ln -s /usr/local/bin/python3.10 python3
@@@@back to older
#sudo ln -s /usr/bin/python3.5 python3

------------------------------ //z oficjalnej strony - nie bardzo działa

musimy mieć:
node --version  # Should output v14.X, V16.x, V17.x or V18.X
npm --version  # Should output 6.X, 7.X or 8.X

instalowanie node
curl -sSL https://deb.nodesource.com/setup_16.x | sudo bash -
każe mi zrobić:
sudo apt-get install -y nodejs

sudo mkdir /opt/zigbee2mqtt
sudo chown -R ${USER}: /opt/zigbee2mqtt
git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
cd /opt/zigbee2mqtt
npm ci

------------------------------------------- //działa

instalacja zigbe2mqtt on raspberry
https://nerdiy.de/en/howto-zigbee-installation-von-zigbee2mqtt-auf-dem-raspberry-pi/

sudo apt-get update && sudo apt-get upgrade

sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs git make g++ gcc

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update sudo apt-get install yarn -y

sudo git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
sudo chown -R pi:pi /opt/zigbee2mqtt

sprawdzenie czy istnieje dongle
ls /dev/serial/by-id/

konfiguracja pliku
nano /opt/zigbee2mqtt/data/configuration.yaml
!!!! wazne wpisanie odpowiedniego portu

frontend:
  port: 8038
  host: 0.0.0.0

instalacja
cd /opt/zigbee2mqtt
npm ci

testowanie
cd /opt/zigbee2mqtt
npm start

konfigurowanie jako system service
sudo nano /etc/systemd/system/zigbee2mqtt.service

Wklejenie:
@@@
[Unit]
Description=zigbee2mqtt
After=network.target

[Service]
ExecStart=/usr/bin/npm start
WorkingDirectory=/opt/zigbee2mqtt
StandardOutput=inherit
# Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5)
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target
@@@

autostart:
sudo systemctl enable zigbee2mqtt.service

--------------------------------------

instalacje brokera mqtt
https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/

sudo apt update && sudo apt upgrade

instalacja:
sudo apt install -y mosquitto mosquitto-clients

konfiguracja:
sudo nano /etc/mosquitto/mosquitto.conf
dodanie na końcu:
listener 1883
allow_anonymous true

sudo systemctl enable mosquitto.service

restart:
sudo systemctl restart mosquitto
lub stop:
sudo systemctl stop zigbee2mqtt