Has anybody been able to get Safe Shutdown working with the Geekworm x729.
I have been able to get the Power Off working with the following settings:
GPIO 26 - 37
Transition: low->high
When I use the settings for Safe Shutdown it either doesn't work or enters a shutdown loop where as soon as it gets booted up it shuts down. This happens before I can even SSH in and figure out what is happening or disable. I end up having to reformat and start over. I think the x729 does a pull up right at the beginning and this causes the OpenPlotter monitor to think its time for a safe shutdown
GPIO 6 - 31
Transition: low->high (I think. Tried both)
GPIO Pull: pull-up (I think. Tried all 3)
I am able to get Safe Shutdown working with the directions from https://wiki.geekworm.com/X729-script creating a service. But, it does not handle shutting down the UPS from the desktop shutdown or 'sudo shutdown now'. These only shut down the Pi. To restart it you need to physically press the button on the x729. And it leaves the x729 running til it runs out of battery if power is removed.
If you enable the OpenPlotter Power Off function then the x729 properly shuts down when you use the desktop or cli shutdown. But, this breaks the x729 service that monitors for power loss and properly shuts down the Pi.
For the most part this works for me. I only shut down the Pi by removing power to the x729. I would really just like to know how the Safe Shutdown works and why it won't work for me.
FYI, here is the part of my install script to handle all the x729 functions.
I have been able to get the Power Off working with the following settings:
GPIO 26 - 37
Transition: low->high
When I use the settings for Safe Shutdown it either doesn't work or enters a shutdown loop where as soon as it gets booted up it shuts down. This happens before I can even SSH in and figure out what is happening or disable. I end up having to reformat and start over. I think the x729 does a pull up right at the beginning and this causes the OpenPlotter monitor to think its time for a safe shutdown
GPIO 6 - 31
Transition: low->high (I think. Tried both)
GPIO Pull: pull-up (I think. Tried all 3)
I am able to get Safe Shutdown working with the directions from https://wiki.geekworm.com/X729-script creating a service. But, it does not handle shutting down the UPS from the desktop shutdown or 'sudo shutdown now'. These only shut down the Pi. To restart it you need to physically press the button on the x729. And it leaves the x729 running til it runs out of battery if power is removed.
If you enable the OpenPlotter Power Off function then the x729 properly shuts down when you use the desktop or cli shutdown. But, this breaks the x729 service that monitors for power loss and properly shuts down the Pi.
For the most part this works for me. I only shut down the Pi by removing power to the x729. I would really just like to know how the Safe Shutdown works and why it won't work for me.
FYI, here is the part of my install script to handle all the x729 functions.
Code:
# x729
git clone https://github.com/geekworm-com/x729-script ~/x729-script
chmod +x ~/x729-script/*.sh
# x729 Clock
echo -e "\n# UPS Read RTC Time\ndtoverlay=i2c-rtc,ds1307" | sudo tee -a /boot/firmware/config.txt
sudo apt remove fake-hwclock -y
sudo update-rc.d -f fake-hwclock remove
sudo systemctl disable fake-hwclock
sudo sed -i 's/^\([^#].*\)/# \1/g' /lib/udev/hwclock-set
sudo sed -i '/dev=$1/s/^#//g' /lib/udev/hwclock-set
# x729 Fan
echo -e "\n# UPS Fan\ndtoverlay=pwm-2chan,pin2=13,func2=4" | sudo tee -a /boot/firmware/config.txt
sudo cp -f ~/x729-script/x729-fan.sh /usr/local/bin/
sudo cp -f ~/x729-script/x729-fan.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now x729-fan
# x729 Power
# sed -i '/sudo poweroff/i \ sleep 5' ~/x729-script/xPWR.sh
sudo cp -f ~/x729-script/xPWR.sh /usr/local/bin/
sudo cp -f ~/x729-script/x729-pwr.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now x729-pwr
# x729 Power Loss
sudo usermod -aG gpio pi
cp -f ~/x729-script/sample/plsd-gpiod.py ~/x729-script/powerloss.py
sed -i 's/chipname = "gpiochip0"/chipname = "gpiochip4"/' ~/x729-script/powerloss.py
sudo chmod +x ~/x729-script/powerloss.py
sudo cp -f ~/x729-script/powerloss.py /usr/local/bin/
###################
bash -c 'cat << "EOF" > ~/x729-script/powerloss.service
[Unit]
Description=Power Loss Service
After=multi-user.target
[Service]
ExecStart=/usr/bin/python3 /usr/local/bin/powerloss.py
Restart=always
User=pi
Group=pi
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
EOF'
###################
sudo cp -f ~/x729-script/powerloss.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now powerloss
