OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

FLIR Lepton on RaspBerry Pi 5

  • Thread starter Thread starter EvanFodemski
  • Start date Start date
E

EvanFodemski

Guest
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:

Code:
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?
<p>I have a FLIR Lepton conected to a raspberry pi 5. I nned to start it from a python file.</p>
<p>I followed the groupgets github page to start the camera.
cd into /LeptonModule/software/raspberrypi_video.
Then run:</p>
<ul>
<li>qmake && make,</li>
<li>sudo sh -c "echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"</li>
<li>./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:</li>
</ul>
<pre><code>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()
</code></pre>
<p>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?</p>
 

Latest posts

Top