<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.mios.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.mios.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ciprian.bacioiu</id>
		<title>MiOS - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.mios.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ciprian.bacioiu"/>
		<link rel="alternate" type="text/html" href="http://wiki.mios.com/index.php/Special:Contributions/Ciprian.bacioiu"/>
		<updated>2026-06-03T03:57:14Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.8</generator>

	<entry>
		<id>http://wiki.mios.com/index.php/User:Ciprian.bacioiu</id>
		<title>User:Ciprian.bacioiu</title>
		<link rel="alternate" type="text/html" href="http://wiki.mios.com/index.php/User:Ciprian.bacioiu"/>
				<updated>2016-11-21T12:43:44Z</updated>
		
		<summary type="html">&lt;p&gt;Ciprian.bacioiu: /* Luvit server used to receive POST Recordings from HTTP POST enabled sercomm cameras */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Useful scripts and tools ===&lt;br /&gt;
==== Luvit server used to receive POST Recordings from HTTP POST enabled sercomm cameras ====&lt;br /&gt;
===== Usage =====&lt;br /&gt;
* Run the source from the cmd using luvit. If the file is name server.lua do a&lt;br /&gt;
&amp;lt;code&amp;gt;luvit server.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
* Go into the camera administrator page (usually [http://camera_ip/adm/config_trig.htm /adm/config_trig.htm])&lt;br /&gt;
* Settup a Trigger for HTTP Post&lt;br /&gt;
* Go into the HTTP Post configuration page and place your IP address and port that the server is running on&lt;br /&gt;
* Generate a trigger event by accessing the [http://camera_ip/adm/http_trigger.cgi camera_ip/adm/http_trigger.cgi].&lt;br /&gt;
* The server will tell you a POST event was received. Wait till &amp;lt;code&amp;gt;FILE saved ------------------ &amp;lt;/code&amp;gt; is outputed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Download [https://luvit.io/install.html luvit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='lua'&amp;gt;&lt;br /&gt;
local http = require(&amp;quot;http&amp;quot;)&lt;br /&gt;
local https = require(&amp;quot;https&amp;quot;)&lt;br /&gt;
local pathJoin = require('luvi').path.join&lt;br /&gt;
local fs = require('fs')&lt;br /&gt;
&lt;br /&gt;
local function onRequest(req, res)&lt;br /&gt;
	local buffer = {}&lt;br /&gt;
	print(req.socket.options and &amp;quot;https&amp;quot; or &amp;quot;http&amp;quot;, req.method, req.url)&lt;br /&gt;
	if req.method == &amp;quot;POST&amp;quot; then&lt;br /&gt;
		req:on('data', function(chunk)&lt;br /&gt;
			table.insert(buffer, chunk)&lt;br /&gt;
			if type(chunk) == &amp;quot;string&amp;quot; then&lt;br /&gt;
				&lt;br /&gt;
			end&lt;br /&gt;
		end)&lt;br /&gt;
		req:on('end', function()&lt;br /&gt;
			print(&amp;quot;Saving video file -------------------------&amp;quot;)&lt;br /&gt;
			file = io.open(&amp;quot;vid-&amp;quot;..os.time()..&amp;quot;.avi&amp;quot;, &amp;quot;a&amp;quot;)&lt;br /&gt;
			for i = 1, #buffer do&lt;br /&gt;
				print(&amp;quot;Completion: &amp;quot;..i..&amp;quot;/&amp;quot;..#buffer..&amp;quot;&amp;quot;)&lt;br /&gt;
				file:write(&amp;quot;&amp;quot;..buffer[i]..&amp;quot;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			file:close()&lt;br /&gt;
			print(&amp;quot;File saved -------------------------------&amp;quot;)&lt;br /&gt;
		end)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http.createServer(onRequest):listen(8080)&lt;br /&gt;
print(&amp;quot;Server listening at http://localhost:8080/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ciprian.bacioiu</name></author>	</entry>

	<entry>
		<id>http://wiki.mios.com/index.php/User:Ciprian.bacioiu</id>
		<title>User:Ciprian.bacioiu</title>
		<link rel="alternate" type="text/html" href="http://wiki.mios.com/index.php/User:Ciprian.bacioiu"/>
				<updated>2016-11-21T12:38:22Z</updated>
		
		<summary type="html">&lt;p&gt;Ciprian.bacioiu: Created page with &amp;quot;=== Useful scripts and tools === ==== Luvit server used to receive POST Recordings from HTTP POST enabled sercomm cameras ==== * Download [https://luvit.io/install.html luvit]...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Useful scripts and tools ===&lt;br /&gt;
==== Luvit server used to receive POST Recordings from HTTP POST enabled sercomm cameras ====&lt;br /&gt;
* Download [https://luvit.io/install.html luvit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='lua'&amp;gt;&lt;br /&gt;
local http = require(&amp;quot;http&amp;quot;)&lt;br /&gt;
local https = require(&amp;quot;https&amp;quot;)&lt;br /&gt;
local pathJoin = require('luvi').path.join&lt;br /&gt;
local fs = require('fs')&lt;br /&gt;
&lt;br /&gt;
local function onRequest(req, res)&lt;br /&gt;
	local buffer = {}&lt;br /&gt;
	print(req.socket.options and &amp;quot;https&amp;quot; or &amp;quot;http&amp;quot;, req.method, req.url)&lt;br /&gt;
	if req.method == &amp;quot;POST&amp;quot; then&lt;br /&gt;
		req:on('data', function(chunk)&lt;br /&gt;
			table.insert(buffer, chunk)&lt;br /&gt;
			if type(chunk) == &amp;quot;string&amp;quot; then&lt;br /&gt;
				&lt;br /&gt;
			end&lt;br /&gt;
		end)&lt;br /&gt;
		req:on('end', function()&lt;br /&gt;
			print(&amp;quot;Saving video file -------------------------&amp;quot;)&lt;br /&gt;
			file = io.open(&amp;quot;vid-&amp;quot;..os.time()..&amp;quot;.avi&amp;quot;, &amp;quot;a&amp;quot;)&lt;br /&gt;
			for i = 1, #buffer do&lt;br /&gt;
				print(&amp;quot;Completion: &amp;quot;..i..&amp;quot;/&amp;quot;..#buffer..&amp;quot;&amp;quot;)&lt;br /&gt;
				file:write(&amp;quot;&amp;quot;..buffer[i]..&amp;quot;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			file:close()&lt;br /&gt;
			print(&amp;quot;File saved -------------------------------&amp;quot;)&lt;br /&gt;
		end)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http.createServer(onRequest):listen(8080)&lt;br /&gt;
print(&amp;quot;Server listening at http://localhost:8080/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ciprian.bacioiu</name></author>	</entry>

	</feed>