I want to use the RPi-Cam-Web-Interface to control/view via a wlan connection.
RPi-Cam-Web-Interface show the mindsensors.com servoblaster version and I would like to use the Pmoroni/Adafruit Servo sontroller, when that is running a new project with a stronger PWM Pan/tilt Hardware to mount the camera,Ultasonic distance,IR and other sensors
Question: How does one integrate adafruit pwm controller(s) in the .RPi-Cam-Web-Interface.?
Do you have a more powerful Pan/tilt?
For the first project you Pan/tilr will be OK.
BUT I want to replace the servoblaster lib. with the adafruit lib.
and it is this aspect I am unsure about. the Rpi-web-cam only deals with
the version.
You mention that the SW may be dying - is there an alternative I am missing?
If the RPI is here to stay, when I get time, I’ll try to integrate the
adafruit or any
pan/tilt to the system - again when I get time!
I’ve seen several people on Twitter making interfaces for PanTilt HAT which might be a better choice. It’s not a difficult thing to accomplish in Python and Flask and is perhaps an example I should put together.
The camera in the link is like $150 !!! its $30 for a v2.1 cam and a Pi Zero and depending on how you connect wifi / ethernet its a dongle or go usb and set the zero up a an ethernet gadget
2x Pi Zero could so all the preprocessing and stream to a Pi3 and get power and ethernet over usb.
Not sure why you want a stronger pan/tilt mech (big lens?) all the main stream pan tilt mechs I have seen as still direct drive and its the servo.
I think you can swap out the towerpro SG 90 for MG 90 which have metal gears.
It’s possible to stream to the web, too, which can then just be included in a good old iFrame. I can’t remember how I did that though and I don’t have a Pi Camera at home!
Is this GPIO Zero’s remote GPIO features? I’ve honestly never tried it, or even looked at it! Might be worthy of another forum thread, though, since some other folks around here might be more familiar with it than me.
Its part of the desktop raspi-config remote gpio enable on boot or not, part from that I really don’t know and have been trying to find out.
Its not in the command line one but starts a daemon that apparently can be accessed remotely… ?
Thank you all for your suggestions.
But at he moment I am interested primarily in the linux web-cam software since it is
in use on another web cam project.So I would like to maintain compatibility.
I need to control the Camera Pan/Tilt while viewing, and the web-cam SW does that
quite well.
I will need to learn PHP and More HTML then can change the SW myself.
I could then post the changes to pimoroni and raspberrypi.org
BUT , at a first glance , that PiVision looks interest and I’ll certainly try it out, I didn’t find
and hooks for Pan/tilt control.
Thanks again and I really like the PanTilt Hat…well done!
It isn’t too hard to use the Pimoroni Pan/Tilt Python library with the RPi-Cam.
Install the Pimoroni Pan/Tilt library per the instructions here (and test basic operation using one of the examples): https://github.com/pimoroni/pantilt-hat
Change the contents of the pipan_pipe.py to the code at the bottom of the post which will act as a shim and allow the Pan/Tilt library to act like the mindsensors interface with the same pipe (this isn’t the best solution but at least it won’t be overwritten when the RPi-Cam software is updated). Please note - I am not a Python programmer, feel free so suggest improvements.
Save the pipan_pipe.py somewhere sensible (e.g. /home/pi/Pimoroni) and run it to make sure it has no errors (python pipan_pipe.py, ^c to stop)
When editing /etc/rc.local use the path above (e.g. python /home/pi/Pimoroni/pipan_pipe.py &)
If all other instructions are followed it should just work… I don’t have a light on mine so haven’t tried to get that working, if I get one I will update the post
#!/usr/bin/env python
import time
import os, sys
import pantilthat
MIN_PIPAN_PAN = 50
MAX_PIPAN_PAN = 250
MIN_PIPAN_TILT = 80
MAX_PIPAN_TILT = 220
MIN_PANTILT_PAN = -90
MAX_PANTILT_PAN = 90
MIN_PANTILT_TILT = -86
MAX_PANTILT_TILT = 90
# Number to add to the given pan or tilt input
pan_corr = ((MAX_PANTILT_PAN + MIN_PANTILT_PAN) - (MAX_PIPAN_PAN + MIN_PIPAN_PAN))/2.0
tilt_corr = ((MAX_PANTILT_TILT + MIN_PANTILT_TILT) - (MAX_PIPAN_TILT + MIN_PIPAN_TILT))/2.0
# Scaling factor to apply after correction (force floating point division)
pan_scale = 1.0 * (MAX_PANTILT_PAN - MIN_PANTILT_PAN) / (MAX_PIPAN_PAN - MIN_PIPAN_PAN)
tilt_scale = 1.0 * (MAX_PANTILT_TILT - MIN_PANTILT_TILT) / (MAX_PIPAN_TILT - MIN_PIPAN_TILT)
while True:
pipein = open("/var/www/html/FIFO_pipan", 'r')
line = pipein.readline()
line_array = line.split(' ')
if line_array[0] == "servo":
# Pantilt expects an int, int is also used for string to int conversions of the parameters
pantilthat.pan( int((int(line_array[1]) + pan_corr) * pan_scale))
pantilthat.tilt(int((int(line_array[2]) + tilt_corr) * tilt_scale))
#elif line_array[0] == "led":
# p_led.createPiLight(int(line_array[1]),int(line_array[2]),int(line_array[3]))
pipein.close()
I was working on this but this solution is more elegant than mine.
I wanted to call the Pan/Tilt programmes directly from the php, thus
removing the pipe.
which would mean a fair amount of changes - not nice and error prone.
I have ordered a neopixel light so hopefully can update the code to include that next week. Let me know if you get this working - there are a few others looking for a solution and I didn’t want to post links to this until I had confirmation that it worked for someone else.