APM and Raspberry Pi camera

Hi,
We’re trying to accomplish something like that:
We have a GoPro camera with WiFi hot spot opened and a raspberry pi connected to it via WiFi adapter.
We want to instruct the RPi when to send an HTTP request to have the GoPro take a single picture.

We have all that running, but we can’t figure out how to have the APM communicate with the RPi to trigger that action.

We want to use the DO_DIGICAM in our mission planner, which to our understanding outputs HIGH to one of the APM’s GPIO.

Is it possible to connect the APM and RPi straight out by their GPIOs? (via logic converter)
Are there any other solutions you can come up with?

Thanks,
Carmel

1 Like

I can’t help on the raspberry pi. But I strong recommend you don’t use any 2.4 WiFi if you are using 2.4 rc equipment. Many stories of people crashing when using gopro WiFi and 2.4 rc.

sent from my phone so apologies for any typos

Connect the APM`s camera shutter RC10 (default) to an RPi GPIO.
NOTE: there is a voltage issue (APM 5V v RPi 3.3V)*
Configure Mission Planner camera shutter.
Set RPi to fire an event when GPIO goes HIGH.

Below code is for firing the RPi Noir along with an IR cut switcher, to get “Normal” and IR pictures in sequence, This code is used for agricultural orthophotography using UAVs (drones). You can test this on a breadboard. Invert connect the switcher on pins 16 and 20 (to position as with and without IR cut). You can still fire the GoPro at will. : )

from time import sleep
import RPi.GPIO as GPIO
print("BEGIN!")
var=1
counter = 0
gpio_pin_in = 21
gpio_pin_camera = 20
gpio_pin_switcher_IR = 16
gpio_pin_switcher_normal = 12

GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio_pin_in, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(gpio_pin_camera, GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(gpio_pin_switcher_IR, GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(gpio_pin_switcher_normal, GPIO.OUT, initial=GPIO.LOW)

def fire_away():
    print("camera IR")
    GPIO.output(gpio_pin_camera, GPIO.HIGH)
    sleep(0.5)
    GPIO.output(gpio_pin_camera, GPIO.LOW)
    print("switcherNormal")
    GPIO.output(gpio_pin_switcher_IR, GPIO.HIGH)
    sleep(0.5)
    GPIO.output(gpio_pin_switcher_IR, GPIO.LOW)
    print("camera Normal")
    GPIO.output(gpio_pin_camera, GPIO.HIGH)
    sleep(0.5)
    GPIO.output(gpio_pin_camera, GPIO.LOW)
    print("switcherIR")
    GPIO.output(gpio_pin_switcher_normal, GPIO.HIGH)
    sleep(0.5)
    GPIO.output(gpio_pin_switcher_normal, GPIO.LOW)
    print("shotsOK\n")
    sleep(2)
while True:
    if GPIO.input(gpio_pin_in):
        print("call camera")
        fire_away()
  • I use a simple step down circuit with two resistors of 1K as R1 and 2.2K as R2 (you get a final current of just under 3.4V, which is safe for the RPi). Read this tutorial