@@ -213,8 +213,52 @@ <h3><a name="database_setup"></a>Database Setup</h3>
213213 < p > </ p >
214214
215215 < div >
216- < i > < h4 > pgsql</ h4 > </ i >
217- ToDo
216+ < i > < h4 > postgresql</ h4 > </ i >
217+ The following describes the process to set up a PostgreSQL database.
218+ If your machine already has a PostgreSQL database,
219+ adjust as appropriate to the situation that exists on your computer.
220+ Those with more experience with PostgreSQL are
221+ invited to provide suggestions and corrections to these steps.
222+ < small > < small > < code >
223+ < ul >
224+ sudo apt install postgresql postgresql-contrib
225+ < br > sudo -u postgres psql
226+ < ul >
227+ CREATE ROLE 'your_username_here' LOGIN PASSWORD 'YourPasswordHere';
228+ < br > CREATE DATABASE motionplus WITH OWNER = your_username_here;
229+ < br > GRANT ALL PRIVILEGES ON DATABASE motionplus TO your_username_here;
230+ < br > \quit
231+ </ ul >
232+ </ code > </ small > </ small >
233+ </ ul >
234+
235+ Once the database is set up, check the status via systemctl.
236+ < ul >
237+ < small > < small > < code >
238+ sudo systemctl status postgresql
239+ </ code > </ small > </ small >
240+ </ ul >
241+
242+ Check the login information via the following command line. (note that the
243+ username only seems to accept lowercase)
244+ < ul >
245+ < small > < small > < code >
246+ psql -h localhost -d motionplus -U your_username_here -p 5432
247+ </ code > </ small > </ small >
248+
249+ Specify the following in the MotionPlus configuration parameters.
250+ < ul >
251+ < small > < small > < code >
252+ database_type postgresql
253+ < br > database_dbname motionplus
254+ < br > database_host localhost
255+ < br > database_port 5432
256+ < br > database_user your_username_here
257+ < br > database_password YourPasswordHere
258+ </ code > </ small > </ small >
259+ </ ul >
260+
261+ </ div >
218262 < p > </ p >
219263
220264
@@ -232,27 +276,58 @@ <h3><a name="webcontrol_pages"></a>Webcontrol pages</h3>
232276 < li > < code > {IP}:{port0}/0/status.json</ code > JSON object with information about status of all cameras</ li >
233277 < li > < code > {IP}:{port0}/0/movies.json</ code > JSON object with information about all movies</ li >
234278 </ ul >
235- The following mjpg pages are available via the webcontrol. (Update automatically)
279+ The following mjpg streams are available via the webcontrol. (Update automatically). Specify {camid}
280+ as 0 to obtain a consolidated mjpg stream of all cameras.
236281 < ul >
237282 < li > < code > {IP}:{port0}/{camid}/mjpg</ code > Primary stream for the camera updated as a mjpg</ li >
238283 < li > < code > {IP}:{port0}/{camid}/mjpg/substream</ code > Substream for the camera updated as a mjpg</ li >
239284 < li > < code > {IP}:{port0}/{camid}/mjpg/motion</ code > Stream of motion images for the camera as a mjpg</ li >
240285 < li > < code > {IP}:{port0}/{camid}/mjpg/source</ code > Source image stream of the camera as a mjpg</ li >
286+ < li > < code > {IP}:{port0}/{camid}/mjpg/secondary</ code > Image from secondary detection stream (if active) as a mjpg</ li >
241287 </ ul >
242- The following mpegts pages are available via the webcontrol. (Update automatically)
288+ The following mpegts streams are available via the webcontrol. (Update automatically) Specify {camid}
289+ as 0 to obtain a consolidated mpegts stream of all cameras.
243290 < ul >
244291 < li > < code > {IP}:{port0}/{camid}/mpegts</ code > Primary stream for the camera updated as a mpeg transport stream</ li >
245292 < li > < code > {IP}:{port0}/{camid}/mpegts/substream</ code > Substream for the camera updated as a mpeg transport stream</ li >
246293 < li > < code > {IP}:{port0}/{camid}/mpegts/motion</ code > Stream of motion images for the camera as a mpeg transport stream</ li >
247294 < li > < code > {IP}:{port0}/{camid}/mpegts/source</ code > Source image stream of the camera as a mpeg transport stream</ li >
295+ < li > < code > {IP}:{port0}/{camid}/mpegts/secondary</ code > Image from secondary detection stream (if active) as a mpeg transport stream</ li >
248296 </ ul >
249-
250- The following static pages are available via the webcontrol. (Update manually)
297+ The following static pages are available via the webcontrol. (Update manually) Specify {camid}
298+ as 0 to obtain a consolidated image of all cameras.
251299 < ul >
252300 < li > < code > {IP}:{port0}/{camid}/static</ code > Primary image for the camera</ li >
253301 < li > < code > {IP}:{port0}/{camid}/static/substream</ code > Substream image for the camera</ li >
254302 < li > < code > {IP}:{port0}/{camid}/static/motion</ code > Motion image for the camera</ li >
255303 < li > < code > {IP}:{port0}/{camid}/static/source</ code > Source image of the camera</ li >
304+ < li > < code > {IP}:{port0}/{camid}/static/secondary</ code > Image from secondary detection stream (if active)</ li >
305+ </ ul >
306+ The following actions can be executed by sending post request.
307+ < ul >
308+ < li > < code > eventstart</ code > Start an event</ li >
309+ < li > < code > eventend</ code > End an event</ li >
310+ < li > < code > snapshot</ code > Invoke a snapshot</ li >
311+ < li > < code > pause</ code > Pause motion detection</ li >
312+ < li > < code > unpause</ code > Unpause motion detection</ li >
313+ < li > < code > restart</ code > Restart camera</ li >
314+ < li > < code > stop</ code > Stop camera</ li >
315+ < li > < code > config_write</ code > Write out the configuration to file. User account running Motionplus must have write access to directory</ li >
316+ < li > < code > camera_add</ code > Add a camera</ li >
317+ < li > < code > camera_delete</ code > Delete camera</ li >
318+ < li > < code > config</ code > Set configuration item</ li >
319+ < li > < code > action_user</ code > Execute the on_action_user command. Provide as needed the additional parameter of action_user</ li >
320+ < li > < code > pan_left</ code > Execute the ptz_pan_left command</ li >
321+ < li > < code > pan_right</ code > Execute the ptz_pan_left command</ li >
322+ < li > < code > tilt_up</ code > Execute the ptz_tilt_up</ li >
323+ < li > < code > tilt_down</ code > Execute the ptz_tilt_down</ li >
324+ < li > < code > zoom_in</ code > Execute ptz_zoom_in command</ li >
325+ < li > < code > zoom_out</ code > Execute the ptz_zoom_out command</ li >
326+ </ ul >
327+ Sample commands
328+ < ul >
329+ < li > < code > curl -s -o -X POST {IP}:{port0} --data "camid={camid}" --data "command=eventstart" 1> /dev/null</ code > </ li >
330+ < li > < code > curl -s -o -X POST {IP}:{port0} --data "camid={camid}" --data "command=config" --data "framerate=12" 1> /dev/null</ code > </ li >
256331 </ ul >
257332 </ ul >
258333
0 commit comments