I recently got myself some servo motors and a 16 channel PWM board from adafruit in a dream of controlling a quadpod later on. But until then I am trying to experiment with controlling the servos remotely via a web-page.
I have looked through a tutorial on Adafruit wich allows the use of two servo motors, and a laserpointer. Wich is monitored by a web-cam stationed next to it. The whole project is like a cat-laser toy or something.
I have tried to retrofit this into my design wich is a kind of surveillance with the use of my rPi camera, raspistill and mjpeg streaming, but when I try to control the servos with the web-page supplied in the cat laser-toy project I am getting a few errors when I start the listening server.
Code: Select all
Debugging middleware caught exception in streamed response at a point where response headers were already sent.
Traceback (most recent call last):
File "/usr/share/pyshared/werkzeug/wsgi.py", line 513, in next
return self._next()
File "/usr/share/pyshared/werkzeug/wrappers.py", line 829, in iter_encoded
for item in self.response:
TypeError: 'Response' object is not iterable
I am basically trying to do this as simple as possible:
Have 2 servo motors, one mounted to the other so I can get Y / X control over the camera wich I am also mounting to the one servo.
Have a web-page wich displays the mjpeg stream.
Two buttons wich each control + / - on the Y and X axis.
I am struggling to find out how my web-page can interact with my hardware? Node.js keeps popping up here and there, but I feel it's a bit too advanced for my project.
Are there any beginners tutorials out there, on how to interact with the pi's connected hardware through a web-page? Specifically servos?