Bonsoir Bruno,
Le 03/10/2013 19:48, bruno a �crit :
> Karrigell 2.4 Python 2.7 Ubuntu 12.4
>
> Karrigell port : 8088
> Motion port : 9999
>
> Hello,
>
> I want to control one webcam with Motion and Karrigell to do a
> security webcam that I can connect from my local and from Internet. i
> did a test with Motion alone and all works fine : the port of the
> camera is 9999 and when I start motion I can go in browser at
> http//IP_serveur_motion:9999 and I have the stream of my camera. It is
> the same thing coming from Internet with a compte No-Ip. It works fine.
>
> After I did a little index.ks with Karrigell like this
>
> def index():
> print '<form action = "allumer_cam"><input type="submit"
> value="Voir la cam�ra">'
> print '</form>'
>
> def allumer_cam():
> import subprocess
> subprocess.call('motion')
>
> When I start this little .ks karrigell ( with the port 8088 ) gives my
> button and when I click on it my camera works (the light is switched
> on) and I see in my console the files .jpg and swf that are created in
> tmp/motion so then the motion and the camera work.
> But if I want to see the streaming of my camera with the same adress
> http//IP_serveur_motion:9999 karrigell can't gives me the streaming
> ("connexion failed ...
>
> If somebody can gives me some explanation about this and my bad
> manipulations it will be great because now I am quite lost.
>
I'll try to help you.
First, I think your problem is not Karrigell related.
The description of your set-up is not very clear for me.
1) You use Motion to get the webcam running and to grab pictures in a
local folder. That's clear.
2) You use a web interface to watch the camera pictures. Which program
do you run for this ? Motion ?
3) In the function "allumer_cam", you use subprocess.call() to launch
Motion. This is not good because subprocess.call() returns when the
callee (motion) ends. This means that when you click "Voir la cam�ra",
your Karrigell application is stuck till Motion ends. You have to use
subprocess.Popen() instead.
4) Are you sure Motion is still alive when you try to watch pictures ?
Pictures in /tmp/motion does not mean Motion is currently running.
5) Launching an application from another one can be difficult because
environment variables can be different between a shell launch and an
application launch. This can make the launched application crash. This
can also make the launched application not find the right configuration
files.
6) How do you launch Motion from the shell ?
Cordialement,
Nicolas