/etc/ssh/sshd_config to set:
ClientAliveInterval 60
ClientAliveCountMax 10
and or in /etc/ssh/ssh_config: ServerAliveInterval 60
ServerAliveCountMax 10
/etc/ssh/sshd_config to set:
ClientAliveInterval 60
ClientAliveCountMax 10
and or in /etc/ssh/ssh_config: ServerAliveInterval 60
ServerAliveCountMax 10
Note that Pi4j v1.4 relies on Java 11, whcih will cause issues with older models of Raspberry Pis.
Therefore, mosly best to stick to v1.3, and disable the repo in /etc/apt/sources.list.d/pi4j.list
Pi4j v2.0 is next..
VS Code Remote Development is fantastic, but it doesn't support the Raspberry Pi Zero as the armv6l isn't supported.
However, this it is possible to mount /home/pi as a Samba share and amend files locally, which will perform similarly (for Python development anyway).
This is described here. Install Samba with:
sudo apt install -y samba
Then add the following to /etc/samba/smb.conf as follows:
[PiShare]
comment=Pi Share
path=/home/pi
browseable=yes
writeable=yes
only guest=no
create mask=0740
directory mask=0750
public=no
Note that the Samba configuration file can be checked with the testparm command.
Finally, set a password with sudo smbpasswd -a pi. This will create the Samba user pi.
This can be accessed from another computer on the network as \\hostname\share
APT (Advanced Packaging Tool) is a set of tools that was developed for Debian Linux platform as an easy command line interface for the dpkg utility
apt update
apt upgrade
apt install python3
apt install ./pi4j-1.3.deb # install local package
apt show python3
apt remove python3
apt list # lists all available packages
apt list --installed # lists installed packages
apt list python3 # also shows if package is installed
apt search python3
# list all files contained in the package
dpkg -L python3
# find which package contains a file
dpkg -S /usr/bin/python3
wpa_supplicant.conf file in the root of the SD card
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
network={
ssid="ssid"
psk="psk"
}
raspi-config to set hostname, interfaces etc.sudo apt install default-jdk
# or for older RPi mmodels
sudo apt install openjdk-8-jdk liblog4j2-java wiringpi libmysql-java
Edit: turns out these can now be set up with the Raspberry Pi Imager v1.6, which is a lot easier...
Note that this doesn't appear to work with Windows 11...
Rows from two tables can be combined using joins.
Inner joins return only the rows that meet the specified condition in both tables.
# keyword INNER is optional
SELECT * FROM toys
INNER JOIN bricks
ON toy_id = brick_id;
# Oracle syntax
SELECT * FROM toys, bricks WHERE toy_id = brick_id;
Outer joins return all the rows from one table, along with the matching rows from the other. Rows without a matching entry in the outer table return null for the outer table's columns.
An outer join can either be left or right, which determines which side of the join the table returns all rows for.
# keyword OUTER is optional
SELECT * FROM toys
LEFT OUTER JOIN bricks
ON toy_id = brick_id;
SELECT * from toys
RIGHT JOIN bricks
ON toy_id = brick_id;
A full join includes unmatched rows from both tables. This is not supported directly by MariaDB.
SELECT * FROM toys
FULL JOIN bricks
ON toy_id = brick_id;
SELECT * FROM toys
CROSS JOIN bricks;
See also here
This should reconnect a Raspberry Pi if it drops from the network due to router issues...
*/5 * * * * /bin/ping -q -c10 192.168.1.254 > /dev/null 2>&1 || (sudo /sbin/ifconfig wlan0 down ;sleep 5 ;sudo /sbin/ifconfig wlan0 up ;/usr/bin/logger wifi on wlan0 restarted via crontab)
First, connect to the pi using the USB to UART cable, following the instructions at Adafruit, and enabling the connection in /boot/config.txt
Then set up wifi following the instructions at raspberrypi.org.
Then change the default password using:
sudo passwd pi
Then enable SSH, and update the hostname using:
sudo raspi-config
# Select Interfacing Options and enable SSH
# Select Network Options and change hostname
Finally, update the software with:
sudo apt update
sudo apt upgrade