This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Epiphan recording
#1
Hi, 

I have a customer that want to start and stop recording from a http request, and even feedback. 

Got these url from the manager,
Code:
Start recording   http://192.168.0.5/admin/channel1/set_params.cgi?publish_enabled=on



Stop recording;  http://192.168.0.5/admin/channel1/set_params.cgi?publish_enabled=off





Feedback that shows if it on or off :    http://192.168.0.5/admin/channel1/get_params.cgi?publish_enabled=on 


I want to have a button that turn on/off the recording and a feedback object. 

Code:
require('socket.http')
socket.http.TIMEOUT = 15
value = event.getvalue()
if value == false then
   socket.http.request('http://192.168.0.5/admin/channel1/set_params.cgi?publish_enabled=off')
else value == true then
   socket.http.request('http://192.168.0.5/admin/channel1/set_params.cgi?publish_enabled=on')
end


Is is the right way to do it? 

How can i get feedback to a 1bit object that shows 1 or 0?
Reply
#2
Event script can be simplified a bit:
Code:
http = require('socket.http')

value = event.getvalue()
param = value and 'on' or 'off'

http.TIMEOUT = 15
http.request('http://192.168.0.5/admin/channel1/set_params.cgi?publish_enabled=' .. param)

You will need a resident script for polling the status (with non-zero sleep time):
Code:
http = require('socket.http')
http.TIMEOUT = 15
res = http.request('http://192.168.0.5/admin/channel1/get_params.cgi')
log(res)

Post what you get in LM Logs tabs when running this script.
Reply
#3
Hi, 


This is what I get when i run the feedback. 
Code:
* string: <HTML>

<body>
  <h1>Credentials required</h1>
  <p>Username and password are required to access this Epiphan device. Reload the page and try again.</p>
</body>

</HTML>

Now I have the admin and password for the camera. But when I read this page,  https://www.epiphan.com/userguides/pearl...h_http.htm

I'm bit confused where to put the password, in the page they use wget? when they use admin and password to access the camera. 

Where do I put the password in the http request?
Reply
#4
Try putting credentials into the URL: http://user:password@192.168.0.5/...
Reply
#5
Got the same message...

* string: <HTML>

<body>
<h1>Credentials required</h1>
<p>Username and password are required to access this Epiphan device. Reload the page and try again.</p>
</body>

</HTML>
Reply
#6
Your device might use digest authentication mechanism. Try code from this post: https://forum.logicmachine.net/showthrea...64#pid9364
Reply


Forum Jump: