1

Following tutorials I got a basic first step program working with the Pi Camera Module 3. Then needed to switch cameras to the Arducam x519, and now it terminates itself at the first line. I followed the instructions and I can open the camera preview from the command prompt, but trying to do it in Python isn't working.

Code

from picamera2 import Picamera2, Preview
import time
import numpy as np

print("0")
picam = Picamera2()

print("1")
picam.start_preview(Preview.QTGL)
print("2")
config = picam.create_preview_configuration()
print("3")
picam.configure(config)
print("4")

picam.start()
time.sleep(2)
#array = picam.capture_array("main")

#print(array)

picam.close()

Error

>>> %Run camtest1.py
0
[1:23:34.976388246] [3982]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
terminate called after throwing an instance of 'std::out_of_range'
  what():  unordered_map::at

Process ended with exit code -6.

I added the print statements to debug, and it's clearly failing at picam = Picamera2(), but searching google I've found nothing matching my problem.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.