Raspberry Pi OS Time Source / NTP

Check current config

timedatectl 

Local time: Wed 2021-07-07 19:17:53 UTC
Universal time: Wed 2021-07-07 19:17:53 UTC
RTC time: n/a
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no

Change time source / NTP

sudo nano /etc/systemd/timesyncd.conf

[Time]
#NTP=
FallbackNTP=192.168.1.200

Install owfs for DS2482-800

sudo apt-get update
sudo apt-get install owfs python-ow ow-shell -y

(ignore errors about not being configured)

sudo nano /etc/owfs.conf
Comment out
server: FAKE = DS18S20,DS2405

Find
# USB device: DS9490

Insert this below
server: device = /dev/i2c-1

Remove hashes from
mountpoint = /mnt/1wire
allow_other

sudo mkdir /mnt/1wire

sudo systemctl enable owserver.service

Reboot

Backup SD card online to external USB card

Piclone (gui) only backups the actual data - https://github.com/raspberrypi-ui/piclone

 

To run from command line

Copy this script https://github.com/raspberrypi-ui/piclone/blob/master/src/backup

On raspberry pi, run

sudo nano sdclone.sh

paste in the text

cntrl-x then y to save and exit

sudo chmod 777 sdclone.sh

 

I'm using a Sandisk external SD card and USB micro SD card reader

16gb Sandisk class 10 Micro SD card - https://amzn.to/350eGpw

Kingston Micro SD card reader USB - https://amzn.to/2Ver1BX

 

Run lsblk

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1 14.9G  0 disk
├─sda1        8:1    1 43.2M  0 part
└─sda2        8:2    1 14.8G  0 part
mmcblk0     179:0    0  7.5G  0 disk
├─mmcblk0p1 179:1    0 43.2M  0 part /boot
└─mmcblk0p2 179:2    0  7.4G  0 part /

 

 

To run

 

sudo ./sdclone.sh /dev/sda /dev/macblk0

 

 

 

 

Items to add to a new Pi install

sudo apt-get update
sudo rpi-update
sudo apt-get -y dist-upgrade
sudo apt-get update

sudo apt-get install python-smbus i2c-tools mariadb-client-10.0 python-mysqldb git minicom build-essential python-serial python-dev python-pip fswebcam git scons swig python-openssl python3-lxml python-lxml -y

MQTT

sudo pip install paho-mqtt
sudo pip3 install paho-mqtt

sudo pip install --index-url=https://pypi.python.org/simple/  paho-mqtt

DHT22

git clone https://github.com/adafruit/Adafruit_Python_DHT.git

cd Adafruit_Python_DHT

sudo python setup.py install

 

BMP085

git clone https://github.com/adafruit/Adafruit_Python_BMP.git
cd Adafruit_Python_BMP
sudo python setup.py install

 

LEDs

git clone https://github.com/jgarff/rpi_ws281x.git
cd rpi_ws281x
scons

cd python
sudo python setup.py install

 

BME680

curl https://get.pimoroni.com/bme680 | bash

 

Neopixles

sudo pip install rpi_ws281x