I have a FLIR Lepton conected to a raspberry pi 5. I nned to start it from a python file.
I followed the groupgets github page to start the camera.
cd into /LeptonModule/software/raspberrypi_video.
Then run:
- qmake && make,
- sudo sh -c “echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor”
- ./raspberrypi_video -tl 3
And it Works fine. So I went and read a little about subprocess and whatnot and wrote up a simple script, and I simply do not understand why it is not working:
import subprocess
import os
def start_camera():
directory = '/LeptonModule/software/raspberrypi_video'
command = 'qmake && make'
command1 = 'sudo sh -c "echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"'
command2 = './raspberrypi_video -tl 3'
os.chdir(directory)
process = subprocess.run(command, shell=True, check=True)
process1 = subprocess.run(command1, shell=True, check=True)
process2 = subprocess.run(command1, shell=True, check=True)
print("Camera Started")
if __name__ == "__main__":
start_camera()
When I run the file, it simply exits witth code 0. The camera window does not pop up, nothing else pops up. What amI doing Wrong?