Thanks, I followed the Jetson examples, but I still can’t get all four cameras to work. Camera A captures successfully, but every other GPIO combination fails.
Environment:
- Jetson Nano (i2c bus 1)
- Jetson.GPIO (RPi.GPIO compatibility)
- i2cset targeting 0x70
Here’s my script:
import RPi.GPIO as gp # sudo pip install Jetson.GPIO # https://pypi.org/project/Jetson.GPIO/#description
import os
import argparse
def parse_cmdline():
parser = argparse.ArgumentParser(description='Arducam Controller.')
parser.add_argument('-i', '--i2c-bus', type=int, nargs=None, required=True,
help='Set i2c bus, for Jetson Nano it is 1, for Jetson Xavier NX it is 8.')
return parser.parse_args()
gp.setwarnings(True)
gp.setmode(gp.BOARD)
gp.setup(7, gp.OUT)
gp.setup(11, gp.OUT)
gp.setup(12, gp.OUT)
def main(i2c_bus):
i2c = "i2cset -y {} 0x70 0x00 0x08".format(i2c_bus)
os.system(i2c)
gp.output(7, False)
gp.output(11, False)
gp.output(12, True)
capture(2)
def capture(cam):
#cmd = "raspistill -o capture_%d.jpg" % cam
cmd = "nvgstcapture-1.0 -A --capture-auto -S 0 --image-res=3 --file-name=capture_%d.jpg" % cam
os.system(cmd)
if __name__ == "__main__":
args = parse_cmdline()
print(args.i2c_bus)
main(args.i2c_bus)
Log for camera A (7 → False, 11 → False, 12 → True) — this one works:
Error: Write failed
Encoder null, cannot set bitrate!
Encoder Profile = High
nvbuf_utils: Could not get EGL display connection
bitrate = 4000000
Encoder Profile = High
Encoder control-rate = 1
Encoder EnableTwopassCBR = 0
Opening in BLOCKING MODE
** Message: 04:31:55.258: <main:4674> iterating capture loop ....
Starting automation...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 5
Output Stream W = 1280 H = 720
seconds to Run = 0
Frame Rate = 120.000005
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
Image Captured
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
** Message: 04:31:56.048: <main:4684> Capture completed
** Message: 04:31:56.049: <main:4733> Camera application will now exit
Log for another combination (7 → True, 11 → False, 12 → True) — this one fails:
Error: Write failed
Encoder null, cannot set bitrate!
Encoder Profile = High
nvbuf_utils: Could not get EGL display connection
bitrate = 4000000
Encoder Profile = High
Encoder control-rate = 1
Encoder EnableTwopassCBR = 0
Opening in BLOCKING MODE
** Message: 04:36:31.580: <main:4674> iterating capture loop ....
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
Starting automation...
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 5
Output Stream W = 1280 H = 720
seconds to Run = 0
Frame Rate = 120.000005
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...
CONSUMER: ERROR OCCURRED
Only camera A seems to work. Any idea what I’m doing wrong?