DeskPi-Team / deskpi

DeskPi Pro is the Ultimate Case Kit for Raspberry Pi 4 with Full Size HDMI/2.5 Hard Disk Support and Safe Power Button, It has QC 3.0 Power Supply inside and New ICE Tower Cooler inside.
GNU General Public License v3.0
140 stars 46 forks source link

Automatic Fan Control Stops Working #81

Closed RadJKW closed 1 year ago

RadJKW commented 2 years ago

Hardware/Software

Issue Details

How did i find the issue?

I leave my deskpi running throughout the week in my office. If i pay attention, i will notice that the deskpi is running at around 60c on idle ( just loaded into the desktop environment). It took me a minute, but i realized that 60 degrees was a little high with the type of cooler in the deskpi case.

Can i fix the issue?

I have not completely "FIXED" the issue. However, if i run the command deskpi-config and choose 7 - Cancel manual control and enable automatic fan control. Immediately after the fan kicks on and the temperature reaches about 48c.

Other

sondercoder commented 2 years ago

When you've noticed its stopped, can you run systemctl status deskpi.service and paste the output here

RadJKW commented 2 years ago

@sondercoder I came into the office this morning and noticed the cpu temp was around 60. i checked the status using sudo systemctl status deskpi. It returned the following

deskpi.service - DeskPi PWM Control Fan Service
   Loaded: loaded (/lib/systemd/system/deskpi.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-27 09:48:48 CDT; 1 day 2h ago
 Main PID: 5228 (sudo)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/deskpi.service
           ??5228 /usr/bin/sudo /usr/bin/pwmFanControl
           ??5229 /usr/bin/pwmFanControl

Conclusion of Events

sondercoder commented 2 years ago

I've been trying to re-create your issue, and I am still looking into it. Hopefully I can find the problem. Can you share the contents of /etc/deskpi.conf, and when its broken again the outout of 'stty -F /dev/ttyUSB0'

RadJKW commented 2 years ago
yoyojacky commented 2 years ago

you can just run deskpi-config again and select 6 and input your threshold according to the message or just modify /etc/deskpi.conf file and input the threshold information such as following, one arugment at each line, temp_threshold, fan speed :

50 
175 
55 
100 
60 
100 
65 
100 

It means when the cpu temp is 50 degree ---> turn on the fan at 75% speed when the cpu temp is 55 degree ---> turn on the fan at 100% speed and so on.

frasito commented 2 years ago

I have this issue too. Default automatic or with manually chosen settings. The fan will always stop at some point and has to be put on again using deskpi-config. Reboot seems to initiate the default setting again but it will not last. Very frustrating as i'm running a standalone application and constantly need to exit to restart the fan as temp approaches 60C. My deskpi.conf file is always loaded with suitable values.

Test: I had my app running for an hour, noticed fan not running, temp at 55C. I exited my running application and selected option 7 in deskpi-config. After 20 minutes I hear the fan is off again and do a status check. Status at present is "activating". CPU temp is back up to 51C from 43C. The fan control is definitely off again.

Status:

deskpi.service - DeskPi PWM Control Fan Service
 Loaded: loaded (/lib/systemd/system/deskpi.service; enabled; vendor preset: enabled)
 Active: activating (start) since Fri 2022-01-07 23:42:23 GMT; 21min ago
 Main PID: 1567 (sudo)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/deskpi.service
             1567 /usr/bin/sudo /usr/bin/pwmFanControl &
             1568  /usr/bin/pwmFanControl &

Using deskpi-config i then set my own thresholds (option 6) and the fan started again immediately. A status check again is still the same: activating. A few minutes and the fan had the temp stabilised at 45C.

I now set the fan to run solid at 75% (option 3). A status check returns "failed":

Status

 deskpi.service - DeskPi PWM Control Fan Service
   Loaded: loaded (/lib/systemd/system/deskpi.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Sat 2022-01-08 00:22:57 GMT; 27s ago
   Process: 1840 ExecStart=/usr/bin/sudo /usr/bin/pwmFanControl & (code=killed, signal=TERM)
   Main PID: 1840 (code=killed, signal=TERM)

 systemd[1]: Starting DeskPi PWM Control Fan Service...
 sudo[1840]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/pwmFanControl &
 sudo[1840]: pam_unix(sudo:session): session opened for user root by (uid=0)
 sudo[1840]: pam_unix(sudo:session): session closed for user root
 systemd[1]: deskpi.service: Main process exited, code=killed, status=15/TERM
 systemd[1]: deskpi.service: Failed with result 'signal'.
 systemd[1]: Stopped DeskPi PWM Control Fan Service.

If the fan is set to a fixed level (option 1 -4) it appears not to exhibit the problem and will continue to run. The issue is only with the automatic control.

Any help is appreciated. Linux 5.10.63-v7l+ #1496 armv71 GNU/Linux

bjs-pdx commented 2 years ago

Was a solution to this ever found? I have the same problem in that the only way to get the fan to run at 100% is by choosing option 4 within the deskpi-config program and then the fan only stays on until the next reboot. Doesn't seem to matter what settings are in /etc/deskpi.conf.

bigbucketboy commented 2 years ago

I literally just created an account solely for this issue as well. Has this been resolved? Thanks!

RadJKW commented 2 years ago

For everyone commenting on this, no I have not identified the issue. Honestly I just accepted it at this point. I have installed it on raspberryPi OS 11 (64bit) and have not noticed the issue but also have not looked for it.

bjs-pdx commented 2 years ago

I'm writing a script I can execute to just run the fan at 100% continuously. Found the code I needed in the deskpi-config file to allow me to do so. You just disable the deskpi.service and send a command to ttyUSB0 to change the fan speed. Going to set it up to run at start up.

bigbucketboy commented 2 years ago

I'm writing a script I can execute to just run the fan at 100% continuously. Found the code I needed in the deskpi-config file to allow me to do so. You just disable the deskpi.service and send a command to ttyUSB0 to change the fan speed. Going to set it up to run at start up.

That's awesome. Can you share what you find and can we modify it to work at any fan speed we'd like?

bigbucketboy commented 2 years ago

Also, can anyone show me their /usr/lib/systemd/system/deskpi.service file? Here's mine:

[Unit] Description=DeskPi Fan Control Service After=multi-user.target [Service] Type=simple RemainAfterExit=no ExecStart=sudo /usr/bin/pwmFanControl64 [Install] WantedBy=multi-user.target

I changed this:

[Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/bin/pwmFanControl64 &

To this:

[Service] Type=simple RemainAfterExit=no ExecStart=sudo /usr/bin/pwmFanControl64

I read somewhere else that this seemed to make their deskpi.service activate but I'm unsure what it really does and haven't done any extensive testing to verify if it works. Someone else like to give it a go with me that'd be awesome.

Let me know.

bjs-pdx commented 2 years ago

Here is the relevant code:

# Stop deskpi.service so that user can define the speed level.
sudo systemctl stop deskpi.service

. /lib/lsb/init-functions
# This is the serial port that connect to deskPi mainboard and it will
# communicate with Raspberry Pi and get the signal for fan speed adjusting.
serial_port='/dev/ttyUSB0'

 sudo sh -c "echo pwm_100 > $serial_port"
 log_action_msg "Fan speed level has been change to 100%"

deskpi.service:


[Unit]
Description=DeskPi PWM Control Fan Service
After=multi-user.target
[Service]
Type=simple
RemainAfterExit=no
ExecStart=sudo /usr/bin/pwmFanControl
[Install]
WantedBy=multi-user.target
bigbucketboy commented 2 years ago

Here is the relevant code:


# Stop deskpi.service so that user can define the speed level.

sudo systemctl stop deskpi.service

. /lib/lsb/init-functions

# This is the serial port that connect to deskPi mainboard and it will

# communicate with Raspberry Pi and get the signal for fan speed adjusting.

serial_port='/dev/ttyUSB0'

 sudo sh -c "echo pwm_100 > $serial_port"

 log_action_msg "Fan speed level has been change to 100%"

deskpi.service:


[Unit]

Description=DeskPi PWM Control Fan Service

After=multi-user.target

[Service]

Type=simple

RemainAfterExit=no

ExecStart=sudo /usr/bin/pwmFanControl

[Install]

WantedBy=multi-user.target

I noticed your last line doesn't have the 64 at the end of the ExecStart line. You are running 64 bit Bullseye Raspberry Pi OS correct? That fan control is the 32but version. I wonder if that has anything to do with it?

bjs-pdx commented 2 years ago

No, running 32bit. Switched when BullsEye didn't work.


PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

uname -m
armv7l
bigbucketboy commented 2 years ago

No, running 32bit. Switched when BullsEye didn't work.


PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"

NAME="Raspbian GNU/Linux"

VERSION_ID="10"

VERSION="10 (buster)"

VERSION_CODENAME=buster

ID=raspbian

ID_LIKE=debian

HOME_URL="http://www.raspbian.org/"

SUPPORT_URL="http://www.raspbian.org/RaspbianForums"

BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

uname -m

armv7l

Gotcha. Okay that makes more sense. Although it seems as though it doesn't make a difference I guess. Sucks the devs won't help us out here. But still a great product none the less. Did that script end up working for you?

bjs-pdx commented 2 years ago

Yeah, disappointed too. Haven't actually tested the script but did run the command to set the correct speed. Seems to work. Just need to get something in place to run at startup.

bjs-pdx commented 2 years ago

Created my script and added it to crontab to execute on boot. Seems to have worked as designed. The deskpi.service is stopped and the fan is running at high speed after a reboot. This seems to have fixed my problem, but doesn't resolve the software issues for anything. I just consider it a workaround or kludge.

bigbucketboy commented 2 years ago

Created my script and added it to crontab to execute on boot. Seems to have worked as designed. The deskpi.service is stopped and the fan is running at high speed after a reboot. This seems to have fixed my problem, but doesn't resolve the software issues for anything. I just consider it a workaround or kludge.

Right on that's awesome I'm gonna have to give it a try. Would you mind pasting the full code and script and what you did? I'm fairly new and since we are running 64bit and 32bit respectively I wanna make sure there isn't anything I need to change. Also, if you shut the system down all the way does the fan turn off? Thanks.

bjs-pdx commented 2 years ago

It's basically what I posted:

# This script stops the deskpi.service and sets fan speed to 100%
# Stop deskpi.service so that user can define the speed level.
sudo systemctl stop deskpi.service

. /lib/lsb/init-functions
# This is the serial port that connect to deskPi mainboard and it will
# communicate with Raspberry Pi and get the signal for fan speed adjusting.
serial_port='/dev/ttyUSB0'

sudo sh -c "echo pwm_100 > $serial_port"
log_action_msg "Fan speed level has been change to 100%"

Created the file, made it executable and added it to crontab using sudo. Not sure what you mean by shutting down all the way... "shutdown -h"?

bigbucketboy commented 2 years ago

It's basically what I posted:


# This script stops the deskpi.service and sets fan speed to 100%

# Stop deskpi.service so that user can define the speed level.

sudo systemctl stop deskpi.service

. /lib/lsb/init-functions

# This is the serial port that connect to deskPi mainboard and it will

# communicate with Raspberry Pi and get the signal for fan speed adjusting.

serial_port='/dev/ttyUSB0'

sudo sh -c "echo pwm_100 > $serial_port"

log_action_msg "Fan speed level has been change to 100%"

Created the file, made it executable and added it to crontab using sudo. Not sure what you mean by shutting down all the way... "shutdown -h"?

Great thanks! I'll give it a shot. Yeah "shutdown -h now" or "sudo poweroff"

bigbucketboy commented 2 years ago

Your script works and it's a solid option until the devs fix their script. Thanks!

bjs-pdx commented 2 years ago

Glad it works and hopefully gets your settings to what you need. Still unhappy that there's been no response from the devs. Seems like it might be a dead project.

bigbucketboy commented 2 years ago

Glad it works and hopefully gets your settings to what you need. Still unhappy that there's been no response from the devs. Seems like it might be a dead project.

Yeah it does thanks! And I agree unfortunate too this case is one of the best RPI cases on the market.

yoyojacky commented 2 years ago

Please check the drivers folder , there are 64bit binary executable file for 64bit OS.

yoyojacky commented 2 years ago

Glad it works and hopefully gets your settings to what you need. Still unhappy that there's been no response from the devs. Seems like it might be a dead project.

Yeah it does thanks! And I agree unfortunate too this case is one of the best RPI cases on the market.

Sorry for my slow response due to i am working on testing deskpi pro case all the time.

yoyojacky commented 2 years ago

actually, the main principle of the fan is that the program will always check the CPU temperature via reading /sys/class/thermal/thermal_zone0/temp file and then sending "pwm_xxx" signal to /dev/ttyUSB0 devcie to control the fan speed. and we have already test it and it works fine. my test machine has been running for 7 months and it still works fine.... if you select the automatically mode, you need to check if the /etc/deskpi.conf file is correct and i suggest that you reset this file by using deskpi-config and try again...

bjs-pdx commented 2 years ago

I have reset using deskpi-config multiple times and the fan never worked correctly. I am running a 32bit version of Raspbian so 64bit drivers are irrelevant. If I use deskpi-config to set the fan speed to 100% on reboot the fan isn't running and appears to be back to default settings. When I manually configure speed preferences using deskpi-config it updates the deskpi.conf file but ignores the settings.

bartlet7827 commented 2 years ago

Hi All, I have been experiencing the same fan issues where it stop working after about 18 minutes. If I restart it using deskpi-config (option 7), it works again for around 18 minutes then stops.

I'm running Bullseye 64bit on a Raspberry Pi 4B 4GB with the Deskpi Pro case.

I tried modifying /usr/lib/systemd/system/deskpi.service as suggested by @bigbucketboy. But this did not help, the fan still stops after 18 minutes.

Interestingly though, I noticed the following after the modification to deskpi.service:

  1. After a reboot, the service now actually starts - systemctl status deskpi.service shows active (running). Previously it would show activating (start) but never actually starts.
  2. Although the service was now running, the fan was not running despite being above a threshold temperature.

I then did ps -ef | grep pwm to see if pwmFanControl64 was running. It was but the fan was off. The process it showed was sudo /usr/bin/pwmFanControl64 . I needed to run deskpi-config (option 7) again to get the fan started. I modified deskpi.service again and removed sudo. This time the service and fan started after a reboot - but stops after 18 minutes of course as before.

I have resorted to manually setting the fan to 100% at login by modifying .profile. I added the following lines: serial_port = '/dev/ttyUSB0' sudo sh -c "echo pwm_100 > $serial_port"

The deskpi.service should also be prevented from starting or it will override the manual start.

A permanent solution to this issue will be great.

yoyojacky commented 2 years ago

@bartlet7827 hi, Could you please check the current temperature of CPU when the fan is stopped?

bjs-pdx commented 2 years ago

I can tell you on my Pi the temp was between 71 and 74 degrees C when the fan was off.

bartlet7827 commented 2 years ago

@yoyojacky, I can't remember the exact temperature but it was definitely above one of the thresholds where it should have turned on. The stopping is consistently after about 18 minutes.

I have tried out the Python version and this seems to run indefinitely without a problem. Not sure if the Python version can be run as a service... will try it. The downside of this is of course is that the CPU runs hotter. My Pi was sitting at around 50C with no other apps running.

yoyojacky commented 2 years ago

@bartlet7827 Hi bro, It can be run as a service, you just need to write a systemd like file. for example: deskpi.service and adding the service information that you can refer to install.sh file it will create a systemd service by echo command. and I think it stop spinning just because of the temperature of CPU is lower than the threshold.

yoyojacky commented 2 years ago

@bartlet7827 BTW, you can check the /etc/deskpi.conf file and make sure the settings in the file is correctly in following format :

temp1
fan speed1 
temp2 
fan speed2
temp3
fan speed3
temp4
fan speed4

temp mean what temperature will trigger fan spinning at speed (PWM LEVEL)

bartlet7827 commented 2 years ago

The deskpi.conf file is in the correct format (generated by deskpi-config - option 6). I have not manually modified it.

There is definitely a problem with the service as it consistently stops after 18 minutes. Also as bjs-pdx noted, at 74C the fan does not switch on. Are the 32bit and 64bit versions identical (~/deskpi/drivers/c/pwmControlFan.c)

I will try running the Python version as a service. I have slightly modified it to check the temperature every 5 seconds which makes the Pi run cooler. I'm also directly checking /sys/class/thermal/thermal_zone0/temp rather than vcgencmd measure_temp.

yoyojacky commented 2 years ago

@bartlet7827 that souce code is working properly both at 32bit and 64bit version, and if you are using 64bit OS, you need make sure you have installed the pwmControlFan64 file to location /usr/bin/, and it stops after every 18 minutes??

bartlet7827 commented 2 years ago

@yoyojacky, yes, I can confirm that the correct binary was installed (by the installation script) in /usr/bin. I just did another test after starting the deskpi.service.

I ran the following commands: watch -n5 'sudo systemctl status deskpi.service && ps -ef | grep 5215 && vcgencmd measure_temp'

This was the output: Every 5.0s: sudo systemctl status deskpi.service && ps -ef | grep 5215 && vcgencmd measure_temp raspberrypi: Sat Mar 12 13:59:48 2022

● deskpi.service - DeskPi Fan Control Service Loaded: loaded (/lib/systemd/system/deskpi.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2022-03-12 13:42:19 AEDT; 17min ago Main PID: 5215 (pwmFanControl64) Tasks: 1 (limit: 4039) CPU: 345ms CGroup: /system.slice/deskpi.service └─5215 /usr/bin/pwmFanControl64 &

Mar 12 13:42:19 raspberrypi systemd[1]: Started DeskPi Fan Control Service. root 5215 1 0 13:42 ttyUSB0 00:00:00 /usr/bin/pwmFanControl64 &

temp=53.0'C

The fan stopped at around 18 minutes while the temperature was above 50 C. Something very strange is going on. Will try the python version as a service and report back.

bartlet7827 commented 2 years ago

Hi All, I was able to run the python fan control script successfully as a service by modifying deskpi.service:

[Unit] Description=DeskPi Fan Control Service After=multi-user.target [Service] Type=simple RemainAfterExit=no ExecStart=/home/pi/Python/MyCode/MyProdCode/pwmControlFan-mcb03.py & [Install] WantedBy=multi-user.target

The service has been running now for over 2.5 hours without a problem.

The original python script can be found in ~/deskpi/drivers/python. I'm running a slightly modified version. As mentioned in an earlier post I'm directly checking /sys/class/thermal/thermal_zone0/temp rather than vcgencmd measure_temp. I'm also reading the config file in /etc/deskpi.conf with defaults if the file doesn't exist.

juanpabloxk commented 2 years ago

Same problem here. I 'solved' it restarting the deskpi service each 15 minutes using crontab:

*/15 * * * * root systemctl restart deskpi
yoyojacky commented 2 years ago

以下是相关代码:


# Stop deskpi.service so that user can define the speed level.

sudo systemctl stop deskpi.service

. /lib/lsb/init-functions

# This is the serial port that connect to deskPi mainboard and it will

# communicate with Raspberry Pi and get the signal for fan speed adjusting.

serial_port='/dev/ttyUSB0'

 sudo sh -c "echo pwm_100 > $serial_port"

 log_action_msg "Fan speed level has been change to 100%"

桌面服务:


[Unit]

Description=DeskPi PWM Control Fan Service

After=multi-user.target

[Service]

Type=simple

RemainAfterExit=no

ExecStart=sudo /usr/bin/pwmFanControl

[Install]

WantedBy=multi-user.target

我注意到您的最后一行在 ExecStart 行的末尾没有 64。您正在运行 64 位 Bullseye Raspberry Pi OS 对吗?那个风扇控制是 32but 版本。我想知道这和它有什么关系吗?

64bit systems need to use 64-bit binaries to run more stable.

bobofruit1970 commented 2 years ago

Is there any progress? It still does not work. I am using 32-bit Raspbian. Using crontab to restart service every 15min is not a final solution to use a fan in DeskPI PRO case .

I can not use fan in this case with deskpi.service without workarounds.

  1. When I set auto pwm control (option 6 and 7) service stops after 18mins.
  2. When I set fixed speed it does not work after reboot. It switches to auto pwm control and then switches fan to off after 18mins.
bartlet7827 commented 2 years ago

@bobofruit1970, I don't think there has been any progress because the Deskpi team is not convinced there is a problem despite all the feedback to the contrary.

As per my previous post, I solved the problem by using the python version. The original python script from the Deskpi team is quite simple. I've modified it considerably. Here is my python script: pwmControlFan-mcb04.txt

Feel free to modify it to your needs. (Save it with a .py extension. I had to use a .txt extension to attach it here.)

Then modify /lib/systemd/system/deskpi.service to point to the python script (make a copy of the original of course). Here is what mine looks like:

Unit] Description=DeskPi Fan Control Service After=multi-user.target [Service] Type=simple RemainAfterExit=no ExecStart=/home/pi/Python/MyCode/MyProdCode/pwmControlFan-mcb04.py & [Install] WantedBy=multi-user.target

The fan control works for hours without a problem. You can check if the service is running with sudo systemctl status deskpi.service

bobofruit1970 commented 2 years ago

@bartlet7827, Thank You for Your modified script in Python. Until today I used @juanpabloxk method with restarting the deskpi.service each 15 minutes using crontab. It worked very well but this can not be final solution. No one knows when this original driver will be working. Today I moved to your method bartlet7827 with Python script.

Below You can see my temperatures of PI4. This picture is divided to thee stages:

  1. Method of juanpabloxk - auto restarting deskPi.service every 15min. => Fan works, Temp. is constant. Solution working.
  2. Original driver - deskpi.service must be manually restarted because fan stops after 18min. => Fan stops after 18min. Temp is rising and rising.
  3. Method of bartlet7827 - Python script. Fan works according to plan. Temperature is constant. Solution working. I am staying with it.

My Temp=>PWM ratio plan looks like this in /etc/deskpi.conf file 40 50 45 75 50 100 60 100

DeskPI Python driver works - V5

jojobrogess commented 2 years ago

@bartlet7827 , I don't think there has been any progress because the Deskpi team is not convinced there is a problem despite all the feedback to the contrary.

I feel your pain.

yoyojacky commented 2 years ago

@bartlet7827 , I don't think there has been any progress because the Deskpi team is not convinced there is a problem despite all the feedback to the contrary.

I feel your pain.

That is deeply pain, too many distributions need to follow and test and update .....

RadJKW commented 2 years ago

Is it possible for someone create a panel applet that shows the current fan speed % on the top panel of the raspberry pi? I may could attempt this. However, it would not be in the near future. I think this would be useful.

yoyojacky commented 2 years ago

Is it possible for someone create a panel applet that shows the current fan speed % on the top panel of the raspberry pi? I may could attempt this. However, it would not be in the near future. I think this would be useful.

seems like a widget ?

QiangGeCode commented 1 year ago

based on the good job done by @bartlet7827 , I further modified the python pwmControlFan-mcb04.py file to be able to log the fan mode changes in /home/pi/fan.log file. so you would be able to know the history of CPU temperature and mode changes for whatever purpose, get a bit more feeling of how your machine and fan works.

Note: if the fan mode hasn't been changed, it will not write any log, to keep log file small in size.

the log file will looks like this:

--------------------------------------------------------
2022-07-31 23:30:46, Deskpi Fan service started!
--------------------------------------------------------
2022-07-31 23:30:46, CPU Temp is 47°C, adjust fan to 25%
2022-07-31 23:30:51, CPU Temp is 50°C, adjust fan to 50%
2022-07-31 23:30:56, CPU Temp is 48°C, adjust fan to 25%

pwmControlFan-mcb04-log.py

bartlet7827 commented 1 year ago

Nice work @qianggecode! This will come in handy for my other RPi 4 deployed as a NAS. One suggestion would be to try and incorporate the date into the logfile name so that it is self-managing. Although initially the file size will be small it can get very large over time. You could overwrite the file on the 1st of every month or create a new file each month depending on how long you want to monitor for.

QiangGeCode commented 1 year ago

@bartlet7827 Thanks for the comments! For the file itself, I have considered to delete the file manually, then python scripts will create it automatically in next recording. It could be set to regularly delete the file by crontab.