Hi everyone!
Shorted question:
How to make my project availible 24/7 with unstable electrical power(In my country)?
Automaticly safy turn on and turn off.
More details about my project։
Im wondering about safest way for my server.
I'm new in Raspberry pi. So I'm writing discord bot on my Pi using raspberry os.
I'm using Python 3, bash, rclone, and crontab.
How it works?
1. Every start-up works crontab. Where I configured rclone, and bash script run.
1.1. crobtab mount rclone Google drive (for make data backups on every run and restarts)
1.2. after that I have bash script which one is checking internet availability and waiting. After established connection script running python environment and asynchronous pythons codes(discord.py) using with timeot(interrupting every 24 hours in specific time).
Crontab runs this script:1.3. After python logout (safe way in discord.py). Bash script continue create backups in Google drive.
1.4 After that(bash script ends) in crontab I have reboot comand. Which one starting reboot my pi server.
What the problem?
However I'm new with Raspberry Pi. I bought Raspberry Pi 3 Model B.
1) In begining I wouldn't care about power. In my country I have unstable electricity power. And in After first interrupting my project fall down. microSD had wrong datas. And I reinstalled and configured again.
In begin I solved this problem by using my powerbank with 10000mAh. But it give me 1.5A max. And system started notify me about low power.
2) After that I was ordered UPS-18650 Lite
I tried use 2 power cables(Found in forums, but it not works)
Now it look like that:
Now currently problem where im trying to find solutions:
1) Is there possible to turn on Raspberry Pi from UPS HAT? Ex. When power plugged and battery is >25% turn on automatically if Raspberry Pi is turned off.
2) How control and turn off safety from python script? With this hat I have git repo with python script.
https://github.com/linshuqin329/UPS-18650-Lite
V1.2 this script can read percentage of battery.
Shorted question:
How to make my project availible 24/7 with unstable electrical power(In my country)?
Automaticly safy turn on and turn off.
More details about my project։
Im wondering about safest way for my server.
I'm new in Raspberry pi. So I'm writing discord bot on my Pi using raspberry os.
I'm using Python 3, bash, rclone, and crontab.
How it works?
1. Every start-up works crontab. Where I configured rclone, and bash script run.
1.1. crobtab mount rclone Google drive (for make data backups on every run and restarts)
1.2. after that I have bash script which one is checking internet availability and waiting. After established connection script running python environment and asynchronous pythons codes(discord.py) using with timeot(interrupting every 24 hours in specific time).
Crontab runs this script:
Code:
HOME=/home/usernamePATH=/usr/bin@reboot /usr/bin/bash /home/username/Discord-bot/LinuxAutorun.sh > /home/username/Discord-bot/terminal_logs/$(date '+\%Y-\%m-\%d \%H:\%M:\%S').log; sleep 10; sudo reboot
1.4 After that(bash script ends) in crontab I have reboot comand. Which one starting reboot my pi server.
What the problem?
However I'm new with Raspberry Pi. I bought Raspberry Pi 3 Model B.
1) In begining I wouldn't care about power. In my country I have unstable electricity power. And in After first interrupting my project fall down. microSD had wrong datas. And I reinstalled and configured again.
In begin I solved this problem by using my powerbank with 10000mAh. But it give me 1.5A max. And system started notify me about low power.
2) After that I was ordered UPS-18650 Lite
I tried use 2 power cables(Found in forums, but it not works)
Now it look like that:
Now currently problem where im trying to find solutions:
1) Is there possible to turn on Raspberry Pi from UPS HAT? Ex. When power plugged and battery is >25% turn on automatically if Raspberry Pi is turned off.
2) How control and turn off safety from python script? With this hat I have git repo with python script.
https://github.com/linshuqin329/UPS-18650-Lite
V1.2 this script can read percentage of battery.
Statistics: Posted by Hacker32Bit — Sat Dec 28, 2024 9:49 am — Replies 0 — Views 5