Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales@spotpear.com
dragon_manager@163.com
tech-support@spotpear.com
zhoujie@spotpear.com
WhatsApp:13246739196
This is an RTC WatchDog HAT (B) designed for Raspberry Pi with high-precision RTC and watchdog HAT, which refreshes and counts at a specific time, otherwise the watchdog circuit will reset the system.
sudo raspi-config Select Interfacing Options -> SPI -> Yes to enable the I2C kernel driver
And then reboot the Raspberry Pi:
sudo reboot
If you use bookworm system, only the lgpio library is available, bcm2835 and wiringPi libarary cannot be installed or used. Please note that the python library does not need to be installed, you can directly run the demo.
#Open the Raspberry Pi terminal and run the following commands: wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz tar zxvf bcm2835-1.71.tar.gz cd bcm2835-1.71/ sudo ./configure && sudo make && sudo make check && sudo make install # For more information, please refer to the official website: http://www.airspayce.com/mikem/bcm2835/
#Open the Raspberry Pi terminal and run the following commands: cd sudo apt-get install wiringpi #For Raspberry Pi systems after May 2019 (those earlier may not require execution), an upgrade may be necessary: wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # Run gpio -v and version 2.52 will appear. If it does not appear, there is an installation error #Bullseye branch system uses the following command: git clone https://github.com/WiringPi/WiringPi cd WiringPi ./build gpio -v # Run gpio -v and version 2.70 will appear. If it does not appear, there is an installation error
sudo su wget https://github.com/joan2937/lg/archive/master.zip unzip master.zip cd lg-master sudo make install # For more information, please refer to the official website: https://github.com/gpiozero/lg
sudo apt-get update sudo apt-get install ttf-wqy-zenhei sudo apt-get install python3-pip sudo pip3 install spidev
wget https://files.waveshare.com/wiki/RTC-WatchDog-HAT-B/RTC_WatchDog_HAT_B_Demo.zip unzip RTC_WatchDog_HAT_B_Demo.zip sudo chmod 777 -R RTC_WatchDog_HAT_B_Demo
cd ~ cd RTC_WatchDog_HAT_B_Demo/Raspberrypi/RTC/c/ make clean make -j8 sudo ./main
cd ~ cd RTC_WatchDog_HAT_B_Demo/Raspberrypi/RTC/python/examples/ #Set RTC time and display the time, date and temperature in the cycle sudo python main.py #synchronize the RTC time to the system without network sudo python Set_system_time.py
Note: The network should be disabled during this process.
sudo nano /etc/rc.local #Enter the following commands between fi and exit 0, save and exit. The demo for feeding dog will automatically run when it boots the next time cd /home/pi/RTC_WatchDog_HAT_B_Demo/Raspberrypi/RTC/python/examples/ sudo python Set_system_time.py & #In the "cd /home/pi/...", pi is the username that you can set by yourself
Note that you do not need to use the above demo if you use this method.
Modify the /boot/config.txt by adding the following line at the end:
dtoverlay=i2c-rtc,ds3231
Synchronize System Clock -> Hardware Clock.
sudo hwclock -w
Synchronize Hardware Clock -> System Clock.
sudo hwclock -s
#Disable the network or the time synchronization via the network, otherwise, the time can not be set.
Set the hardware clock time:
sudo hwclock --set --date="9/8/2021 16:45:05"
View the hardware clock.
sudo hwclock -r
Display version information.
sudo hwclock --verbose
cd ~ cd RTC_WatchDog_HAT_B_Demo/Raspberrypi/WatchDog/c make clean make -j8 sudo ./main
cd ~ cd RTC_WatchDog_HAT_B_Demo/Raspberrypi/WatchDog/python sudo python WatchDog_Demo.py
sudo apt update sudo apt install nano -y sudo apt install python3-pip pip3 install Jetson.GPIO pip3 install smbus
wget https://files.waveshare.com/wiki/RTC-WatchDog-HAT-B/RTC_WatchDog_HAT_B_Demo.zip unzip RTC_WatchDog_HAT_B_Demo.zip sudo chmod 777 -R RTC_WatchDog_HAT_B_Demo
cd ~ cd RTC_WatchDog_HAT_B_Demo/Jetson_nano/RTC/c/ make clean make -j8 sudo ./main
cd ~ cd RTC_WatchDog_HAT_B_Demo/Jetson_nano/RTC/python/examples/ #Set the RTC time and cyclically display the time, date and temperature sudo python3 main.py #Synchronize the RTC time with the system without internet connectivity sudo python3 Set_system_time.py
Note: Do not connect to the network during this process.
cd /home/User/RTC_WatchDog_HAT_B/Jetson_nano/ #User is the host username, set it to your username, for example: if your username is "jetson", then input the command: cd /home/jetson/RTC_WatchDog_HAT_B/Jetson_nano/ #The content in the following two files is the same, and you need to replace "User" with your username sudo chmod 777 start.sh sudo chmod 777 start.service sudo cp start.service /etc/systemd/system systemctl daemon-reload systemctl enable start.service sudo reboot
The watchdog cycles:
cd ~ cd RTC_WatchDog_HAT_B_Demo/Raspberrypi/WatchDog/c make clean make -j8 sudo ./main
cd ~ cd RTC_WatchDog_HAT_B_Demo/Raspberrypi/WatchDog/python sudo python WatchDog_Demo.py
sudo apt update sudo apt install git-core git clone https://gitee.com/study-dp/WiringPi.git cd WiringPi ./build #If the software version is shown after inputting the following commands, the installation is successful. gpio -v
sudo apt update sudo apt install nano sudo apt install python3-pip sudo pip3 install Hobot.GPIO sudo pip3 install smbus
wget https://files.waveshare.com/wiki/RTC-WatchDog-HAT-B/RTC_WatchDog_HAT_B_Demo.zip unzip RTC_WatchDog_HAT_B_Demo.zip sudo chmod 777 -R RTC_WatchDog_HAT_B_Demo
cd ~ cd RTC_WatchDog_HAT_B_Demo/Horizon_Sunrise_X3_PI/RTC/c make clean make -j8 sudo ./main
cd ~ cd RTC_WatchDog_HAT_B_Demo/Horizon_Sunrise_X3_PI/RTC/python/examples/ #Set RTC time and display the time, date and temperature in the cycle sudo python3 main.py #Synchronize the RTC time to the system without network sudo python3 Set_system_time.py
sudo cp -r /home/sunrise/RTC_WatchDog_HAT_B_Demo/Horizon_Sunrise_X3_PI /root/X3/ sudo chmod 777 -R /root/X3/Horizon_Sunrise_X3_PI/RTC/python/examples/Set_system_time.py sudo nano /etc/rc.local #Add the following command at the front line of exit 0 python3 /root/X3/Horizon_Sunrise_X3_PI/RTC/python/examples/Set_system_time.py #Save and exit
Input "date" to view the date.
cd ~ cd RTC_WatchDog_HAT_B_Demo/Horizon_Sunrise_X3_PI/WatchDog/c make clean make -j8 sudo ./main
cd ~ cd RTC_WatchDog_HAT_B_Demo/Horizon_Sunrise_X3_PI/WatchDog/python sudo python WatchDog_Demo.py
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com