NB fo RPI Zero stick to Bullseye, Zero 2 can even use 64bit Bookworm
See the above heading link to Tom's Hardware for Raspberry Pi Imager instructions and this video showing how to SSH from the PC to RPI terminal windows
After downloading rpi OS onto micro sd card, insert into rpi and boot up.
Allow a while to connected to the lan.
On a PC open the command prompt and ping the rpi hostname to confirm connected to lan.
Connect PC to terminal window to rpi terminal window.
Enter ssh pi@rpiCam and then enter password for pi device as requested.
As an alternative to using lan to SSH is to plug the rpi directly into a PC's USB via the rpi 's "data" (OTG) USB connector and connect to the USB Ethernet/RNDIS Gadget (may need to update PCs drivers). More information at https://notenoughtech.com/featured/raspberry-pi-zero-ssh-usb/ and at https://www.youtube.com/watch?v=XaTmG708Mss&t=6s
But before doing so need to reinsert SD card into SD card reader and alter files, possible to have more than one dtoverlay so just add to end of Config.txt file.
RasberryPi Software Code (Delete Quote Marks)
-------------------------------------------
Config.txt: "dtoverlay=dwc2"
Cmdline.txt: "modules-load=dwc2,g_ether" add inline immediately after rootwait
To connect via the USB Ethernet/RNDIS Gadget
Enter ssh pi@rpiCam.local and then enter password for pi device as requested.
This is a very common scenario, and simple to fix just enter the command e.g.
# ssh-keygen -R <host>
ssh-keygen -R 192.168.1.8
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null pi@<hostname_or_IP>
sudo systemctl restart vncserver-x11-serviced
From ssh command line access on PC
Enter the command sudo raspi-config.
Use the arrow keys to select Interfacing Options and press Enter.
Use the arrow keys to select VNC and press Enter.
You will be prompted to enable VNC Server. ...respond YES
...may take a while before informed connected, then respond OK
Set to 1024x768 or 1280 x 720 or 1280x1024 or 1600x1200
``
The Pi Zero 2W has 512M of memory and the default swap space to do a memory update may be insufficient.
From a Terminal window, enter the command swapon. The answer gives the file name, size, and usage of the swap file. The default swap file size is 100M and that probably is not sufficient with 512M memory.
Enter sudo nano /etc/dphys-swapfile and change CONF_SWAPSIZE=100 to 1024. Reboot and then before doing anything enter the command "swapon" in a terminal window to see the swap space usage.
The Eclipse Paho MQTT Python library provides a client client class to enable applications to connect to the MQTT Eclipse Mosquitto broker to publish messages and to subscribe to topics and receive published messages.
Add/Remove search for mosquitto and install MQTT compatible message broker for Mosquitto. The client library will be added automatically.
Unless the configuration File is modified MQTT only runs on same computer as localhost.
Starting with the release of Mosquitto version 2.0.0, the default configuration will only bind to localhost. To enable remote access so that we can communicate with other IoT devices, we need to edit/create a configuration file.
1) Run the following command to open the mosquitto.conf file.
sudo nano /etc/mosquitto/mosquitto.conf
2) Move to the end of the file using the arrow keys and paste the following two lines:
listener 1883
allow_anonymous true
Mosquitto configuration file to allow remote connections and anonymous users
3) Then, press CTRL-X to exit and save the file. Press Y and Enter.
4) Restart Mosquitto for the changes to take effect.
sudo systemctl restart mosquitto
When configuring MQTT server in Node Red, in the MQTT broker node set the Protocol to MQTT V5.
(v3.x no longer supports Nodejs 12 )
then add --node18 to bash script
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18
For a specific version of Node Red add for eg --nodered-version="3.0.1"
Assumes standard raspberry pi installation with headless setup.
Install Bluepy from https://github.com/IanHarvey/bluepy .
To install the current released version, on most Debian-based systems:
$ sudo pip3 install bluepy
$ sudo setcap cap_net_raw+e <PATH>/bluepy-helper
$ sudo setcap cap_net_admin+eip <PATH>/bluepy-helper
Where <PATH> is the place where bluepy-helper is installed; it's easiest to just search for this,
e.g.
$ find /usr/local/lib -name bluepy-helper
Raspian may already have WiringPi installed. Check by entering
gpio -v if bash: gpio: command not found then need to install WiringPi.
then install WiringPi. Unfortunately it has been deprecated and sudo apt-get install wiringpi no longer works. The GPIO Zero library is now the default installed on Debian!
Follow setup instructions in link below.
433Utils is made by GitHub user wolfeidau code allows reading and sending commands over 433MHz. The fork by jstevenperry works whereas the original didn’t!
The following instructions are based on Steven Perry’s Home Automation Series (video) (wordpress)
To install run following commands
$ mkdir HA
$ cd ~/HA
$ git clone --recursive https://github.com/jstevenperry/433Utils no longer available but could copy from PC backup seems to have a few differences from the original then follow instructions below
$ cd 433Utils/RPi_utils
$ make
**Moved 433Utils folder to HA folder (my folder for Home Automation projects)
**If recovering 433Utils in HA folder from a backup held on PC, need to
$ cd HA/433Utils/RPi_utils
$ make