Login |  Register



Welcome
Welcome to engineeringdiy

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Rear parking camera and video grabber STK1160
PostPosted: Mon Nov 09, 2015 5:23 pm 
Joined: Tue Oct 06, 2015 3:01 pm
Posts: 122
I am working on my version of rear parking camera integration in my CarPC project, which I am working on for my school final work.
I have a big wish to use official Raspberry Pi touch LCD but it does not have an RCA input, so I decided I will use video grabber STK1160.

From the start I have some tips:
  1. It works really well on 2013-07-26-wheezy-raspbian, all of later raspbians have broken driver...
  2. Plug in video grabber when raspberry is off
  3. After boot go and type lsusb and see if stk1160 is listed correctly
  4. Then go and type ls /dev/video*, this command will give you video number
  5. After this you run these two commands to install mplayer: sudo apt-get update and sudo apt-get install mplayer
  6. When installation has finished you just run mplayer tv:// -tv device=/dev/video0 -reallyquiet and video must come through almost without delay
  7. If you see artefacts, you can overclock RPi to get rid of them.

This is an introduction, when I figure it out I will post how to integrate it into Kodi.

Greetings!


Report this post
Profile  Offline
 
 Post subject: Re: Rear parking camera and video grabber STK1160
PostPosted: Tue Sep 06, 2016 4:34 am 
Joined: Sun Aug 28, 2016 6:53 pm
Posts: 10
Hi,

Can you please provide me the complete image of your pi, I am also looking to implement rear camera using video grabber but unfortunately the latest CARPC image doesn't work with video grabber.


Report this post
Profile  Offline
 
 Post subject: Re: Rear parking camera and video grabber STK1160
PostPosted: Tue Oct 18, 2016 6:50 am 
Joined: Tue Oct 18, 2016 6:24 am
Posts: 2
Hi,
I came that far as well. If I go through NAVIT to the Desktop I can run my video feed with mplayer. What I like to do is connect my back up lights to the GPIO of my RPi3 to start the feed automatically. All the scripts are done. The only thing I can't do is put the mplayer over the KODI desktop or have it switched to an other XSession. Does any one came any further?

My set up is:
RPi3 with the CarPi image of Christian Brauweiler
LogiLink video grabber
Car Rover back up camera

My mplayer script is this:
Code:
#!/bin/sh
DISPLAY=:0
mplayer tv:// -tv driver=v4l2:norm=NTSC:width=628:height=586:outfmt=uyvy:device=/dev/video0:input=0:fps=25:noaudio -vo x11


I converted the shutdown script of Inderpreet Singh to read my back up light:
Code:

import RPi.GPIO as GPIO
import time
import os

   # Use the Broadcom SOC Pin numbers 
   # Setup the Pin with Internal pullups enabled and PIN in reading mode. 
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_UP)

    # Our function on what to do when the button is pressed
def BackUp(channel):
   os.system("sh /home/pi/mp.sh")

         # Add our function to execute when the button pressed event happens 
GPIO.add_event_detect(23, GPIO.FALLING, callback = BackUp, bouncetime = 2000)

          # Now wait! 
while 1:
    time.sleep(1)


THX

[edit]
The python-script is not working because the mplayer has to run as pi while the script runs as sudo. Does any know how to handle this problem?
[/edit]


Report this post
Profile  Offline
 
 Post subject: Re: Rear parking camera and video grabber STK1160
PostPosted: Thu Oct 20, 2016 6:18 pm 
Joined: Tue Oct 18, 2016 6:24 am
Posts: 2
Hi,
I finished my project. It's not perfect. I'm running a python script that calls two shell scripts as a subprocess. One script starts mplayer in full screen mode on top of navit, the other one is killing mplayer. The python script starts on boot and is triggered by a +3,3V signal on GPIO pin 23. The signal comes from my back up light. It triggers a delay circuit managed by a NE555 to have the mplayer stream running through the parking process. This signal runs through an optocoupler to switch 3,3V to GPIO pin 23.


Report this post
Profile  Offline
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests

Panel

Top You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Search for:
Jump to:  


suspicion-preferred