Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1225

Python • Re: Issue with 2 python scripts running simultaneously

$
0
0
I have no clue why this happens, maybe the pCloud library, or another library used by it, is somehow accessing GPIO which causes an event. It may also be something electrical, a minor voltage drop in the sensor or something so maybe a stabilizing capacitor is required somewhere.

As I understand, the false positive happens during upload and even though this is not ideal, you could have a temporary file indicate that there is an upload in progress which allows you to ignore any motion detected during upload.

1) Create empty file named "/dev/shm/motion-upload.txt"
2) Upload the motion file
3) Delete file named "/dev/shm/motion-upload.txt"

When a motion is detected, you test if "/dev/shm/motion-upload.txt" exists and if it does, you do not react to the first detected motion.

"/dev/shm" is shared memory, so the temporary file is created in memory only and thus it does not survive a reboot and it does not cause any disk writes.

Statistics: Posted by NotRequired — Thu Apr 25, 2024 9:57 am



Viewing all articles
Browse latest Browse all 1225

Trending Articles