Go to advanced search

by mariusmilatz
Fri Oct 12, 2018 3:35 pm
Forum: General discussion
Topic: Raspivid filename (%04d.h264) not working
Replies: 1
Views: 302

Raspivid filename (%04d.h264) not working

Hi, I am trying to shoot multiple raspivid videos and don't want the raspberry pi to overwrite the video file. If i shoot 4 raspivid videos i would like 4 separate video files. Can anyone help me? my code at the moment is: import time import datetime import RPi.GPIO as GPIO import subprocess GPIO.se...
by mariusmilatz
Mon Sep 24, 2018 11:14 am
Forum: General discussion
Topic: Python script (read next command before previous command has finished)
Replies: 8
Views: 542

Re: Python script (read next command before previous command has finished)

inside the subprocess bracket or outside? option 1: subprocess.call(["raspivid", "-t", "600000”, "-ex", "auto", "-b", "17000000", "-o", "/home/pi/t1_'date+%d%m%Y_%H%M-%S'.h264"]&) option 2: subprocess.call([&quo...
by mariusmilatz
Mon Sep 24, 2018 10:37 am
Forum: General discussion
Topic: Python script (read next command before previous command has finished)
Replies: 8
Views: 542

Python script (read next command before previous command has finished)

Hi, I have a script the toggles the 'raspivid' command when rising edge happens and the 'pkill' command when falling edge happens. I am having problems that the script wants to first finish the 'raspivid' command before reading the next command which is to 'wait_for_edge'. The idea is to be able to ...
by mariusmilatz
Sun Aug 19, 2018 4:04 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

oscillating*
by mariusmilatz
Sun Aug 19, 2018 4:02 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

Do you know by any chance know how to create a hold button function in python. at the moment the trigger signal is slightly occulting and coursing the edge detection to go off unintentionally. the script that i am using: import datetime import RPi.GPIO as GPIO import subprocess GPIO.setmode(GPIO.BOA...
by mariusmilatz
Sun Aug 19, 2018 3:58 pm
Forum: General discussion
Topic: GPIO rising edge false positives.
Replies: 3
Views: 498

Re: GPIO rising edge false positives.

The signal trigger shouldn't be oscillating but the trigger is also connected to a motor which could cause signal noise. I have never used Pigpio before and don't really know what i am doing on Python either. can i use the same script that i have used in Python for Pigpio? Is there no 'hold timer' f...
by mariusmilatz
Sun Aug 19, 2018 1:28 pm
Forum: General discussion
Topic: GPIO rising edge false positives.
Replies: 3
Views: 498

GPIO rising edge false positives.

Hi, I have connected a Raspberry Pi zero w to an old video camera. I am trying to use the trigger on the camera to start and stop the video recording. When the trigger is pressed, the pin 37 goes from 3v to 0v. Unfortunately the RPi is reading a constant Rise and fall of the GPIO pin 37 so it consta...
by mariusmilatz
Fri Aug 17, 2018 3:02 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

Yes, i will try that.

Thanks anyway for helping me.

Big help.
by mariusmilatz
Fri Aug 17, 2018 1:30 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

Thanks. Now there is no error message.

For some reason the camera doesn't start recording when i press the trigger.

Do i have to import picamera to script?
by mariusmilatz
Fri Aug 17, 2018 1:09 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

the error was happening due to the spaces after the ',' signs. The error that i am now getting is: pi@raspberrypi:~ $ sudo python super8.py Traceback (most recent call last): File "super8.py", line 8, in <module> GPIO.setup(29,GPIO.IN,pull_up_down=GPIO.PUD.UP) AttributeError: 'module' obje...
by mariusmilatz
Fri Aug 17, 2018 12:44 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

The new code is import time import datetime import RPi.GPIO as GPIO import subprocess GPIO.setmode(GPIO.BOARD) GPIO.setup(29,GPIO.IN,pull_up_down=GPIO.PUD.UP) def startrecording(): subprocess.call(["raspivid", "-t", "600000", "-ex", "auto", "-b&...
by mariusmilatz
Fri Aug 17, 2018 12:05 pm
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

Just put the subprocess code into the script: import time import datetime import RPi.GPIO as GPIO import subprocess GPIO.setmode(GPIO.BOARD) GPIO.setup(29,GPIO.IN,pull_up_down=GPIO.PUD.UP) def startrecording() subprocess.call(["raspivid", "-t", "600000", "-ex"...
by mariusmilatz
Fri Aug 17, 2018 11:38 am
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

I am quite confused now. This is the code that i am using at the moment which gives me the 'Invalid Syntax' message. import time import datetime import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(29,GPIO.IN,pull_up_down=GPIO.PUD.UP) def startrecording() raspivid -t 600000 -ex auto -b 170000...
by mariusmilatz
Fri Aug 17, 2018 10:43 am
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Re: Python Script 'Invalid Syntax'

Do you mean instead of this:

while True:
GPIO.wait_for_edge(29,GPIO.FALLING)
startrecording()
GPIO.wait_for_edge(29,GPIO.RISING)
stoprecording()

Write this:

If true :
GPIO.wait_for_edge(29,GPIO.FALLING)
do_this startrecording()
GPIO.wait_for_edge(29,GPIO.RISING)
do_this stoprecording()
by mariusmilatz
Fri Aug 17, 2018 9:55 am
Forum: Python
Topic: Python Script 'Invalid Syntax'
Replies: 18
Views: 2897

Python Script 'Invalid Syntax'

Hi, I am not very familiar with any of raspberry pi product or the scripts used to program them. The result i am trying to accomplish: - I am trying to create a camera with a trigger switch for recording. (when trigger pressed the camera records, when released the camera stops recording). - Trigger ...
by mariusmilatz
Mon Aug 06, 2018 11:34 am
Forum: Other projects
Topic: Connecting ON/Off switch and Trigger from camera to (Pi Zero W)
Replies: 2
Views: 546

Connecting ON/Off switch and Trigger from camera to (Pi Zero W)

Hi, I am trying to convert a Film camera to digital. I have already built the image sensor into the camera and tested it for video. 1. I am trying to connect the camera switch to the Raspberry Pi Zero W so when the camera is switched on and off the Raspberry pi also turns on and off. 2. when the tri...

Go to advanced search