GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 2:31 am

I'm new to python and the gpio, I'm trying to take a script converted for an A+ to work with my zero, I just can't get it to register a button press. I've checked the gpio is receiving a connection through the gpio readout and that seems fine, but looking at the python script Picamcorder.py I really can't make sense of why it's set to gpio 33 and 35. Can anyone give me some pointers, am just hacking away at this point, but I'm sure it's the gpio numbers that is the issue.

Code: Select all

#!/usr/bin/env python2.7
# script by Alex Eames http://RasPi.tv
# needs RPi.GPIO 0.5.2 or later
# updated to work on the A+

import RPi.GPIO as GPIO
from subprocess import call
import subprocess
from time import sleep
import time
import sys
import os

front_led_status = sys.argv[-1]
if front_led_status == "0":
    print "front LED off"
    front_led_status = 0

GPIO.setmode(GPIO.BOARD)

# GPIO 33 & 25 set up as input, pulled up to avoid false detection.
# Both ports are wired to connect to GND on button press.
# So we'll be setting up falling edge detection for both
GPIO.setup(33, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)

# GPIO 35 set up as an input, pulled down, connected to 3V3 on button press
GPIO.setup(35, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

# Set up GPIO 5 for camera LED control and rear LED control
GPIO.setup(5, GPIO.OUT)
GPIO.setup(22, GPIO.OUT)

recording = 0
vid_rec_num = "vid_rec_num.txt"   
vid_rec_num_fp ="/home/pi/vid_rec_num.txt" # need full path if run from rc.local
base_vidfile = "raspivid -t 3600000 -o /home/pi/video"
time_off = time.time()

def write_rec_num():
    vrnw = open(vid_rec_num_fp, 'w')
    vrnw.write(str(rec_num))
    vrnw.close()

def start_recording(rec_num):
    global recording
    if recording == 0:
        vidfile = base_vidfile + str(rec_num).zfill(5)
        vidfile += ".h264  -fps 25 -b 15000000 -vs" #-w 1280 -h 720 -awb tungsten
        print "starting recording\n%s" % vidfile
        time_now = time.time()
        if (time_now - time_off) >= 0.3:
            if front_led_status != 0:
                GPIO.output(5, 1)
            GPIO.output(22, 1)
            recording = 1
            call ([vidfile], shell=True)
    recording = 0 # only kicks in if the video runs the full period

#### Quality VS length ###
# on long clips at max quality you may get dropouts
# -w 1280 -h 720 -fps 25 -b 3000000 
# seems to be low enough to avoid this 

def stop_recording():
    global recording
    global time_off
    time_off = time.time()
    print "stopping recording"
    GPIO.output(5, 0)
    GPIO.output(22, 0)
    call (["pkill raspivid"], shell=True)
    recording = 0
    space_used()     # display space left on recording drive

def space_used():    # function to display space left on recording device
    output_df = subprocess.Popen(["df", "-Ph", "/dev/root"], stdout=subprocess.PIPE).communicate()[0]
    it_num = 0
    for line in output_df.split("\n"):
        line_list = line.split()
        if it_num == 1:
            storage = line_list
        it_num += 1
    print "Card size: %s,   Used: %s,    Available: %s,    Percent used: %s" % (storage[1], storage[2], storage[3], storage[4])
    percent_used = int(storage[4][0:-1])
    if percent_used > 95:
        print "Watch out, you've got less than 5% space left on your SD card!"

# threaded callback function runs in another thread when event is detected
# this increments variable rec_num for filename and starts recording
def my_callback2(channel):
    global rec_num
    time_now = time.time()
    if (time_now - time_off) >= 0.3:
        print "record button pressed"
        rec_num += 1
        if recording == 0:
            write_rec_num()
            start_recording(rec_num)

def flash(interval,reps):
    for i in range(reps):
        GPIO.output(5, 1)
        GPIO.output(22, 1)
        sleep(interval)
        GPIO.output(5, 0)
        GPIO.output(22, 0)
        sleep(interval)

def shutdown():
    print "shutting down now"
    stop_recording()
    flash(0.05,50)
    GPIO.cleanup()
    os.system("sudo halt")
    sys.exit()

print "Make sure you have a button connected so that when pressed"
print "it will connect GPIO port 33 (pin 16) to GND (pin 6)\n"
print "You will also need a second button connected so that when pressed"
print "it will connect GPIO port 35 (pin 18) to 3V3 (pin 1)\n"
#print "You will also need a third button connected so that when pressed"
#print "it will connect GPIO port 25 (pin 22) to GND\n"

# optional for when you're at the terminal
#raw_input("Press Enter when ready\n>")

# when a falling edge is detected on port 33 my_callback2() will be run
GPIO.add_event_detect(33, GPIO.FALLING, callback=my_callback2)

# when a falling edge is detected on port 25, my_callback() will be run
#GPIO.add_event_detect(25, GPIO.FALLING, callback=my_callback, bouncetime=500)

# check rec_num from file
try:
    directory_data = os.listdir("/home/pi")
    if vid_rec_num in directory_data:

        # read file vid_rec_num, make into int() set rec_num equal to it
        vrn = open(vid_rec_num_fp, 'r')
        rec_num = int(vrn.readline())
        print "rec_num is %d" % rec_num
        vrn.close() 

    # if file doesn't exist, create it to avoid issues later
    else:
        rec_num = 0
        write_rec_num()

except:
    print("Problem listing /home/pi")
    flash(0.1,10)
    GPIO.cleanup()
    sys.exit()

try:
    while True:
        # this will run until button attached to 35 is pressed, then 
        # if pressed long, shut program, if pressed very long shutdown Pi
        # stop recording and shutdown gracefully
        print "Waiting for button press" # rising edge on port 35
        GPIO.wait_for_edge(35, GPIO.RISING)
        print "Stop button pressed"
        stop_recording()

        # poll GPIO 35 button at 20 Hz continuously for 3 seconds
        # if at the end of that time button is still pressed, shut down
        # if it's released at all, break
        for i in range(60):
            if not GPIO.input(35):
                break
            sleep(0.05)

        if 25 <= i < 58:              # if released between 1.25 & 3s close prog
            print "Closing program"
            flash(0.02,50) # interval,reps
            GPIO.cleanup()
            sys.exit()

        if GPIO.input(35):
            if i >= 59:
                shutdown()

except KeyboardInterrupt:
    stop_recording()
    GPIO.cleanup()       # clean up GPIO on CTRL+C exit
Last edited by GrizzlyRizzo on Mon Apr 03, 2017 9:20 am, edited 1 time in total.

scotty101
Posts: 3805
Joined: Fri Jun 08, 2012 6:03 pm

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 8:46 am

a. Post your code inside tags so that we can clearly read it.
b. Post any error messages
c. Check how your buttons are wired. https://pinout.xyz/ says that GPIO 33 and 35 are not available on any version of the pi's standard 40 pin headers.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 9:02 am

Post by scotty101 » Mon Apr 03, 2017 8:46 am

a. Post your code inside tags so that we can clearly read it.
b. Post any error messages
c. Check how your buttons are wired. https://pinout.xyz/ says that GPIO 33 and 35 are not available on any version of the pi's standard 40 pin headers.
B. No errors messages other than channels all ready in use, using anyway. And gpio not available error.

C. Pin numbers are the issue I've identified............. I've try rotating through some other gpios and changing both the code and the wiring to correspond.

Could anyone tell me if the code is sound, other than the gpio numbers issue, so I can work the problem?

http://www.cya.nyc/2015/04/raspberry-pi-action-camera/


This is what I'm working from.
I'm not using anything other than two switches a Pi cam and an LED, I've put in the auto start script from the original script for the model A and that works fine.
Last edited by GrizzlyRizzo on Mon Apr 03, 2017 9:43 am, edited 2 times in total.

User avatar
davidcoton
Posts: 4541
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 9:03 am

scotty101 wrote:a. Post your code inside tags so that we can clearly read it.
The easiest way to do that is to edit your post above.
b. Post any error messages
Agreed.
c. Check how your buttons are wired. https://pinout.xyz/ says that GPIO 33 and 35 are not available on any version of the pi's standard 40 pin headers.
In Board mode these pins are available as GPIOs.
Signature retired

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 9:35 am

davidcoton wrote: The easiest way to do that is to edit your post above
Thanks for the pointers on forum etiquette, I've never been able to work these things out.

User avatar
davidcoton
Posts: 4541
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 10:12 am

Okay, for the GPIO numbering.There are two schemes, BOARD and BCM. Board uses the physical pin numbers, BCM uses the GPIO names. Strangely it is usually better to work with BCM -- it "just works" more often.
Set your mode, then declare some constants (in Python these look like variables,except you only assign a value once) to represent each I/O function, and assign GPIO numbers. Use these constants through the rest of the code. So you might have:

Code: Select all

GPIO.setmode(GPIO.BCM)
redled = 5
greenled = 25
switch = 19

GPIO.setup(switch, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(redled, GPIO.OUT)
GPIO.setup(greenled, GPIO.OUT)
As to the quality of the code, Alex Eames is a reputable coder and often posts here. If you have a problem with the original code, you could PM him and ask him to read this topic.
Signature retired

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 10:43 am

davidcoton wrote:Okay, for the GPIO numbering.There are two schemes, BOARD and BCM. Board uses the physical pin numbers, BCM uses the GPIO names. Strangely it is usually better to work with BCM -- it "just works" more often.
Set your mode, then declare some constants (in Python these look like variables,except you only assign a value once) to represent each I/O function, and assign GPIO numbers. Use these constants through the rest of the code. So you might have:

Code: Select all

GPIO.setmode(GPIO.BCM)
redled = 5
greenled = 25
switch = 19

GPIO.setup(switch, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(redled, GPIO.OUT)
GPIO.setup(greenled, GPIO.OUT)
As to the quality of the code, Alex Eames is a reputable coder and often posts here. If you have a problem with the original code, you could PM him and ask him to read this topic.
Thanks for that, making major changes to the code is beyond my skill set, the code is as I found it, I'm just some guy with a drone trying to save cost and weight from not using a GoPro, and write a really simple build guide for other hobbyists that don't have hundreds to spend.

I will contact the author and see if he would be happy to update the code for this purpose.

Many Thanks.

User avatar
davidcoton
Posts: 4541
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 11:01 am

GrizzlyRizzo wrote:write a really simple build guide for other hobbyists
I appreciate your aim, but in order to write a good guide you need to understand the code.
If your name is on the guide, you will get questions.
So you need to learn enough about Python to understand what you have got, and modify it yourself.
This, after all, is why we have Pi.
Signature retired

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Mon Apr 03, 2017 12:06 pm

davidcoton wrote:
GrizzlyRizzo wrote:write a really simple build guide for other hobbyists
I appreciate your aim, but in order to write a good guide you need to understand the code.
If your name is on the guide, you will get questions.
So you need to learn enough about Python to understand what you have got, and modify it yourself.
This, after all, is why we have Pi.
In part I agree, but it would not be a coding guide, just a solder this add the script file here and have fun flying.

I like a lot of people out there just want to get in the air, I'm making progress and have learn all about PID tuning and all the other bits and bobs that can be avoided by just buying a pre built aircraft, I just want to get it working for the guy that doesn't know how to code but can follow a step by step guide, these guys aren't going to ask code questions, but knowing that they can use a Pi and get that first introduction it could open them up to learning more.

The past few years have seen the hobby open up to so many flyers with the introduction of flight controllers like the naze32, day of old required a full knowledge of how to build it yourself with an arduino, and I'm sure many frustrated flyers just gave up after many hours of trying to understand code.

I'm sure as a coder this is not what you want to hear but you don't build a kit car before you've driven one and know what you aiming for.

I don't feel I have the right to try and hash together a sub standard script going off the back of the project that Alex Eames put together for the model A.

Here is a case in it's infancy that I've designed for the build.
And here is a prototype case I threw together for the build but am thinking I'll do two other orientations for a greater range of applications.


http://www.thingiverse.com/thing:2101395

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Wed Apr 05, 2017 5:11 pm

After tinkering about i have a working modification of the original script, i add again than i am in no way a coder.

This script was modified to work with a Pi Zero v1.3 and the Pi Camera v2.1

LED 1 is physically wired to pin 30 for GND and pin 36 (GPIO 16)

LED 2 is physically wired to pin 39 for GND and pin 38 (GPIO 20)

Switch 1 (Start) is physically wired to pin 14 for GND and pin 15 (GPIO 22)

Switch 2 (Stop and shutdown over 5 seconds held) is physically wired to pin 40 (GPIO 21) and pin 1 (3.3v)

The board has been chopped down to fit into a ZMR250 quadcopter frame and is power by the power distribution board. And the camera has been housed inside a Foxeer Arrow v2 FPV camera case.

Code: Select all

#!/usr/bin/env python2.7
# script by Alex Eames http://RasPi.tv
# needs RPi.GPIO 0.5.2 or later
# updated to work on the A+
# updated from A+ update to work with Zero v1.3 by Paul Morris (GrizzlyRizzo) unfinished yet to be cleaned up

import RPi.GPIO as GPIO
from subprocess import call
import subprocess
from time import sleep
import time
import sys
import os

front_led_status = sys.argv[-1]
if front_led_status == "0":
    print "front LED off"
    front_led_status = 0

GPIO.setmode(GPIO.BCM)

front_led_status == "0"

# GPIO 33 & 25 set up as input, pulled up to avoid false detection.
# Both ports are wired to connect to GND on button press.
# So we'll be setting up falling edge detection for both
GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)

# GPIO 35 set up as an input, pulled down, connected to 3V3 on button press
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

# Set up GPIO 5 for camera LED control and rear LED control
GPIO.setup(16, GPIO.OUT)
GPIO.setup(20, GPIO.OUT)

recording = 0
vid_rec_num = "vid_rec_num.txt"   
vid_rec_num_fp ="/home/pi/vid_rec_num.txt" # need full path if run from rc.local
base_vidfile = "raspivid -t 3600000 -o /home/pi/video"
time_off = time.time()

def write_rec_num():
    vrnw = open(vid_rec_num_fp, 'w')
    vrnw.write(str(rec_num))
    vrnw.close()

def start_recording(rec_num):
    global recording
    if recording == 0:
        vidfile = base_vidfile + str(rec_num).zfill(5)
        vidfile += ".h264  -fps 25 -b 15000000 -vs" #-w 1280 -h 720 -awb tungsten
        print "starting recording\n%s" % vidfile
        time_now = time.time()
        if (time_now - time_off) >= 0.3:
            if front_led_status != 0:
                GPIO.output(16, 1)
            GPIO.output(20, 1)
            recording = 1
            call ([vidfile], shell=True)
    recording = 0 # only kicks in if the video runs the full period

#### Quality VS length ###
# on long clips at max quality you may get dropouts
# -w 1280 -h 720 -fps 25 -b 3000000 
# seems to be low enough to avoid this 

def stop_recording():
    global recording
    global time_off
    time_off = time.time()
    print "stopping recording"
    GPIO.output(16, 0)
    GPIO.output(20, 0)
    call (["pkill raspivid"], shell=True)
    recording = 0
    space_used()     # display space left on recording drive

def space_used():    # function to display space left on recording device
    output_df = subprocess.Popen(["df", "-Ph", "/root"], stdout=subprocess.PIPE).communicate()[0]
    it_num = 0
    for line in output_df.split("\n"):
        line_list = line.split()
        if it_num == 1:
            storage = line_list
        it_num += 1
    print "Card size: %s,   Used: %s,    Available: %s,    Percent used: %s" % (storage[1], storage[2], storage[3], storage[4])
    percent_used = int(storage[4][0:-1])
    if percent_used > 95:
        print "Watch out, you've got less than 5% space left on your SD card!"

# threaded callback function runs in another thread when event is detected
# this increments variable rec_num for filename and starts recording
def my_callback2(channel):
    global rec_num
    time_now = time.time()
    if (time_now - time_off) >= 0.3:
        print "record button pressed"
        rec_num += 1
        if recording == 0:
            write_rec_num()
            start_recording(rec_num)

def flash(interval,reps):
    for i in range(reps):
        GPIO.output(16, 1)
        GPIO.output(20, 1)
        sleep(interval)
        GPIO.output(16, 0)
        GPIO.output(20, 0)
        sleep(interval)

def shutdown():
    print "shutting down now"
    stop_recording()
    flash(0.05,50)
    GPIO.cleanup()
    os.system("sudo poweroff")
    sys.exit()

print "Make sure you have a button connected so that when pressed"
print "it will connect GPIO port 33 (pin 16) to GND (pin 6)\n"
print "You will also need a second button connected so that when pressed"
print "it will connect GPIO port 35 (pin 18) to 3V3 (pin 1)\n"
#print "You will also need a third button connected so that when pressed"
#print "it will connect GPIO port 25 (pin 22) to GND\n"

# optional for when you're at the terminal
#raw_input("Press Enter when ready\n>")

# when a falling edge is detected on port 33 my_callback2() will be run
GPIO.add_event_detect(22, GPIO.FALLING, callback=my_callback2)

# when a falling edge is detected on port 25, my_callback() will be run
#GPIO.add_event_detect(25, GPIO.FALLING, callback=my_callback, bouncetime=500)

# check rec_num from file
try:
    directory_data = os.listdir("/home/pi")
    if vid_rec_num in directory_data:

        # read file vid_rec_num, make into int() set rec_num equal to it
        vrn = open(vid_rec_num_fp, 'r')
        rec_num = int(vrn.readline())
        print "rec_num is %d" % rec_num
        vrn.close() 

    # if file doesn't exist, create it to avoid issues later
    else:
        rec_num = 0
        write_rec_num()

except:
    print("Problem listing /home/pi")
    flash(0.1,10)
    GPIO.cleanup()
    sys.exit()

try:
    while True:
        # this will run until button attached to 35 is pressed, then 
        # if pressed long, shut program, if pressed very long shutdown Pi
        # stop recording and shutdown gracefully
        print "Waiting for button press" # rising edge on port 35
        GPIO.wait_for_edge(21, GPIO.RISING)
        print "Stop button pressed"
        stop_recording()

        # poll GPIO 35 button at 20 Hz continuously for 3 seconds
        # if at the end of that time button is still pressed, shut down
        # if it's released at all, break
        for i in range(60):
            if not GPIO.input(21):
                break
            sleep(0.05)

        if 25 <= i < 58:              # if released between 1.25 & 3s close prog
            print "Closing program"
            flash(0.02,50) # interval,reps
            GPIO.cleanup()
            sys.exit()

        if GPIO.input(21):
            if i >= 59:
                shutdown()

except KeyboardInterrupt:
    stop_recording()
    GPIO.cleanup()       # clean up GPIO on CTRL+C exit


User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Getting Pi camcorder to work with Zero gpio

Wed Apr 05, 2017 8:03 pm

I don't know where you got the code from, but the original code on Github, which is unchanged for 4 years uses BCM and not BOARD.

I never use BOARD in my code. Someone else has broken it for you. I don't think much of that :shock:

Code: Select all

#!/usr/bin/env python2.7
# script by Alex Eames http://RasPi.tv
# needs RPi.GPIO 0.5.2 or later
# No guarantees. No responsibility accepted. It works for me.
# If you need help with it, sorry I haven't got time. I'll try and add more
# documentation as time goes by. But no promises.

import RPi.GPIO as GPIO
from subprocess import call
import subprocess
from time import sleep
import time
import sys
import os

front_led_status = sys.argv[-1]
if front_led_status == "0":
    print "front LED off"
    front_led_status = 0

GPIO.setmode(GPIO.BCM)

I'd also like to point out that if the person who copied and broke this script had adhered to the legally binding license conditions, you would have known exactly where to look for the original source code...

Code: Select all

This Readme contains basic info about the RasPiCamcorder 2
by Alex Eames of RasPi.TV

=============================
Released under the Creative Commons Attribution 3.0 Unported (CC BY 3.0)
http://creativecommons.org/licenses/by/3.0/

You may do whatever your like with this software. If you release a derivative
it must contain at or near the top of the documentation...

"Based on RasPiCamcorder scripts by Alex Eames of http://RasPi.TV/
https://github.com/raspitv/RasPiCamcorder/"

That is your ONLY obligation.
=============================
Alex Eames RasPi.TV, RasP.iO

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Wed Apr 05, 2017 9:07 pm

alexeames wrote:I don't know where you got the code from, but the original code on Github, which is unchanged for 4 years uses BCM and not BOARD.

I never use BOARD in my code. Someone else has broken it for you. I don't think much of that :shock:

Code: Select all

#!/usr/bin/env python2.7
# script by Alex Eames http://RasPi.tv
# needs RPi.GPIO 0.5.2 or later
# No guarantees. No responsibility accepted. It works for me.
# If you need help with it, sorry I haven't got time. I'll try and add more
# documentation as time goes by. But no promises.

import RPi.GPIO as GPIO
from subprocess import call
import subprocess
from time import sleep
import time
import sys
import os

front_led_status = sys.argv[-1]
if front_led_status == "0":
    print "front LED off"
    front_led_status = 0

GPIO.setmode(GPIO.BCM)

I'd also like to point out that if the person who copied and broke this script had adhered to the legally binding license conditions, you would have known exactly where to look for the original source code...

Code: Select all

This Readme contains basic info about the RasPiCamcorder 2
by Alex Eames of RasPi.TV

=============================
Released under the Creative Commons Attribution 3.0 Unported (CC BY 3.0)
http://creativecommons.org/licenses/by/3.0/

You may do whatever your like with this software. If you release a derivative
it must contain at or near the top of the documentation...

"Based on RasPiCamcorder scripts by Alex Eames of http://RasPi.TV/
https://github.com/raspitv/RasPiCamcorder/"

That is your ONLY obligation.
=============================
Thanks for the pointers, I had seen your original but as I don't know what the difference is programming wise between the A and A+ gpio setup is, I thought I'd have a better chance of success with the very little knowledge of code I have.

Thankyou for doing the original project, if all goes well I'll have a step by step guide put together in the near future, enabling rc enthusiasts to benefit from a cheap alternative action cam.

This was the source, I do not want to get anyone in trouble.

https://github.com/cyamada/picam


http://www.cya.nyc/2015/04/raspberry-p ... n-camera/

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Getting Pi camcorder to work with Zero gpio

Wed Apr 05, 2017 9:35 pm

GrizzlyRizzo wrote: Thanks for the pointers, I had seen your original but as I don't know what the difference is programming wise between the A and A+ gpio setup is, I thought I'd have a better chance of success with the very little knowledge of code I have.

Thankyou for doing the original project, if all goes well I'll have a step by step guide put together in the near future, enabling rc enthusiasts to benefit from a cheap alternative action cam.

This was the source, I do not want to get anyone in trouble.

https://github.com/cyamada/picam
http://www.cya.nyc/2015/04/raspberry-pi-action-camera/
It's OK - nobody is in trouble. I just wanted to point out the importance of software licensing. You see - in your original post, your broken software has my name in it. If there was a link to what I actually wrote or where YOU sourced it from, we could all find the missing pieces of the puzzle.

I think someone updated it for the A+ because on the original Pi and Pi camera, GPIO5 was used for the camera LED. I think this changed when the Pi went to 40 pins. But my scripts pre-date that.

Don't get me wrong - I love that people use my code. But it's very important if you copy code to show the world where you got it from. I borrow code from other people all the time. It's not a shameful thing - it saves a lot of time. But if you quote your exact source, people will know. Also, some code is NC (non-commercial) or has other conditions attached to it. Be sure to abide by them or you could get into trouble. :D
Alex Eames RasPi.TV, RasP.iO

GrizzlyRizzo
Posts: 10
Joined: Wed Mar 15, 2017 10:25 pm

Re: Getting Pi camcorder to work with Zero gpio

Wed Apr 05, 2017 10:02 pm

alexeames wrote: It's OK - nobody is in trouble. I just wanted to point out the importance of software licensing. You see - in your original post, your broken software has my name in it. If there was a link to what I actually wrote or where YOU sourced it from, we could all find the missing pieces of the puzzle.

I think someone updated it for the A+ because on the original Pi and Pi camera, GPIO5 was used for the camera LED. I think this changed when the Pi went to 40 pins. But my scripts pre-date that.

Don't get me wrong - I love that people use my code. But it's very important if you copy code to show the world where you got it from. I borrow code from other people all the time. It's not a shameful thing - it saves a lot of time. But if you quote your exact source, people will know. Also, some code is NC (non-commercial) or has other conditions attached to it. Be sure to abide by them or you could get into trouble. :D
Good to know.

My intended guide will have references for all parties involved at each stage, this has been my intention from the beginning.

Just checked and the guy who posted the broken code did reference you, just not with the full bells and whistles in the git folder i got it from but in another he did the whole shebang.

https://github.com/cyamada/picam

https://github.com/cyamada/RasPiCamcorder

I also referenced the source of the broken code in my second post, as i said I've always had issues with forums, so many boxes to tick, no wonder my My Space page looked so bad. :?

Return to “General discussion”